Open GH15ADF opened 1 month ago
The "%SECURE%" placeholder should map to the uploads/
folder in the Part-DB root (as long as you have not changed it).
So the placement of the files should be correct. Do the files have the correct permissions, so that the webserver can access (read and write) them? I would assume that especially with docker, it could be easy to get the permissions wrong.
Thanks for the info and I confirm that I am running in Docker. After making the permission changes you suggested, I am still seeing "file not found". I did not knowingly change anything including %SECURE%. I'm not even sure I understand how that parameter is set.
As you mentioned, I did not have the correct owner:group on the uploads/
folders and children, so set them to www-data:www-data
root@b89d0034f15c:/var/www/html# ls -la uploads/
total 7927
drwxr-xr-x 3 www-data www-data 4 Sep 13 00:15 .
drwxr-xr-x 1 www-data www-data 4096 Sep 9 19:57 ..
drwxr-xr-x 6 www-data www-data 6 Feb 8 2021 files
I also modified all my directory permissions to 755 which matches the permissions in the public/media
folders
root@b89d0034f15c:/var/www/html# tree -dp /var/www/html/uploads/files
[drwxr-xr-x] /var/www/html/uploads/files
|-- [drwxr-xr-x] FootprintAttachment
|-- [drwxr-xr-x] PartAttachment
|-- [drwxr-xr-x] ProjectAttachment
`-- [drwxr-xr-x] Temporary
My attachment files permissions are now set to 644 because that is what I see when I inspect my one test attachment to a test part.
############# My test attachment ##################
root@b89d0034f15c:/var/www/html# ls -la /var/www/html/public/media/part/310/testattachment-66e5799bea4fb.pdf
-rw-r--r-- 1 www-data www-data 37832 Sep 14 11:55 /var/www/html/public/media/part/310/testattachment-66e5799bea4fb.pdf
############# attachment file not found part ##################
root@b89d0034f15c:/var/www/html# ls -la /var/www/html/uploads/files/PartAttachment/4dd95690-6a3b-11eb-869a-1fccd4923431.pdf
-rw-r--r-- 1 www-data www-data 1731903 Feb 8 2021 /var/www/html/uploads/files/PartAttachment/4dd95690-6a3b-11eb-869a-1fccd4923431.pdf
Can I look at log entries or turn on logging to troubleshoot? I looked around in /var/log
in the Docker container but there is not much there.
In docker container the logs are available via dockers log mechanism. (So you can view them for example with docker logs)
This is a question, not really a bug per se.
I just migrated my database from Partkeepr to PartDB without any problems and now I am trying to put the attachment files in the proper directory. However, I am seeing the "file not found" icon in the UI. I attempted to follow the direction in the Migrate from PartKeepr to Part-DB page. The following is the directory structure in the original Partkeepr docker container:
This is the directory structure in the PartDB docker container: In PartDB docker container:
The other piece of information I will add is that inspecting the Sqlite DB directly, I see
%SECURE%/PartAttachment/4dd95690-6a3b-11eb-869a-1fccd4923431.pdf
in thepath
field of one of my imported parts.I would have attempted to move the files to the corresponding location, but I cannot figure out how to determine what
%SECURE%
translates into as far as the file system in the docker container .To Reproduce Steps to reproduce the behavior:
Expected behavior See an icon related to the attachment (e.g., PDF) and be able to select the icon to see the attachment.
Screenshots
Server Side
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context Add any other context about the problem here.