Platform.sh - 500 error after deployment & install


#1

Hi,

after a lot of trial and error (the documentation is outdated), I finally managed to deploy to platform.sh. I am using sylius/sylius-standard with nothing changed, everything exactly installed regarding the docs. My local install works fine.

After deploying and running “php bin/console sylius:install -e prod” on platform.sh ssh, I get the following:

Step 4 of 4. Installing assets.
-------------------------------

Installing Sylius assets for environment prod.

Cannot run command due to bad directory permissions (tried to change permissions to 0755).

Set "/app/public" writable and run command "sylius:install:assets"
                                                                            
 [OK] Sylius has been installed, but some error occurred.   

This is not mentioned in the docs on deploying Sylius on platform.sh. Platform.sh is read-only, so how is the install supposed to work?

When I try to open the site URL I get the following error:

2019/02/02 17:46:40 [error] 126#0: *1 rewrite or internal redirection cycle while redirect to named location "@rewrite", client: XXX, server: , request: "GET / HTTP/1.1", host: "master-XYZ.eu-2.platformsh.site"

I tried clearing the cache etc

After trying for hours and hours to follow the docs and only getting errors, errors and errors because they are unfortunately out of date, I am starting to get frustrated and don’t know how to continue…

Please help. Thanks


#2

Finally found the solution. The public/index.php was missing on the production server facepalm. Because it was removed during the build hook in the suggested .platform.app.yaml in the docs. I guess this was meant as a kind of maintenance mode, but doesnt work as intended.

I will summarize my experience with this soon, so the docs for platform.sh deployment can be updated :).