I tried to fix things, and I first checked the symlinks and that seems to be ok.
I have:
releases/123456789/public
(this is where my host is pointing at)
releases/123456789/public/index.php
(this is where I have the kirby roots being setup.
releases/123456789/public/media
This is the symlink that Kirby should make if it does not exist yet.
This is also the point where it fails, because during the creation of that symlink it says that the directory $kirby->roots()->media()
does not exist.
But I also have this
shared/storage/media
shared/storage/accounts
shared/storage/cache
shared/storage/sessions
shared/storage/content
So the folder media exists.
I also have this shell command run after the deploy:
ln -fs %shared_path%/storage %release_path%/storage
In my case this resolves to:
releases/123456789/storage -> shared/storage
Also within the Kirby setup I have this line (just as you do):
'storage' => $storage = $base . '/storage',
So this should determine the symlink storage
within my release as the $storage
.
When doing:
'media' => $storage . '/media',
this later on, this should to my understanding kind of chain two symlinks.
And I think this is where the problem occurs?!
The $storage
itself is a symlink and we are defining the media root
as a child of that storage folder.
And then later we try to make the symlink with kirby and it tells me that this directory does not exist…
Or am I missing something?
Just for the sake of completeness:
Content of the shared folder:
$ cd /cms.hostname.ch
$ ls -l
lrwxrwxrwx 1 systemuser psacln 25 Apr 10 10:35 current -> ./releases/20200410103538
drwxr-xr-x 4 systemuser psacln 4096 Apr 10 10:35 releases
drwxr-xr-x 3 systemuser psacln 4096 Apr 10 10:28 shared
Content of the shared folder:
$ cd /cms.hostname.ch/shared/storage
$ ls -l
total 20
drwxr-xr-x 5 systemuser psacln 4096 Apr 10 09:58 accounts
drwxr-xr-x 2 systemuser psacln 4096 Apr 10 09:54 cache
drwxr-xr-x 4 systemuser psacln 4096 Apr 9 23:06 content
drwxr-xr-x 4 systemuser psacln 4096 Apr 10 09:56 media
drwxr-xr-x 2 systemuser psacln 4096 Apr 10 10:05 sessions
Content of the release
$ cd /cms.hostname.ch/releases/20200410103538
$ ls -l
total 68
-rw-r--r-- 1 systemuser psacln 222 Apr 10 10:32 composer.json
-rw-r--r-- 1 systemuser psacln 48992 Apr 10 10:32 composer.lock
drwxr-xr-x 8 systemuser psacln 4096 Apr 10 10:32 kirby
drwxr-xr-x 3 systemuser psacln 4096 Apr 10 10:32 public
drwxr-xr-x 8 systemuser psacln 4096 Apr 10 10:32 site
lrwxrwxrwx 1 systemuser psacln 30 Apr 10 10:57 storage -> /cms.hostname.ch/shared/storage
(Where I also tried to make a relative symlink: lrwxrwxrwx 1 systemuser psacln 20 Apr 10 10:59 storage -> ../../shared/storage
. Both solutions don’t work…
Thanks for any hints to solve this…
------ Edit:
Oh I think I have found something:
Kirby does set symlinks a bit differently, I guess:
$ cd /cms.hostname.ch/releases/20200410103538/public
$ ls -l
-rw-r--r-- 1 systemuser psacln 1799 Apr 10 10:32 index.php
lrwxrwxrwx 1 systemuser psacln 91 Apr 10 10:32 media -> /home/httpd/vhosts/XXX/cms.hostname.ch/releases/20200410103222/storage/media
drwxr-xr-x 2 systemuser psacln 4096 Apr 10 10:32 proxy
You see that it messing up that symlink of media…
Do you know how I could fix this?
(Manually rewriting the symlink made by kirby to lrwxrwxrwx 1 systemuser psacln 16 Apr 10 11:05 media -> ../storage/media
works…, but I don’t want any manual work of course)