Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error 507 NoWriteAccessOnLogsExceptions #180

Open
louis6999 opened this issue Jan 17, 2024 · 10 comments
Open

Error 507 NoWriteAccessOnLogsExceptions #180

louis6999 opened this issue Jan 17, 2024 · 10 comments
Labels
Awaiting Reply Will be closed if no reply in 14 days

Comments

@louis6999
Copy link

louis6999 commented Jan 17, 2024

Hi,

I use the docker-compose.yml provided in the code.
I don't have any problem to start my docker but when i try to connect i have this error 507
NoWriteAccessOnLogsExceptions
Could not write in the logs. Check that storage/logs/ and containing files have proper permissions.

@ildyria
Copy link
Member

ildyria commented Jan 19, 2024

Can you check that you have in your host:

root@vps:Lychee-docker/lychee  ✗
▶ ls -ll
total 24
drwxr-xr-x  2 root  root   4.0K Jan 18 15:20 conf
drwxrwsr-x  2 guest guest  4.0K May 22  2023 logs
drwxr-xr-x  6   999 docker 4.0K Jan 18 15:19 mysql
drwxrwsr-x  2 guest guest  4.0K Jan 19 03:06 sym
drwxrwsr-x 14 guest guest  4.0K Dec 27 13:29 uploads

i.e. make sure guest has write access on the lychee/logs in your host.

@ildyria ildyria added the Awaiting Reply Will be closed if no reply in 14 days label Jan 19, 2024
@OdinVex
Copy link

OdinVex commented Feb 2, 2024

**** Create user and use PUID/PGID ****
        User UID :      1000
        User GID :      1000
**** Make sure Laravel's log exists ****
**** Set Permissions ****
**** Start cron daemon ****

External Permissions:

-rw-rw-r-- 1  1000           1000    0 2024-02-01 23:38 empty_file
-rw-rwSr-- 1    33           1000    0 2024-02-01 23:38 laravel.log

What GID/PID is necessary? So tired of this anti-root kick everyone is on, you can't run software the way you want anymore.

Edit: Even chmodding (for the sake of testing) 777 and chowning to the lowest (highest number, lowest permission*) IDs doesn't help.

Edit: Skipping permissions setting (because those cmds give whack permissions inside the container) and I can get through to Setting the environment but anything further results in I/O error for file '.env'. No idea where it's wanting to put such a file, I am not using any .env, those are useful only to head-enabled OS installations. My installation is Docker only using a compose.

@d7415
Copy link
Contributor

d7415 commented Feb 2, 2024

What GID/PID is necessary?

That only matters if you're accessing the files from outside the container, or on a system that limits such things.

Skipping permissions setting (because those cmds give whack permissions inside the container)

If you mean the ones in entrypoint, those set the recommended permissions inside the container.

I am not using any .env

If you want Laravel to work, you're going to have to (or manually hack all of your settings into Lychee's files I suppose)

@OdinVex
Copy link

OdinVex commented Feb 2, 2024

That only matters if you're accessing the files from outside the container, or on a system that limits such things.

Nah, I had to set everything to 33 (www-data). A clean folder created by docker on first start of container and it'd not do the permissions correctly.

If you mean the ones in entrypoint, those set the recommended permissions inside the container.

They break it (owner needed to stay 33 (www-data)). The built-in lychee is 1000 but www-data still couldn't read/write to it all.

If you want Laravel to work, you're going to have to (or manually hack all of your settings into Lychee's files I suppose)

I found out which .env it was talking about, container:/conf/.env. After setting PGID, PUID as I mentioned above (33) it all worked fine.

Now my only trouble is that Lychee doesn't seem to comprehend APP_DIR. I suspect an issue about APP_FORCE_HTTPS too but I can't confirm it until I can get Lychee to stop ignoring APP_DIR.

Also, DB_SOCKET is worthless. To anyone that finds it, you're welcome: DB_HOST=localhost;unix_socket=/var/run/YOUR_SQL_SOCKET.sock. Yes, the unix_socket in there is required or it just shits an error about files not being found, even if DB_SOCKET is used.

@d7415
Copy link
Contributor

d7415 commented Feb 2, 2024

Ok, so.

  1. You do not appear to be doing anything similar to the original issue, so this is the wrong place for this discussion
  2. You appear to have an extremely unusual setup

They break it (owner needed to stay 33 (www-data)). The built-in lychee is 1000 but www-data still couldn't read/write to it all.

The entrypoint script adds www-data (in the container) to the lychee group so that it has access.

Also, DB_SOCKET is worthless. To anyone that finds it, you're welcome: DB_HOST=localhost;unix_socket=/var/run/YOUR_SQL_SOCKET.sock. Yes, the unix_socket in there is required or it just shits an error about files not being found, even if DB_SOCKET is used.

This is a very unusual setup. You are free to use the Docker image as you wish, but if you do unusual things it's on you to figure out how to make them work, which you appear to have done.

@OdinVex
Copy link

OdinVex commented Feb 2, 2024

  1. You appear to have an extremely unusual setup
    This is a very unusual setup. You are free to use the Docker image as you wish, but if you do unusual things it's on you to figure out how to make them work, which you appear to have done.

Not at all, this is a rather common setup sharing a unix socket instead of opening up ports and networking (and their overhead and latencies coupling keeping track of container names for DHCP etc) between containers and software. Nothing unusual about that at all.

The entrypoint script adds www-data (in the container) to the lychee group so that it has access.
It doesn't. A clean setup, clean filesystem (allowing Docker to create it entirely of its own, so nothing of mine in the way at all) and it'll complain about not being able to access it. Accessing a shell console inside Lychee allows me to see it really wrecks the permissions on those, so I added SKIP_PERMISSIONS and fixed it within the shell of the container.

The bit about Lychee not respecting APP_DIR (or in short, the inability to use a subpath on a reverse-proxy which is a proper setup) doesn't belong here, it was just off the top of my head.

@d7415
Copy link
Contributor

d7415 commented Feb 2, 2024

It doesn't

It does it at build time and again right here.

This seems to work for every user who isn't you.

@OdinVex
Copy link

OdinVex commented Feb 2, 2024

It doesn't

It does it at build time and again right here.

This seems to work for every user who isn't you.

I noticed the Dockerfile and the entrypoint.sh, that's where I discovered the means to skip those permissions setting. I even tested it without any volume mounts and it still behaved that way, so I'm wondering if it is this NAS (a Qnap).

@d7415
Copy link
Contributor

d7415 commented Feb 2, 2024

I'm wondering if it is this NAS (a Qnap).

That's very possible. They sometimes do weird things to permissions.

@OdinVex
Copy link

OdinVex commented Feb 2, 2024

I'm wondering if it is this NAS (a Qnap).

That's very possible. They sometimes do weird things to permissions.

That is indeed why I mentioned it. It might also be why I need 33:33 on all of that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Reply Will be closed if no reply in 14 days
Projects
None yet
Development

No branches or pull requests

4 participants