Skip to content
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

IMAGE_SIZE_URL request timed out #9231

Closed
sathvikl opened this issue Nov 10, 2017 · 10 comments
Closed

IMAGE_SIZE_URL request timed out #9231

sathvikl opened this issue Nov 10, 2017 · 10 comments
Assignees
Labels
server / core Issues relating to the server or core of Ghost

Comments

@sathvikl
Copy link

I am running it behind the corporate proxy server and although I am able to view the image, I receive the below error while executing the first time.

I am not sure why it is unable to fetch this url

curl https://casper.ghost.org/v1.0.0/images/ghost-logo.svg works fine on the cmd line.

Is there a way to access this svg locally. ?

Issue Summary

INFO [2017-11-10 01:54:49] "GET /new-world-record-with-apache-spark/" 200 5106ms
[2017-11-10 01:54:55] ERROR

NAME: InternalServerError
CODE: IMAGE_SIZE_URL
MESSAGE: Request timed out.

level:critical

https://casper.ghost.org/v1.0.0/images/ghost-logo.svg
InternalServerError: Request timed out.
at new InternalServerError (/home/sathvikl/ghost1.17/Ghost-1.17.1/node_modules/ghost-ignition/lib/errors/index.js:71:23)
at /home/sathvikl/ghost1.17/Ghost-1.17.1/core/server/utils/image-size.js:129:31
at tryCatcher (/home/sathvikl/ghost1.17/Ghost-1.17.1/node_modules/bluebird/js/release/util.js:16:23)
at /home/sathvikl/ghost1.17/Ghost-1.17.1/node_modules/bluebird/js/release/catch_filter.js:34:37
at tryCatcher (/home/sathvikl/ghost1.17/Ghost-1.17.1/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/home/sathvikl/ghost1.17/Ghost-1.17.1/node_modules/bluebird/js/release/promise.js:512:31)
at Promise._settlePromise (/home/sathvikl/ghost1.17/Ghost-1.17.1/node_modules/bluebird/js/release/promise.js:569:18)
at Promise._settlePromise0 (/home/sathvikl/ghost1.17/Ghost-1.17.1/node_modules/bluebird/js/release/promise.js:614:10)
at Promise._settlePromises (/home/sathvikl/ghost1.17/Ghost-1.17.1/node_modules/bluebird/js/release/promise.js:689:18)
at Async._drainQueue (/home/sathvikl/ghost1.17/Ghost-1.17.1/node_modules/bluebird/js/release/async.js:133:16)
at Async._drainQueues (/home/sathvikl/ghost1.17/Ghost-1.17.1/node_modules/bluebird/js/release/async.js:143:10)
at Immediate.Async.drainQueues (/home/sathvikl/ghost1.17/Ghost-1.17.1/node_modules/bluebird/js/release/async.js:17:14)
at runCallback (timers.js:789:20)
at tryOnImmediate (timers.js:751:5)
at processImmediate [as _immediateCallback] (timers.js:722:5)

Technical details:

  • Ghost Version: 1.17
  • Node Version: 8.9.0
  • Browser/OS: Ubuntu 16
  • Database: MySQL
@kirrg001 kirrg001 self-assigned this Nov 10, 2017
@kirrg001
Copy link
Contributor

kirrg001 commented Nov 10, 2017

Hey @sathvikl!

Yeah that is definitely a problem we recognised already. Requests to the casper.ghost.org time out randomly.

