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

Still unable to load images after upgrading to 5.0.3

Open itscsquared opened this issue 6 years ago • 9 comments

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

Describe the bug When looking in the asset list, the image link appears to be broken. However, when clicking on the asset itself and going to the page for that specific asset, the photo loads. Also, the branding image for our Snipe instance does not load either. I have double checked and they are in the proper directory. I did not receive any error messages after upgrading there were no other issues with functionality.

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior I expect the images to load properly on the site.

Screenshots image This image shows the image link being broken

image This image shows the error message received (IP has been blacked out)

image This image shows that when you click on the asset itself, the image loads properly for the asset model.

image This image shows that the asset model images are located in the proper directory.

Server (please complete the following information):

  • Snipe-IT Version 5.0.3
  • OS: [e.g. Ubuntu, CentOS] Windows Server 2016 Data Center
  • Web Server: [e.g. Apache, IIS] IIS
  • PHP Version 7.4.1

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Error Messages

  • WITH DEBUG TURNED ON, if you're getting an error in your browser, include that error
  • If a stacktrace is provided in the error, include that too.
  • Any errors that appear in your browser's error console.
  • Confirm whether the error is reproducible on the demo: https://snipeitapp.com/demo.
  • Include any additional information you can find in storage/logs and your webserver's logs.

Additional context

  • Is this a fresh install or an upgrade?
  • What OS and web server you're running Snipe-IT on
  • What method you used to install Snipe-IT (install.sh, manual installation, docker, etc)
  • Include what you've done so far in the installation, and if you got any error messages along the way.
  • Indicate whether or not you've manually edited any data directly in the database

Add any other context about the problem here.

Please do not post an issue without answering the related questions above. If you have opened a different issue and already answered these questions, answer them again, once for every ticket. It will be next to impossible for us to help you.

itscsquared avatar Oct 26 '20 16:10 itscsquared

Verify that permissions for the IIS Server are set correctly on the folder/files.

https://forums.iis.net/t/1187650.aspx

roratonet avatar Oct 26 '20 19:10 roratonet

That wouldn't explain why it loads on the asset page but not the asset list, would it? I verified those permissions were correct when I updated and everything looks to be correct.

itscsquared avatar Oct 26 '20 19:10 itscsquared

Maybe you have the image still in the cache. Please try the same with an Incognito Window.

Is the URL of the displayed image the same as the one which is not loading?

What about IIS server logs? What's the error message there? https://www.sumologic.com/blog/iis-log-files-location/

Sumo Logic
Find your IIS log files. Learn about IIS log file locations, as well as how to analyze and centralize your IIS logs.

roratonet avatar Oct 26 '20 21:10 roratonet

I noticed that a double // is inserted between the domain name and the upload folder see below. I don't know where in code to correct. Failed to load image: http://school.org//uploads/models/1504-chromebookpng.png

pcsmarts502 avatar Oct 27 '20 13:10 pcsmarts502

I double checked after upgrading to v5.0.4 and still the same error. I tried loading it in an incognito window and the issue persisted.

In inspecting the image element when on the asset's info page, I see that the source link is the name our DNS resolves snipe-it to, rather than an IP address, but in the asset list, it shows the IP address and then the path for the uploaded image. Not sure if that has anything to do with it, but I can attach a screenshot here.

image This shows the image loading on the asset information page along with the source path.

image And this one shows the image failing to load long with the source path.

EDIT: I think I already figured out the issue. In the first image, the path is http:// and the path in the asset list is https://. I changed my .env file to http:// in the app_url rather than https:// and it resolved the issue.

However, my next question is, does Snipe support https, can something be done to resolve that? It's an internal resource for us but the fact remains it is a concern.

itscsquared avatar Oct 27 '20 14:10 itscsquared

Found my problem too. Typo in .env file url. Thanks for the tip itssquared

pcsmarts502 avatar Oct 27 '20 15:10 pcsmarts502

I double checked after upgrading to v5.0.4 and still the same error. I tried loading it in an incognito window and the issue persisted.

In inspecting the image element when on the asset's info page, I see that the source link is the name our DNS resolves snipe-it to, rather than an IP address, but in the asset list, it shows the IP address and then the path for the uploaded image. Not sure if that has anything to do with it, but I can attach a screenshot here.

image This shows the image loading on the asset information page along with the source path.

image And this one shows the image failing to load long with the source path.

EDIT: I think I already figured out the issue. In the first image, the path is http:// and the path in the asset list is https://. I changed my .env file to http:// in the app_url rather than https:// and it resolved the issue.

However, my next question is, does Snipe support https, can something be done to resolve that? It's an internal resource for us but the fact remains it is a concern.

This was the fix for me!

browntrouser avatar Nov 02 '20 20:11 browntrouser

Great - since it looks like everyone is sorted here, I'm going to close this issue for now.

snipe avatar Nov 02 '20 20:11 snipe

However, my next question is, does Snipe support https, can something be done to resolve that? It's an internal resource for us but the fact remains it is a concern.

Yes, we certainly support https - it's how we run all of our hosted customers. As long as the URL you access it from and the APP_URL match, it shouldn't be an issue.

snipe avatar Nov 02 '20 20:11 snipe