snipe-it icon indicating copy to clipboard operation
snipe-it copied to clipboard

QR code and barcode images error 500

Open ovizii opened this issue 9 years ago • 9 comments

Expected Behavior (or desired behavior if a feature request)

I expected to see QR codes and barcodes


Actual Behavior

I see a placeholder for the images.


Please confirm you have done the following before posting your bug report:


Please provide answers to these questions before posting your bug report:

  • Version v3.6.2 build 10 (g927a12f)
  • using your docker image
  • WITH DEBUG TURNED ON, no errors to be seen All other info to be seen in the screen shots.

qr code error snipe-it asset management 01

qr code error snipe-it asset management 02

qr code error snipe-it asset management 03

ovizii avatar Dec 07 '16 11:12 ovizii

Need to see what's in your error logs, per the issue template

snipe avatar Dec 07 '16 11:12 snipe

I can find what's in the apache logs and post here if relevant. Can you please give me a hint where I can find the snipe-it logs in the docker container?

ovizii avatar Dec 07 '16 12:12 ovizii

The app logs are mpre important than the apache logs. https://snipe-it.readme.io/docs/getting-help#step-3-check-your-app-and-server-logs

My guess would be that the server doesn't have write permissions on the public/uploads/barcodes directory

snipe avatar Dec 08 '16 01:12 snipe

Thanks, I knew that page but I had missed this vital info:

Your app logs (found in storage/logs)

Here you go, I copied one of the errors, the others below are more of the same just for different QR codes: http://pastebin.com/pJLrS9Fw

[2016-12-06 13:54:02] production.ERROR: exception 'ErrorException' with message 'file_put_contents(/var/www/html/public/uploads/barcodes/qr-00000004.png): failed to open stream: No such file or directory' in /var/www/html/app/Http/Controllers/AssetsController.php:782

The folder does indeed not exist.

 ls -al /var/www/html/public/uploads/
total 28
drwxr-xr-x 6 docker root  4096 Dec  6 11:08 .
drwxr-xr-x 4 root   root  4096 Dec  6 10:56 ..
drwxr-xr-x 2 docker root  4096 Dec  6 10:56 avatars
-rw-r--r-- 1 docker staff 1754 Dec  6 11:08 logo.jpg
drwxr-xr-x 2 docker root  4096 Dec  8 09:27 models
drwxr-xr-x 2 docker root  4096 Dec  6 10:56 suppliers
drwxr-xr-x 2 docker root  4096 Dec  6 00:21 {assets,avatars,barcodes,models,suppliers}

ovizii avatar Dec 08 '16 12:12 ovizii

Did you used the docker installation? The folders are not created with v3.6.1 (I don't know yet for 3.6.2). You have to create the assets and barcodes folder yourself...

louisdj avatar Dec 09 '16 10:12 louisdj

Thanks that explains things. As I mentioned above - Version v3.6.2 build 10 (g927a12f) - using your docker image so I guess that is still the case with v.3.6.2.

I'll manually create the folders next week and see if that fixes the problem.

ovizii avatar Dec 10 '16 10:12 ovizii

Same issue. Have upgraded progressively with the docker container from early V3 days. Creating the folder fixes it. I didn't see anything in the release notes about needing to create the folder, it also doesn't seem like it would be hard to create it if it's missing.

timwsuqld avatar Jan 23 '17 01:01 timwsuqld

It looks like the mkdir command in Dockerfile using the brace notation maybe the culprit. I believe docker does not use bash for running commands, and it does not interpret the braces, so treats the whole {assets,avatars,barcodes,models,suppliers} as the directory name. Splitting up the command into multiple commands might be the solution..

-      && mkdir -p "/var/lib/snipeit/data/uploads/{assets,avatars,barcodes,models,suppliers}" \
+      && mkdir -p "/var/lib/snipeit/data/uploads/assets" \
+                       && mkdir -p "/var/lib/snipeit/data/uploads/avatars" \
+                       && mkdir -p "/var/lib/snipeit/data/uploads/barcodes" \
+                       && mkdir -p "/var/lib/snipeit/data/uploads/models" \
+                       && mkdir -p "/var/lib/snipeit/data/uploads/suppliers" \

PS: I can submit a pull request if this is acceptable.

devpkiconix avatar Feb 04 '17 16:02 devpkiconix

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions!

stale[bot] avatar Jan 20 '18 14:01 stale[bot]