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

Consider yarn network timeouts #641

Open
ErisDS opened this Issue Feb 13, 2018 · 11 comments

Comments

Projects
None yet
9 participants
@ErisDS
Copy link
Member

ErisDS commented Feb 13, 2018

Original slack thread: https://ghost.slack.com/archives/C04CUS2R3/p1518440412000159

A user on slack tried to install Ghost 1.0 but ran into network timeout errors from yarn. This happened on a raspberry pi, so counts as "other stack" but there are a few interesting things:

  • We don't handle the error very well
  • We don't expose a way to control the timeout for yarn
  • This problem isn't raspberry pi specific

This could happen on a very slow ubuntu machine, and although there is a workaround for now, we should IMO consider improving error handling and also either extending or exposing the yarn config.


Original details:

A ProcessError occurred.

Message: Command failed: yarn install --no-emoji --no-progress
warning ghost@1.21.1: The engine "cli" appears to be invalid.
error An unexpected error occurred: "https://registry.yarnpkg.com/intl/-/intl-1.2.5.tgz: ESOCKETTIMEDOUT".
error https://registry.yarnpkg.com/sqlite3/-/sqlite3-3.1.13.tgz: ESOCKETTIMEDOUT

yarn install v1.3.2
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
info There appears to be trouble with your network connection. Retrying...
... repeated many times ....
info If you think this is a bug, please open a bug report with the information provided in "/var/www/ghost/versions/1.21.1/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
info There appears to be trouble with your network connection. Retrying...
... repeated again ...

Exit code: 1

Debug Information:
   OS: Raspbian, v9.3
   Node Version: v6.12.3
   Ghost-CLI Version: 1.5.1
   Environment: production
   Command: 'ghost install'

Additional log info available in: /home/pi/.ghost/logs/ghost-cli-debug-2018-02-12T12_47_48_928Z.log

The user managed to solve the problem themselves:

by installing yarn myself and increasing the default network-timeout value, like this:

cd /var/www/ghost
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update
sudo apt-get install yarn
yarn config set network-timeout 180000
@GerDner

This comment has been minimized.

Copy link

GerDner commented Aug 6, 2018

Fixed the error for me by upgrading to node 8.x

@lizrodriguez

This comment has been minimized.

Copy link

lizrodriguez commented Aug 20, 2018

Hello,
I'm facing this issue currently on my VPS with a fresh install of Ubuntu 16.04 and have tried both installing yarn with setting a larger network timeout, and ensuring I'm running node 8.11.4. Here's my debug info:

✔ Checking logged in user
✔ Checking current folder permissions
✔ Checking operating system compatibility
✔ Checking for a MySQL installation
✔ Checking memory availability
✔ Checking for latest Ghost version
✔ Setting up install directory
✖ Downloading and installing Ghost v2.0.1
A ProcessError occurred.

Message: Command failed: yarn install --no-emoji --no-progress
warning ghost@2.0.1: The engine "cli" appears to be invalid.
error Couldn't find the binary git

yarn install v1.9.4
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

Exit code: 1


Debug Information:
    OS: Ubuntu, v16.04
    Node Version: v8.11.4
    Ghost-CLI Version: 1.9.0
    Environment: production
    Command: 'ghost install'

Any ideas of what else I could try would be much appreciated!

@vikaspotluri123

This comment has been minimized.

Copy link
Collaborator

vikaspotluri123 commented Aug 20, 2018

This migt be an issue with the latest release of Ghost - @lizrodriguez could you try installing ghost with ghost install 2.0.0 and report back?

If it is, this comment might be useful

@lizrodriguez

This comment has been minimized.

Copy link

lizrodriguez commented Aug 20, 2018

@vikaspotluri123 Indeed installing with ghost install 2.0.0 worked! Thanks very much.

@pascalandy

This comment has been minimized.

Copy link

pascalandy commented Aug 21, 2018

I think this might be resolved with Ghost 2.0.2
#792 (comment)

@ekerstein

This comment has been minimized.

Copy link

ekerstein commented Dec 11, 2018

I'm running into a related issue trying to update from 2.6.0 to 2.8.0.

 Checking system Node.js version
✔ Ensuring user is not logged in as ghost user
✔ Checking if logged in user is directory owner
✔ Checking current folder permissions
✔ Checking folder permissions
✔ Checking file permissions
✔ Checking content folder ownership
✔ Checking memory availability
✔ Checking for available migrations
✔ Checking for latest Ghost version
✖ Downloading and updating Ghost to v2.8.0
A ProcessError occurred.

