Uncaught Exception for temp files after manual installation

Silverstripe Version:
4.4.4
Question:
I had SS 4.3 running on this server and then, after a while it just would show 404 (with the default theme) all of a sudden. I thought, I will just install it from scratch and am now trying to setup a SS 4.4.4 site. This is on a shared host with strato.de (that was not my choice…).
I can’t get composer installed, so I copied my working naked local installation(done with composer) to the server via terminal (SFTP would break all symbolic links).
I had to put www.url.de/public as the SS_BASE_URL in the .env file to make the installer work.
I changed the rest of .env file to match the server and rerunning the install.php showed that all requirements are met. I imported the DB from the local install and that worked without errors.
When I now call /admin it redirects me to /public/admin/pages/ but then throws a server error, which reads as follows in the logs:

error-log.ERROR: Uncaught Exception Symfony\Component\Filesystem\Exception\IOException: "A temporary file could not be created." at /mnt/web206/e1/87/5829287/htdocs/vendor/symfony/filesystem/Filesystem.php line 636 {"exception":"[object] (Symfony\\Component\\Filesystem\\Exception\\IOException(code: 0): A temporary file could not be created. at /mnt/web206/e1/87/5829287/htdocs/vendor/symfony/filesystem/Filesystem.php:636)"}

The phpmyadmin also shows a temp file error (Unable to create the cache directory (/var/tmp/1480669/twig/09)), so I am wondering if something on the server is off.

I am out of my wits. I have no permissions to do any chmod on the var/tmp but that has 777, so should be fine. I could not find any related issues anywhere and would really appreciate any hints.

I have not had any of these problems on my local machine or other hosts… but before I go and yell at them, I need to get to the bottom of things.

Thanks for your support.
Best,
Sam

You need to go and yell at them. It seems like there are permissions (and most likely) ownership issues with the files.

On another note, you don’t need to use symlinks for the site if you don’t want to… run composer vendor-expose copy and it will copy the files to the public directory instead of symlinking them. You should be able to upload via sftp then.

1 Like

Thank you for the very helpful hint with the symlinking alternative! I will try that this week and meanwhile attempt a rather hopeless support request to the provider.
Should I figure it out, I will gladly post it here.

LOL. Just for the sake of it I tried to reach the URL now and - tadaaaa - it magically works as if nothing ever went wrong. WFT! Lost a nice Sunday on this.
My solution for strato.de - just let it settle a while, it might just work…