Search code examples
shopware

Shopware 6 error when saving product (Method Not Allowed The requested method PATCH is not allowed for this URL)


I just installed Shopware 6. When I try to save a new product it throws a console error for url https://myshop.com/api/v3/product/b152cac84ddc4aadbecac8e3ba5f65af

Method Not Allowed
The requested method PATCH is not allowed for this URL.

When I fill in minimum required fields it does save. But when I fill in more fields it throws this error. I did not test it very thoroughly, so I am not sure which fields causes it.

It's stock Shopware 6, I didn't do any custom stuff just yet.


Solution

  • It seems it was a server configuration issue with Direct Admin where non-standard HTTP methods were blocked by default.

    Fixed it with

    cd /usr/local/directadmin/custombuild
    ./build set http_methods GET:HEAD:POST:PUT:DELETE:PATCH
    ./build rewrite_confs 
    

    Source: https://help.directadmin.com/item.php?id=700