Message: Command failed: yarn install --no-emoji --no-progress
warning ghost@2.8.0: The engine "cli" appears to be invalid.
warning Error running install script for optional dependency: "/var/www/ghost/versions/2.8.0/node_modules/knex-migrator/node_modules/sqlite3: spawn ENOMEM"
error An unexpected error occurred: "/var/www/ghost/versions/2.8.0/node_modules/jsonpath: spawn ENOMEM".
warning Error running install script for optional dependency: "/var/www/ghost/versions/2.8.0/node_modules/sharp: spawn ENOMEM"
warning Error running install script for optional dependency: "/var/www/ghost/versions/2.8.0/node_modules/sqlite3: spawn ENOMEM"
warning Error running install script for optional dependency: "/var/www/ghost/versions/2.8.0/node_modules/dtrace-provider: spawn ENOMEM"

yarn install v1.9.4
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
[4/5] Linking dependencies...
[5/5] Building fresh packages...
info This module is OPTIONAL, you can safely ignore this error
info If you think this is a bug, please open a bug report with the information provided in "/var/www/ghost/versions/2.8.0/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
info This module is OPTIONAL, you can safely ignore this error
info This module is OPTIONAL, you can safely ignore this error
info This module is OPTIONAL, you can safely ignore this error

Exit code: 1


Debug Information:
    OS: Ubuntu, v18.04
    Node Version: v8.10.0
    Ghost-CLI Version: 1.9.8
    Environment: production
    Command: 'ghost update'
@acburdine

This comment has been minimized.

Copy link
Member

acburdine commented Dec 11, 2018

@ekerstein your issue appears to be related to the system being out of available memory rather than network timeouts. Not that we can't improve that error messaging, but in the interrim you can try increasing your available memory by adding swap space.

@ekerstein

This comment has been minimized.

Copy link

ekerstein commented Dec 11, 2018

@acburdine I cleared up some memory and it worked - thanks!

@lmuzquiz

This comment has been minimized.

Copy link

lmuzquiz commented Feb 24, 2019

@ErisDS Today i got a similar problem, as the one @lizrodriguez #641 (comment) (we both had ubuntu 16.04, but she had node 8 while i was using node 6)

First i tried ghost install and got this output with the error:

✔ Checking system Node.js version
✔ Checking logged in user
✔ Checking current folder permissions
✔ Checking operating system compatibility
✔ Checking for a MySQL installation
✔ Checking memory availability
✔ Checking for latest Ghost version
✔ Setting up install directory
✖ Downloading and installing Ghost v2.15.0
A ProcessError occurred.

Message: Command failed: yarn install --no-emoji --no-progress
warning ghost@2.15.0: The engine "cli" appears to be invalid.
error csv-parser@2.1.0: The engine "node" is incompatible with this module. Expected version ">= 6.14.0". Got "6.12.3"
error Found incompatible module

yarn install v1.12.3
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

Exit code: 1

Debug Information:
    OS: Ubuntu, v16.04
    Node Version: v6.12.3
    Ghost-CLI Version: 1.9.9
    Environment: production
    Command: 'ghost install'

Additional log info available in: /home/lmuzquiz/.ghost/logs/ghost-cli-debug-2019-02-24T02_05_46_253Z.log

Then i visited your ghost releases github page and tried to install all the latest versions, one by one to check which latest version i could install:

All these versions got me the same error described above:

  • ghost install 2.14.3
  • ghost install 2.14.2
  • ghost install 2.14.1
  • ghost install 2.14.0
  • ghost install 2.13.2
  • ghost install 2.13.1
  • ghost install 2.13.0
  • ghost install 2.12.0

And finally i could make a fresh ghost install with this version:

ghost install 2.11.1

My Ubuntu 16.04 was using less than 59% of RAM memory and the disk usage was around 65% at the time of getting these errors, and a the time of finally installing ghost 2.11.1

But i must say that Before i got these errors my Ubuntu 16.04 server had close to 80% RAM used, So i freed a lot of memory by running ghost uninstall to a lot of blogs i was not using. (around 6 blogs) When i had my ram at 58-59% that when i tried to run ghost install, getting the error described above.

I am thinking, maybe all those newest versions of ghost needed node 8 to get installed? But then why @lizrodriguez got the exact same error. She was using node 8.

@vikaspotluri123

This comment has been minimized.

Copy link
Collaborator

vikaspotluri123 commented Feb 24, 2019

@lmuzquiz The errors are different - the error Liz got related to one of Ghost's dependencies being hosted on github, but the system not having a suitable git client installed to download. Your error relates to your node version -

The engine "node" is incompatible with this module. Expected version ">= 6.14.0". Got "6.12.3"

What this means is you need to update your node version to the latest 6.x release. If you followed the installation guide, the should be as simple as running sudo apt-get update && sudo apt-get install nodejs (using install will only update nodejs, if you want to update any other packages, run sudo apt-get upgrade. After updating node, you should be fine until April, when the 6.x line of node will be deprecated and Ghost stops supporting it.

@lmuzquiz

This comment has been minimized.

Copy link

lmuzquiz commented Feb 24, 2019

Thank you @vikaspotluri123 i had to pay more attention.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.