Ghost: rsa_keypair.node is not a valid win32 application

Created on 25 Jun 2019  ·  12Comments  ·  Source: TryGhost/Ghost

C:\Users\chris\Desktop\ghost>ghost install local
√ Checking system Node.js version
√ Checking current folder permissions
√ Checking memory availability
√ Checking for latest Ghost version
√ Setting up install directory
√ Downloading and installing Ghost v2.25.2
√ Finishing install process
√ Configuring Ghost
√ Setting up instance
√ Checking current folder permissions
√ Validating config
√ Checking memory availability
× Starting Ghost
A GhostError occurred.

Message: \?\C:\Users\chris\Desktop\ghost\versions\2.25.2node_modules\rsa-keypairbuild\Release\rsa_keypair.node ist keine zulässige Win32-Anwendung.
\?\C:\Users\chris\Desktop\ghost\versions\2.25.2node_modules\rsa-keypairbuild\Release\rsa_keypair.node

Debug Information:
OS: Microsoft Windows, v10.0.18362
Node Version: v10.16.0
Ghost-CLI Version: 1.11.0
Environment: development
Command: 'ghost install local'

C:\Users\chris.ghost\logs\ghost-cli-debug-2019-06-25T16_42_13_750Z.log:
Debug Information:
OS: Microsoft Windows, v10.0.18362
Node Version: v10.16.0
Ghost-CLI Version: 1.11.0
Environment: development
Command: 'ghost install local'
Message: \?\C:\Users\chris\Desktop\ghost\versions\2.25.2node_modules\rsa-keypairbuild\Release\rsa_keypair.node ist keine zulässige Win32-Anwendung.
\?\C:\Users\chris\Desktop\ghost\versions\2.25.2node_modules\rsa-keypairbuild\Release\rsa_keypair.node
Stack: Error: \?\C:\Users\chris\Desktop\ghost\versions\2.25.2node_modules\rsa-keypairbuild\Release\rsa_keypair.node ist keine zulässige Win32-Anwendung.
\?\C:\Users\chris\Desktop\ghost\versions\2.25.2node_modules\rsa-keypairbuild\Release\rsa_keypair.node
at ChildProcess.cp.on (C:\Users\chris\AppData\Roaming\npmnode_modules\ghost-cli\lib\utils\local-process.js:63:35)
at ChildProcess.emit (events.js:198:13)
at emit (internal/child_process.js:832:12)
at process._tickCallback (internal/process/next_tick.js:63:19)

bug server / core

Most helpful comment

@neosilky Not a problem! We didn't realise how much of a problem it would be either! I think we can get #10814 released after some testing :)

From what @tianon says it looks like the approach could work - I did some rudimentary tests locally with it and it seems good :relaxed:

All 12 comments

We also have a report of it not installing well on ubuntu: https://forum.ghost.org/t/error-during-update-to-last-release-2-25-2/7952

Hey @neosilky - would you mind taking a look at this, and seeing if you could work out what's wrong with it?

@allouis Do you know how widespread this is? I will take a look but feel free to revert for now.

@neosilky I'm unsure, those are the only reports I know of. I imagine the Windows issue is more widespread than the Linux one (seemed to be missing the make program, which is v. unsual for a Linux)

We won't be releasing again until tuesday, so I'm fine with leaving it in, and reverting before next release if we haven't found a solution :relaxed:

I have a similar issue on Windows trying to install Ghost v2.25.2.

Here is part of the console output.

ghost install local
√ Checking system Node.js version
√ Checking current folder permissions
√ Checking memory availability
√ Checking for latest Ghost version
√ Setting up install directory
× Downloading and installing Ghost v2.25.2
A ProcessError occurred.

Message: Command failed: yarn install --no-emoji --no-progress
warning [email protected]: The engine "cli" appears to be invalid.
warning "@tryghost/members-auth-pages > [email protected]" has unmet peer dependency "react@^15.5.4 || ^16.0.0-0".
warning "@tryghost/members-auth-pages > [email protected]" has unmet peer dependency "react-dom@^15.5.4 || ^16.0.0-0".
error C:\Users\mmaedler\Projects\ghost-test2\versions\2.25.2\node_modules\rsa-keypair: Command failed.
Exit code: 1
Command: node-gyp rebuild
Arguments:
Directory: C:\Users\mmaedler\Projects\ghost-test2\versions\2.25.2\node_modules\rsa-keypair

I tried both, PowerShell and standard command line.

Debug Information:
    OS: Microsoft Windows, v10.0.18362
    Node Version: v10.16.0
    Ghost-CLI Version: 1.11.0
    Environment: development
    Command: 'ghost install local'

Additionally I have yarn v1.16.0 installed.

What would be the workaround?

@MartinMa Thanks for the output, that should be helpful!

For now the workaround is to use Ghost 2.25.1 rather than 2.25.2 :relaxed:

I'll ping this issue when the next (fixed) version is released - if the issue is widespread it might be released sooner :+1:

@allouis Thanks! Which command do I have to use, to specifically install 2.25.1? I tried ghost install 2.25.1 local and ghost install local 2.25.1. Both variants don't seem to work for me. Using the first variant the cli warns me, that it can't find a MySQL install. The second variant just tries to install 2.25.2 anyway (same error).

edit: Ok, this one works: ghost install 2.25.1 --local 👍
The --local switch (note the dashes!) is not documented here: https://docs.ghost.org/api/ghost-cli/install/

For the Docker image maintained in https://github.com/docker-library/ghost, we're running into this while trying to bump to 2.25.2, and I've tracked it down to what looks like the new rsa-keypair dependency needing node-gyp to do compilation during install, which we haven't needed for installing Ghost itself before now (there are some esoteric architectures where it's necessary for building sqlite3, but we only install the dependencies necessary for node-gyp to work in the case of sqlite3 failing to install, which only happens after Ghost is installed and we know which version of sqlite3 we need to pull by scraping the optionalDependencies).

FYI/cc @acburdine for explicit visibility if you've not seen this already (since you've been helping us out on https://github.com/docker-library/ghost :smile: :heart:)

@tianon do you know how an optionalDependency that fails a compilation step would affect the docker build?

One of the fixes suggested involves moving rsa-keypair to an optional dependency and adding the old js-based keygen back as a main dependency. That way we can failover to the JS module if the native module can't be found.

2.25.3 has been released that reverts the switch to rsa-keypair, this should fix the various install issues.

@kevinansfield @allouis Thanks for fixing this. I knew binary dependencies could be a bit fragile, but I should have planned better on that front.

I've also seen #10814, so hopefully we can still keep the change in for those where the dependency installs fine.

Sorry for that.

@kevinansfield yes!

We already have to deal with that case for sqlite3, as can be seen in the relatively hairy https://github.com/docker-library/ghost/blob/8eba604d6b6078a318e0a83771ebc8e09f350bf0/2/debian/Dockerfile#L50-L68 blurb (which basically amounts to "if we didn't get sqlite3 installed successfully with Ghost, try again but this time with the node-gyp deps installed so it can actually build from source) -- it would be awesome if either npm or yarn gave us a way to mark one of the optionalDependencies as known-to-be-not-optional, but alas I couldn't find anything even close to that :sweat_smile: (and besides such a thing would simply force us to deal with the problem of sqlite3 vs node-gyp earlier instead of after-the-fact).

@neosilky Not a problem! We didn't realise how much of a problem it would be either! I think we can get #10814 released after some testing :)

From what @tianon says it looks like the approach could work - I did some rudimentary tests locally with it and it seems good :relaxed:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mattferderer picture mattferderer  ·  4Comments

kirrg001 picture kirrg001  ·  3Comments

jgreenemi picture jgreenemi  ·  4Comments

jaguart picture jaguart  ·  3Comments

hjzheng picture hjzheng  ·  4Comments