Installation and Varnish Test failed on Magento Marketplace: Solved

Installation and Varnish Test failed on Magento Marketplace: Solved

Recently I created an extension and when I was trying to submit this extension to Magento Marketplace, I got this error “Installation and Varnish Test failed on Magento Marketplace”.  I  tried to look into the code and file structure and everything seems to be correct and in place. It was all very time consuming and frustrating when we have no clue as to why margento marketplace throwing Installation and Varnish test failed error. This error doesn’t go away no matter what code change you do.

I also went through official magento’s devdocs for installation and varnish cache but no luck.

Creating magento 2 extension and submitting it to magento marketplace itself very cumbersome process and if you are getting stuck on the very first step, it is really very disappointing and same was happening to me.

I gone through man articles but got no solution. Finally after hitting hard and spend good amount of time, I passed through the installation and Varnish test.

It is surprising that the problem was very little and is limited only to my composer.json file. I am here sharing my composer.json file which initially causing error.

{
    "name": "enweby/stockindicator",
    "description": "Enweby Stock Status Indicator",
    "type": "magento2-module",
    "version": "1.0.0",
    "license": [
        "OSL-3.0",
        "AFL-3.0"
    ],
    "require": {
        "php": "~7.0.13||~7.1.0||~7.2.0||~7.3.0",
        "magento/framework": "~100.0.4"
    },
    "authors": [
        {
          "name": "enweby",
          "email": "support@enweby.com",
          "homepage": "https://www.enweby.com",
          "role": "developer"
        }
    ],
    "autoload": {
        "files": [
            "registration.php"
        ],
        "psr-4": {
            "Enweby\\StockIndicator\\": ""
        }
    }
}

This composer.json codes seems perfectly fine and should not through any error but still on submitting extension to  magento markeplace it may throw error “Installation and Varnish Test failed”.

Problem

The problem in above code is in below part

“require”: {
“php”: “~7.0.13||~7.1.0||~7.2.0||~7.3.0”,
“magento/framework”: “~100.0.4”
}

The problem there is magento uses latest version of composer, php and magento 2 to test extensions. Above code is correct but not be compliance with latest versions of php, composer, and magento 2, which is being used to validate and test extension for varnish and installation test.

Solution:

I changed the code compatible with latest available php version and latest magento framework so my composer.json file looked like this

{
    "name": "enweby/stockindicator",
    "description": "Enweby Stock Status Indicator",
    "type": "magento2-module",
    "version": "1.0.0",
    "license": [
        "OSL-3.0",
        "AFL-3.0"
    ],
    "require": {
        "php": "~5.5.0|~5.6.0|~7.0.0|~7.1.0|~7.2.0|~7.3.0|~7.4.0",
        "magento/framework": "103.0.*"
    },
    "authors": [
        {
          "name": "enweby",
          "email": "support@enweby.com",
          "homepage": "https://www.enweby.com",
          "role": "developer"
        }
    ],
    "autoload": {
        "files": [
            "registration.php"
        ],
        "psr-4": {
            "Enweby\\StockIndicator\\": ""
        }
    }
}

Notice in above composer.json I changed a certain part of code which is given below .

“require”: {
“php”: “~5.5.0|~5.6.0|~7.0.0|~7.1.0|~7.2.0|~7.3.0|~7.4.0”,
“magento/framework”: “103.0.*”
},

Conclusion:

So in conclusion, we can say that in composer.json this certain codes needs to be compatible with the current version magento marketplace is using to validate and test Installation and Varnish testing.

I hope, this article will to help other developers struggling to submit extension.

Good Luck !

Scroll to Top