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

OpenHAB Cloud Installation erros #461

Open
kristofrk opened this issue Jun 3, 2024 · 7 comments
Open

OpenHAB Cloud Installation erros #461

kristofrk opened this issue Jun 3, 2024 · 7 comments

Comments

@kristofrk
Copy link

I am trying to install OpenHAB Cloud on a Ubuntu 24.04 LTS AMI. The 'npm install' command comes up with errors.
First it shows
While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/bcrypt
npm ERR! bcrypt@"^5.0.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer bcrypt@"^1.0.0" from [email protected]
npm ERR! node_modules/bcrypt-cache
npm ERR! bcrypt-cache@"^2.0.1" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: [email protected]
npm ERR! node_modules/bcrypt
npm ERR! peer bcrypt@"^1.0.0" from [email protected]
npm ERR! node_modules/bcrypt-cache
npm ERR! bcrypt-cache@"^2.0.1" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
When I retry with either of the above options, it gives an error for /home/ubuntu/openhab-cloud/node_modules/heapdump
an an exit cod 1 for gyp.
Any suggestions?

@kristofrk
Copy link
Author

I have fixed those problems, but when directing the browser to the IP address of my AMI, I get a 404 error from nginx. I am using the default configuration provided in the installation/customization instructions.

@kristofrk
Copy link
Author

This is the error I am getting:
024/06/17 18:57:55 [error] 449#449: *1 connect() failed (111: Unknown error) while connecting to upstream, client: 73.234.97.133, server: , request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:3000/favicon.ico", host: "52.23.169.119", referrer: "http://52.23.169.119/"
app.js is running (albeit not finding Authkey.p8), the configuration correctly specifies 127.0.0.1:3000.

@kristofrk
Copy link
Author

NGINX is actually showing an internal error.

@FoxWhiskey
Copy link

Similar problem here!

This is my configuration

Debian Bookworm
Python v3.11.2
nodejs v14.21.4

I cloned openhab-cloud v1.0.18 (313390d)

Among some warnings about unmet dependencies of bcrypt and unsupported platform for fsevents, which I haven't resolved yet, I have no idea how to cope with [email protected] and node-gyp failing to rebuild this library for my platform...

@kristofrk How did you solve the problem with heapdump???


The output of npm install

Traceback (most recent call last):
  File "/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py", line 50, in <module>
    sys.exit(gyp.script_main())
             ^^^^^^^^^^^^^^^^^
  File "/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 554, in script_main
    return main(sys.argv[1:])
           ^^^^^^^^^^^^^^^^^^
  File "/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 547, in main
    return gyp_main(args)
           ^^^^^^^^^^^^^^
  File "/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 520, in gyp_main
    [generator, flat_list, targets, data] = Load(
                                            ^^^^^
  File "/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 136, in Load
    result = gyp.input.Load(build_files, default_variables, includes[:],
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 2782, in Load
    LoadTargetBuildFile(build_file, data, aux_data,
  File "/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 391, in LoadTargetBuildFile
    build_file_data = LoadOneBuildFile(build_file_path, data, aux_data,
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 234, in LoadOneBuildFile
    build_file_contents = open(build_file_path, 'rU').read()
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: invalid mode: 'rU' while trying to load binding.gyp
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack     at ChildProcess.emit (events.js:400:28)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:285:12)
gyp ERR! System Linux 6.8.4-3-pve
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/bernie/software/openhab-cloud/node_modules/heapdump
gyp ERR! node -v v14.21.3
gyp ERR! node-gyp -v v5.1.1
gyp ERR! not ok 
npm WARN [email protected] requires a peer of bcrypt@^1.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/qunitjs/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

@kristofrk
Copy link
Author

@FoxWhiskey I asked ChatGPT to analyze my error messages and followed its suggestions. I am attaching a file.
Clean up heapdump.docx

I also added a resolutions entry to package.json to force resolution for bcrypt-cache.
"resolutions":{
"bcrypt":"^5.0.1"
}

@kristofrk
Copy link
Author

@FoxWhiskey I am also attaching the notes I took concerning my modifications. I got great help from the OpenHAB forum.
OpenHAB and OpenHAB Cloud.docx

@FoxWhiskey
Copy link

I didn't know black magic is allowed to resolve openHAB-cloud installation problems 😉.
Awesome, @kristofrk !! Thanks for your hints.
Actually, I hit slightly different problems, but your documents helped a lot to build openhab-cloud:
it turns out, that not heapdump is the problem, but node-gyp itself...

I will post a summary of my approach ASAP, just in case someone else is interested.
Thanks a lot again!

PS: I was able to get the app running, but cannot tell anything about runtime issues, yet...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants