asilvas / node-image-steam

A simple, fast, and highly customizable on-the-fly image manipulation web server built atop Node.js
MIT License
169 stars 26 forks source link

Strange 404 issue #66

Closed dottodot closed 5 years ago

dottodot commented 5 years ago

I have a strange issue that I can't work out so just wondering if you've seen anything like it or would know why it's happening.

I keep getting 404 errors like the one below which is caused by a series of numbers at the end of the url i.e /1495697979, without these numbers appended the image would load.

It looks as something is replacing transformations with what appears to be random numbers.

It very intermittent and I've not found a way to replicate it.

"isteam: Error: storage.s3.fetch.error: 404 for image-cache/isteam/my-image.jpg/1495697979
    at IncomingMessage.<anonymous> (/srv/node_modules/image-steam-s3/lib/index.js:101:28)
    at emitNone (events.js:111:20)
    at IncomingMessage.emit (events.js:208:7)
    at endReadableNT (_stream_readable.js:1064:12)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickDomainCallback (internal/process/next_tick.js:218:9)"  
asilvas commented 5 years ago

Please post your config. The 404's you mentioned are normal and the result of image artifacts being requested from cache. The docs go over optimized originals, image artifacts, and caching in detail.

Image-Steam requires caching (via the same storage as the "original" images, or via its own dedicated storage) for real time performance.

dottodot commented 5 years ago

Here's my config

const options = {
  throttle: {
    ccProcessors: 4,
    ccPrefetchers: 100,
    ccRequests: 100
  },
  storage: {
    defaults: {
      driverPath: 'image-steam-s3',
      endpoint: process.env.SPACES_ENDPOINT,
      accessKey: process.env.SPACES_KEY,
      secretKey: process.env.SPACES_SECRET
    },
    app: {
      bx: {
        bucket: 'boxxer'
      },
      bos: {
        bucket: 'bailey-image'
      }
    },
    cache: {
      bucket: 'dottodot-image-cache'
    },
    cacheTTS: 1036800
  }
};
asilvas commented 5 years ago

Your config appears to be OK, assuming the creds (accessKey+secretKey) are the same for the cache. Those 404's are warnings, and should not be impacting your requests (other than being slower due to cache miss).

dottodot commented 5 years ago

OK thanks that's put my mind at rest was just worried it wasn't working correctly, but that makes sense.