Some initial thoughts/options how to tackle this problem.

  • reduce image size request timeout to a reasonable number
  • rethink the concept of how we detect the image size (right now we fetch the image size while loading the frontend and this can block the frontend for x seconds if we hit a timeout)
  • move the images into the Ghost repository for now (not sure that is an option, because i haven't checked how big they are in sum)
  • figure out why the images timeout sometimes and reconsider hosting them somewhere else more reliable (they are hosted at Github pages)

To fix this issue we can differentiate between a short and a long term solution.

@kirrg001 kirrg001 added server / core Issues relating to the server or core of Ghost optimisation labels Nov 10, 2017
@sathvikl
Copy link
Author

Thanks @kirrg001
You can test these 2 endpoints using a system utility like curl, I didn't see any timeouts at all so it may be an issue tied to node.js

curl https://casper.ghost.org/v1.0.0/images/ghost-logo.svg > /tmp/a
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 3592 0 3592 0 0 55459 0 --:--:-- --:--:-- --:--:-- 56125

curl https://casper.ghost.org/v1.0.0/images/blog-cover.jpg > /tmp/a
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 85788 100 85788 0 0 213k 0 --:--:-- --:--:-- --:--:-- 213k

The size of the files are above.

Can you please give me some hints/code changes on how to disable this image size check for now or store the images locally ?

  • I would suggest that blocking the whole front-end while determining the image size can drastically reduce the performance on the server, if it can at least be improved to an non-blocking version that would be a good temporary fix.

To provide you some context. I am working on making a publicly available Ghost.js node benchmark
here
and I created the benchmark here https://github.com/sathvikl/ghostjs-benchmark

If anyone on the Ghost.js team would be interested in collaborating that would be awesome !!

It's based on v0.11 of Ghost.js and I wanted to upgrade to an LTS version.

@kirrg001
Copy link
Contributor

Can you please give me some hints/code changes on how to disable this image size check for now or store the images locally ?

I suggest to remove the initial fixture posts and add some custom posts with images which are stored locally (happens automatically as soon as you add an image). Then you should not hit the casper timeout problem.

@sathvikl
Copy link
Author

I deleted every single fixture post. In the settings/General section I deleted the publication cover(blog-cover.jpg) and Publication logo(ghost-logo.svg).

I am still getting errors on this

NAME: InternalServerError
CODE: IMAGE_SIZE_URL
MESSAGE: Request timed out.

level:critical

https://casper.ghost.org/v1.0.0/images/ghost-logo.svg
InternalServerError: Request timed out.

I am using this app in a cluster mode, with 88 node worker threads.

Any guess on where this could be coming from ?

@kevinansfield
Copy link
Contributor

I am using this app in a cluster mode, with 88 node worker threads.

@sathvikl Ghost doesn't support clustering, there should only be 1 Ghost process. If you want to improve perf put a cache in front and scale that out - all the Ghost generated pages are "static" so there should be very little traffic actually hitting the Ghost server

@kirrg001
Copy link
Contributor

Closing. I haven't seen any timeouts to our casper images in the last months. We can re-open this if we encounter it again.

@LDubya
Copy link

LDubya commented Sep 2, 2018

Hey there, getting this while running a local version of Ghost.

To reproduce:

  • download the latest ghost, then
$ npm install --production
$ npx knex-migrator init
$ npm start

output in the console after visiting a few blog posts:

> ghost@2.1.0 start /blog
> node index

[2018-09-02 22:38:45] WARN Theme's file locales/en.json not found.
[2018-09-02 22:38:45] INFO Ghost is running in development...
[2018-09-02 22:38:45] INFO Listening on: 127.0.0.1:2368
[2018-09-02 22:38:45] INFO Url configured as: http://localhost:2368/
[2018-09-02 22:38:45] INFO Ctrl+C to shut down
[2018-09-02 22:38:45] INFO Ghost boot 1.822s
[2018-09-02 22:38:57] ERROR

NAME: InternalServerError
CODE: IMAGE_SIZE_URL
MESSAGE: Request timed out.

level:critical

https://casper.ghost.org/v1.0.0/images/blog-cover.jpg
InternalServerError: Request timed out.
    at new InternalServerError (/blog/node_modules/ghost-ignition/lib/errors/index.js:71:23)
    at /blog/core/server/lib/image/image-size.js:133:31
    at tryCatcher (/blog/node_modules/bluebird/js/release/util.js:16:23)
    at /blog/node_modules/bluebird/js/release/catch_filter.js:34:37
    at tryCatcher (/blog/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/blog/node_modules/bluebird/js/release/promise.js:512:31)
    at Promise._settlePromise (/blog/node_modules/bluebird/js/release/promise.js:569:18)
    at Promise._settlePromise0 (/blog/node_modules/bluebird/js/release/promise.js:614:10)
    at Promise._settlePromises (/blog/node_modules/bluebird/js/release/promise.js:689:18)
    at Async._drainQueue (/blog/node_modules/bluebird/js/release/async.js:133:16)
    at Async._drainQueues (/blog/node_modules/bluebird/js/release/async.js:143:10)
    at Immediate.Async.drainQueues (/blog/node_modules/bluebird/js/release/async.js:17:14)
    at runCallback (timers.js:789:20)
    at tryOnImmediate (timers.js:751:5)
    at processImmediate [as _immediateCallback] (timers.js:722:5)

INFO [2018-09-02 22:38:57] "GET /" 200 5144ms
INFO [2018-09-02 22:38:58] "GET /assets/built/screen.css?v=38ae914baf" 200 14ms
INFO [2018-09-02 22:38:58] "GET /assets/js/jquery.fitvids.js?v=38ae914baf" 200 15ms
INFO [2018-09-02 22:38:58] "GET /assets/js/infinitescroll.js?v=38ae914baf" 200 17ms
INFO [2018-09-02 22:38:58] "GET /public/ghost-sdk.js?v=38ae914baf" 200 27ms
[2018-09-02 22:39:08] ERROR

NAME: InternalServerError
CODE: IMAGE_SIZE_URL
MESSAGE: Request timed out.

level:critical

https://casper.ghost.org/v2.0.0/images/welcome-to-ghost.jpg
InternalServerError: Request timed out.
    at new InternalServerError (/blog/node_modules/ghost-ignition/lib/errors/index.js:71:23)
    at /blog/core/server/lib/image/image-size.js:133:31
    at tryCatcher (/blog/node_modules/bluebird/js/release/util.js:16:23)
    at /blog/node_modules/bluebird/js/release/catch_filter.js:34:37
    at tryCatcher (/blog/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/blog/node_modules/bluebird/js/release/promise.js:512:31)
    at Promise._settlePromise (/blog/node_modules/bluebird/js/release/promise.js:569:18)
    at Promise._settlePromise0 (/blog/node_modules/bluebird/js/release/promise.js:614:10)
    at Promise._settlePromises (/blog/node_modules/bluebird/js/release/promise.js:689:18)
    at Async._drainQueue (/blog/node_modules/bluebird/js/release/async.js:133:16)
    at Async._drainQueues (/blog/node_modules/bluebird/js/release/async.js:143:10)
    at Immediate.Async.drainQueues (/blog/node_modules/bluebird/js/release/async.js:17:14)
    at runCallback (timers.js:789:20)
    at tryOnImmediate (timers.js:751:5)
    at processImmediate [as _immediateCallback] (timers.js:722:5)

INFO [2018-09-02 22:39:08] "GET /welcome/" 200 5164ms
INFO [2018-09-02 22:39:08] "GET /assets/built/screen.css?v=38ae914baf" 304 8ms
INFO [2018-09-02 22:39:08] "GET /assets/js/jquery.fitvids.js?v=38ae914baf" 304 1ms
INFO [2018-09-02 22:39:08] "GET /favicon.ico" 200 2ms
INFO [2018-09-02 22:39:39] "GET /" 200 100ms
INFO [2018-09-02 22:39:39] "GET /assets/built/screen.css?v=38ae914baf" 200 18ms
INFO [2018-09-02 22:39:39] "GET /public/ghost-sdk.js?v=38ae914baf" 200 7ms
INFO [2018-09-02 22:39:39] "GET /assets/js/jquery.fitvids.js?v=38ae914baf" 200 10ms
INFO [2018-09-02 22:39:39] "GET /assets/js/infinitescroll.js?v=38ae914baf" 200 27ms
INFO [2018-09-02 22:39:45] "GET /the-editor/" 200 4509ms
INFO [2018-09-02 22:39:45] "GET /assets/built/screen.css?v=38ae914baf" 304 4ms
INFO [2018-09-02 22:39:45] "GET /assets/js/jquery.fitvids.js?v=38ae914baf" 304 2ms
[2018-09-02 22:40:11] ERROR

NAME: InternalServerError
CODE: IMAGE_SIZE_URL
MESSAGE: Request timed out.

level:critical

https://casper.ghost.org/v2.0.0/images/publishing-options.jpg
InternalServerError: Request timed out.
    at new InternalServerError (/blog/node_modules/ghost-ignition/lib/errors/index.js:71:23)
    at /blog/core/server/lib/image/image-size.js:133:31
    at tryCatcher (/blog/node_modules/bluebird/js/release/util.js:16:23)
    at /blog/node_modules/bluebird/js/release/catch_filter.js:34:37
    at tryCatcher (/blog/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/blog/node_modules/bluebird/js/release/promise.js:512:31)
    at Promise._settlePromise (/blog/node_modules/bluebird/js/release/promise.js:569:18)
    at Promise._settlePromise0 (/blog/node_modules/bluebird/js/release/promise.js:614:10)
    at Promise._settlePromises (/blog/node_modules/bluebird/js/release/promise.js:689:18)
    at Async._drainQueue (/blog/node_modules/bluebird/js/release/async.js:133:16)
    at Async._drainQueues (/blog/node_modules/bluebird/js/release/async.js:143:10)
    at Immediate.Async.drainQueues (/blog/node_modules/bluebird/js/release/async.js:17:14)
    at runCallback (timers.js:789:20)
    at tryOnImmediate (timers.js:751:5)
    at processImmediate [as _immediateCallback] (timers.js:722:5)

INFO [2018-09-02 22:40:11] "GET /publishing-options/" 200 5115ms
INFO [2018-09-02 22:40:11] "GET /assets/built/screen.css?v=38ae914baf" 304 1ms
INFO [2018-09-02 22:40:11] "GET /assets/js/jquery.fitvids.js?v=38ae914baf" 304 4ms
[2018-09-02 22:40:22] ERROR

NAME: InternalServerError
CODE: IMAGE_SIZE_URL
MESSAGE: Request timed out.

level:critical

https://casper.ghost.org/v2.0.0/images/admin-settings.jpg
InternalServerError: Request timed out.
    at new InternalServerError (/blog/node_modules/ghost-ignition/lib/errors/index.js:71:23)
    at /blog/core/server/lib/image/image-size.js:133:31
    at tryCatcher (/blog/node_modules/bluebird/js/release/util.js:16:23)
    at /blog/node_modules/bluebird/js/release/catch_filter.js:34:37
    at tryCatcher (/blog/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/blog/node_modules/bluebird/js/release/promise.js:512:31)
    at Promise._settlePromise (/blog/node_modules/bluebird/js/release/promise.js:569:18)
    at Promise._settlePromise0 (/blog/node_modules/bluebird/js/release/promise.js:614:10)
    at Promise._settlePromises (/blog/node_modules/bluebird/js/release/promise.js:689:18)
    at Async._drainQueue (/blog/node_modules/bluebird/js/release/async.js:133:16)
    at Async._drainQueues (/blog/node_modules/bluebird/js/release/async.js:143:10)
    at Immediate.Async.drainQueues (/blog/node_modules/bluebird/js/release/async.js:17:14)
    at runCallback (timers.js:789:20)
    at tryOnImmediate (timers.js:751:5)
    at processImmediate [as _immediateCallback] (timers.js:722:5)

INFO [2018-09-02 22:40:23] "GET /admin-settings/" 200 5120ms
INFO [2018-09-02 22:40:23] "GET /assets/built/screen.css?v=38ae914baf" 304 2ms
INFO [2018-09-02 22:40:23] "GET /assets/js/jquery.fitvids.js?v=38ae914baf" 304 1ms

@dburgos
Copy link

dburgos commented Sep 4, 2018

Hi, I'm experiencing the same issue reported by @LDubya after upgraded to 2.1.0. In my case, my images are hosted on Cloudinary and exists.

captura de pantalla 2018-09-04 12 17 33

@kirrg001
Copy link
Contributor

kirrg001 commented Sep 4, 2018

https://casper.ghost.org/v2.0.0/images/admin-settings.jpg

Our fixture post images are hosted on Github pages. This is out of our control. The image size utility tries to fetch the dimensions of this image for Ghost's structured data feature. If the request takes too long, it skips. The error you are seeing should not affect the functionality of your blog.

Hi, I'm experiencing the same issue reported by @LDubya after upgraded to 2.1.0. In my case, my images are hosted on Cloudinary and exists.

We haven't touched this code at all. If Ghost is unable to request the image url within a specific period of time, it skips and logs an error.


We'll raise a new issue soon which describes the problems of our image size utility.

@LDubya
Copy link

LDubya commented Sep 4, 2018

Figured it was a Github response time issue. Probably not the most urgent issue.

Still, that console spasm on a default install 😭

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
server / core Issues relating to the server or core of Ghost
Projects
None yet
Development

No branches or pull requests

5 participants