platformsh-templates / typo3

TYPO3 template for Platform.sh.
GNU General Public License v2.0
2 stars 5 forks source link

Unable to save site configurations #29

Open 1t53c5v03 opened 2 years ago

1t53c5v03 commented 2 years ago

Describe the bug

Hey, sorry if I'm doing this wrong, I'm new to platform.sh, TYPO3 & well, basically everything except basic web development. I'm not entirely sure, if this is a bug or if I'm just misunderstanding the supposed usage of platform.sh.

I just started fiddling with the TYPO3 template, because I would like to use it in a project. After failing to getting it to run locally with platform.sh following the set-up guide and the docs, I currently try to build a simple example site using the existing Congratulations site as a reference. While I was able to edit and add pages and templates, I can't save site configurations.

When trying to save a new site configuration for a site I get an error page. The log shows:

Core: Exception handler (WEB): Uncaught TYPO3 Exception: #1170251401: Could not create directory "/app/config/sites/MY_CONF_FILE/"! | RuntimeException thrown in file /app/public/typo3/sysext/core/Classes/Utility/GeneralUtility.php in line 2069. Requested URL: https://main-MY_URL.platformsh.site/typo3/index.php?route=%%2Fmodule%%2Fsite%%2Fconfiguration&token=--AnonymizedToken--&action=save

When trying to save the existing site configuration for the Congratulations site, there is no error page. It just doesn't work and the log says:

Core: Error handler (BE): PHP Warning: fopen(/app/config/sites/main/config.yaml): failed to open stream: Read-only file system in /app/public/typo3/sysext/core/Classes/Utility/GeneralUtility.php line 1848

I guessed the problem might be lack of permissions so I went to Admin Tools > Environment > Directory Status which lists a number of folders as not writable: image The fix button doesn't change anything.

Now I'm totally confused where I should put which information in this form, but please ask if you need more information. Thanks!

Include some logs

When trying to save a new site configuration for a site I get an error page. The log shows:

Core: Exception handler (WEB): Uncaught TYPO3 Exception: #1170251401: Could not create directory "/app/config/sites/MY_CONF_FILE/"! | RuntimeException thrown in file /app/public/typo3/sysext/core/Classes/Utility/GeneralUtility.php in line 2069. Requested URL: https://main-MY_URL.platformsh.site/typo3/index.php?route=%%2Fmodule%%2Fsite%%2Fconfiguration&token=--AnonymizedToken--&action=save

When trying to save the existing site configuration for the Congratulations site, there is no error page. It just doesn't work and the log says:

Core: Error handler (BE): PHP Warning: fopen(/app/config/sites/main/config.yaml): failed to open stream: Read-only file system in /app/public/typo3/sysext/core/Classes/Utility/GeneralUtility.php line 1848

Reproducing

  1. Get a TYPO3 template
  2. Login in backend
  3. Go to site configuration
  4. Open site configuration of Congratulations site
  5. Change anything
  6. Save

Expected behavior

Either being able to save site configurations without unhandled exceptions or a much better tutorial on how (not) to use the TYPO3 template.

Your environment

The standard Platform.sh TYPO3 template?

Screenshots

there's one up there?

Additional context

Why are there so many fields here? :/

gilzow commented 2 years ago

@1t53c5v03 Thanks for posting this. Platform.sh builds read-only application containers, where all code changes need to be committed to the repository. This template follows that set up and assumes you will manage site configurations via their config.yaml file committed to the repository.

However, that doesn't mean you HAVE to do it this way. If you would prefer instead to use the web interface to manage site configurations, you can do so by adding a mount in your .platform.app.yaml file. Something like

  "config/sites":
    source: local
    source_path: "sites"

Note: if you add the mount but don't remove the config/sites/main/config.yaml file from your repository, you'll see an error during the build:

        W: The mount '/config/sites' has a path that overlaps with a non-empty folder.
        The content of the non-empty folder either comes from:
         - your git repository (you may have accidentally committed files).
         - or from the build hook.
        Please be aware that this content will not be accessible at runtime.

Which just indicates that because you have a mount that overlaps a path with a file in the repository, the file(s) in that path won't be available once the mount has been mounted.

Unfortunately, you can't do both though: have your site configuration files maintained in the repository AND use the web interface to change the file.

I can see how this can be confusing though. We'll add a note to the notes section of the documentation for Typo3 to help clarify.