-
-
Notifications
You must be signed in to change notification settings - Fork 160
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
Filesystem permission issues while trying to import #169
Comments
Next problem: For a test I exported my chrome bookmarks, and tried to import them, but immediately got the error
I'm not sure exactly what application logs I'm supposed to consult. Nothing under the logs directory, and docker logs from all containers also don't provide any details for this. PS. I'm able to add individual links. It's just the import that fails. |
Hi! You are right, the command is wrong because there were some changes in the last weeks. About the bookmark import: please have a look at the storage/logs directory in the Docker container, or in the /logs directory if you have |
Actually docker creates the required directories with the PUID/PGID set in the app. Normally this can be set as an ENV but it has no effect here. I had to do a lot of changes to the docker-compose.yml to get it to run at all, but I now started over again. First obstacle is that linkace_nginx_1 keeps restarting. A docker logs linkace_nginx_1 reveals:
|
Please have a look at #164 (comment) |
This is really weird - I thought I updated this yesterday but I don't see my post today. Probably I was dreaming. Here we go again. After making the change in #164 it now starts, but still, trying to import links from chrom still fails. Now I see the following in the log:
It seems it gets a write error inside the container, not sure what to do about that. Also, I noticed that it runs with UID 1 - daemon. Normally it should be possible to set the effective UID/PID in the docker start script, but I don't see this option here. Is that perhaps something you could add at some point? |
Have to take a look into this. Please be patient. |
Hello, I have the exact same writing problem when I try to import. |
Please test this with the new release. |
it works for me. Thanks for your time ! |
Sorry, it still doesn't work here. I shut down the stack, deleted everything, downloaded from the github page, modified as required, did the up, the page came up, I go to import, pick a html file from a chrome export, and after having run for a while it dies with the error message "Something went wrong while trying to import the bookmarks. Please consult the application logs." I don't see anything obvious in the logs though. Also, would it be possible to add support for PUID/PGID environment variables so it doesn't run with root permissions, that would be nice!
|
What about the application logs in the storage/logs directory? PHP issues should be logged there. Setting a different user id is not supported via environment variables yet, but may be done by editing configuration files. |
The error appears to still be the same: I noticed that folders are variously created with UID 1 (daemon) and UID 0 (root). For example the logs folder are created as root, but nothing can be written to it until it has been chown to daemon. Sorry I am not a programmer and don't have much experience modifying the Dockerfile. All docker containers I've seen so far provide the PUID/PGID setting as part of the environment settings. |
If you can't solve the permission issues you should remove the mounting of any logs for now. Remove Nothing must be done in the Dockerfiles. The user running PHP can be set in configuration files. Please see the above links I shared. |
I have already read through all the links you provided. The only reference to UID I see is
I don't see how that is supposed to be of any help. Anyway, I commented out the logs line, and ran it, but it still comes up with the same error as before
I then cleaned up the whole thing and started over. Not easy as you have different instructions on different pages, but eventually I have it boiled down to this:
(I prefer using docker exec rather than docker-compose run, as the latter method scatters orphans around) |
As of the latest release, there is only one: https://www.linkace.org/docs/v1/setup/setup-with-docker/ Please run the regular setup after starting the Docker containers. |
I have tested this with the latest files from the repository and the current guide available on the website. To prevent permission issues, I have set a
I was able to start the application and logs are being written to the storage/logs directory, and are also available on the host. |
Good on ya updating the setup document, that is a great help. I can't tell exactly which procedures and pages I followed, I didn't write them all down, just followed what was available on the page. There is still some confusion, but the setup document makes it a bit easier. Things like, why do you need 3 different docker-compose files, 2 different nginx.conf files. Anyway, back to the point. I cleared up everything (again). Ran the install according to your setup document "simple" version, including the user: "0" as suggested here, but it still conked out with the unwritable files errors. I really don't understand how you can have it working on your system, are you developing under windows? Any Linux system would require a valid user with appropriate rights to write files. Anyway, let's also pass on that, I just commented out the logs line in the docker-compose, and now it started the stack. It still doesn't work though: As far as I can see from docker-compose logs, the problems comes down to this, if that helps: app_1 | [php-fpm:access] 127.0.0.1 - 12/Nov/2020:21:24:13 +0000 "GET /index.php" 500 /app/public/index.php 69.826 4096 114.57% |
Did you replace the I have talked to the maintainers of the PHP Image and they said giving proper permissions to the mounted directory is they way to go as changing the user can lead to unintended side effects. |
Actually regardless of the user line given, it always will use userid 1000 - which isn't the docker user. In the end I had to chmod logs and .env 777. Not acceptable for production use, but allowed the test to continue. Now, again importing a chrome bookmarks export file:
and in the import log:
When checking the import file this correspond to the location of the first bookmark folder, so it seems the app don't know what to do about that. It is what it is, I guess I have to conclude that it sort of works at this time, when making allowance for the user id. I don't really understand what you mean by changing user can have unintended side effects. Most of the docker containers I run either link no local volumes, or allow the setting through either UID/GID or PUID/PGID environment variables. |
I am sorry that I can't help you with this topic. Mounted Docker volumes are a pain, and I can only share the insights I gathered from the image maintainers. |
Based on your feedback i decided to implement a log viewer into the app and switch to Docker volumes for log storage. |
I was struggling with the setup instructions for some time:
Eventually I found that the working command should be
docker exec -it linkace_app_1 php artisan key:generate
Providing this to help others in the same situation, but it would probably be an idea to fix the instructions - both here an on the website.
The text was updated successfully, but these errors were encountered: