Installation via Composer fails

Support General Installation via Composer fails

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #49896
    Lukas KaisersLukas Kaisers
    Participant

    Hi, unfortunately the installation of Meta Box currently fails (HTTP/2 415) when using Composer. The complete error message is: The "https://packages.metabox.io/<MY_LICENSE_KEY>/packages.json" file could not be downloaded (HTTP/2 415 ).

    I have checked why I might get a 415 error and it seems that the Content-Type return header is set to "text/html; charset=UTF-8" instead of "application/json" what I would expect here.

    #49897
    PeterPeter
    Moderator

    Hello Lukas,

    Thanks for reaching out.

    I've tested to install Meta Box plugins via Composer but didn't see any issues

    
    {
    	"repositories": [
    		{
    			"type": "composer",
    			"url": "https://packages.metabox.io/YOUR_LICENSE_KEY"
    		}
    	],
    	"require": {
    		"wpmetabox/mb-custom-post-type": "^2.3",
    		"meta-box/meta-box-group": "dev-master",
    		"meta-box/mb-settings-page": "dev-master"
    	},
    	"extra": {
    		"installer-paths": {
    			"vendor/meta-box/{$name}": [
    				"vendor:wpmetabox",
    				"vendor:meta-box"
    			]
    		}
    	},
    	"autoload": {
    		"files": [
    			"vendor/wpmetabox/mb-custom-post-type/mb-custom-post-type.php",
    			"vendor/meta-box/mb-settings-page/mb-settings-page.php",
    			"vendor/meta-box/meta-box-group/meta-box-group.php"
    		]
    	}
    }
    

    Save the code to a file composer.json and replace YOUR_LICENSE_KEY with your license key and run composer install. Following the documentation https://docs.metabox.io/composer/

    #49898
    Lukas KaisersLukas Kaisers
    Participant

    Hello Peter,

    except of the "extra" and "autoload" properties everything is the same in my composer file. I should have mentioned that the error only occurred in my CI pipeline (GitHub actions) and not locally. Today somehow the installation succeeded again. Did you change anything?

    #49899
    Lukas KaisersLukas Kaisers
    Participant

    Unfortunately, I have to take back my last message. The installation failed again. What does the HTTP status 415 mean?

    #49900
    Lukas KaisersLukas Kaisers
    Participant

    Hi,

    I wanted to provide a short update.

    At the moment, the installation is working again without any change on our side, and we are not able to reproduce the issue consistently in a local environment.

    However, we were able to reproduce the problem in GitHub Actions with raw curl requests to the Composer endpoint.

    In GitHub Actions we observed:

    * requests to https://packages.metabox.io/<KEY>/packages.json could return 415 Unsupported Media Type
    * the same endpoint also returned 302 Found in other cases
    * when explicitly sending Accept: application/json, the request returned 302 Found consistently in our CI tests

    Because the behavior is not consistent across environments and can change without configuration changes on our side, this looks like an environment-dependent issue, possibly related to proxy/CDN/WAF handling or request classification.

    So while the issue is currently no longer occurring for us, we believe there is still an underlying instability in how requests to the package endpoint are handled in CI environments.

    Please let us know if you would like the curl logs from the GitHub Actions runs where the endpoint returned 415.

    Best regards

    #49901
    Lukas KaisersLukas Kaisers
    Participant

    I'm probably giving up on this and start to version Meta Box AIO myself again via a private GitHub repo. Even with the explicit Accept header I had failing installations.

    #49903
    PeterPeter
    Moderator

    Hello Lukas,

    We didn't change anything on our side. It could be related to the Cloudflare protection that we are using. Let me ask the development team to check the issue and I will get back to you as soon as possible.

    Thank you.

    #49905
    PeterPeter
    Moderator

    Hello Lukas,

    Our development team confirms that we don't have any restriction rules for the link https://packages.metabox.io/
    I also notice that this URL isn't correct https://packages.metabox.io/<KEY>/packages.json as you can see in my demo code above. The correct URL is https://packages.metabox.io/<KEY>/ without packages.json.

    Can you please share your composer file and a screen record of how you setup the Github action?

    #49911
    Lukas KaisersLukas Kaisers
    Participant

    Hello Peter,

    the composer file roughly looks like this (simplified example file).
    The GitHub workflow is nothing special, I'm using the "ubuntu-latest" runner (nothing self-hosted), the shivammathur/setup-php@v2 action to install PHP (currently with version 8.4) and then I'm calling composer install (without a lockfile because I want to download the latest version).

    The workflow just completed successfully, the problem is that I can't reproduce the issue. Sometimes it works, sometimes not. When it doesn't, I'm getting the error code that I've posted at the top of this thread.

    #49916
    PeterPeter
    Moderator

    Hello,

    I'm also not able to reproduce the issue on my side. If you have more information about this issue or steps to reproduce it, please let me know.

    Thanks.

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.