redwoodjs / redwood

The App Framework for Startups
https://redwoodjs.com
MIT License
16.93k stars 974 forks source link

[Bug?]: baremetal production #10789

Open imcodingideas opened 3 weeks ago

imcodingideas commented 3 weeks ago

What's not working?

yarn rw deploy baremetal production --first-run

How do we reproduce the bug?

Im getting an error

Error while running command yarn install in /home/runcloud/webapps/website/current/web/dist/20240610202419 error @: The engine "node" is incompatible with this module. Expected version "=20.x". Got "18.20.0" error Found incompatible module.

However; if I ssh into `/home/runcloud/webapps/website/current/web/dist/20240610202419` I am able to run yarn install without any issues.

What's your environment? (If it applies)

System:
    OS: macOS 14.5
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.12.2 - /private/var/folders/95/53qgr6t920df716sv9216cpw0000gn/T/xfs-568b512c/node
    Yarn: 4.2.2 - /private/var/folders/95/53qgr6t920df716sv9216cpw0000gn/T/xfs-568b512c/yarn
  Databases:
    SQLite: 3.43.2 - /usr/bin/sqlite3
  Browsers:
    Chrome: 125.0.6422.142
    Safari: 17.5
  npmPackages:
    @redwoodjs/core: 7.6.3 => 7.6.3
    @redwoodjs/project-config: 7.6.3 => 7.6.3
    @redwoodjs/realtime: 7.6.3 => 7.6.3
    @redwoodjs/studio: 11 => 11.4.0
  redwood.toml:
    [web]
      title = "Hill Grow Agency"
      port = 8910
      apiUrl = "/.redwood/functions" # You can customize graphql and dbauth urls individually too: see https://redwoodjs.com/docs/app-configuration-redwood-toml#api-paths
      includeEnvironmentVariables = [
        # Add any ENV vars that should be available to the web side to this array
        # See https://redwoodjs.com/docs/environment-variables#web
      ]
    [api]
      port = 8911
    [browser]
      open = true
    [notifications]
      versionUpdates = ["latest"]

Are you interested in working on this?

Josh-Walker-GM commented 3 weeks ago

Hey @imcodingideas 👋

Thanks for filling out this issue. Before we go digging deeper, could you confirm what version of node and yarn you have on your remote server?

imcodingideas commented 3 weeks ago

@Josh-Walker-GM

Of course. This is out output of yarn rw info

  System:
    OS: Linux 5.4 Ubuntu 20.04.6 LTS (Focal Fossa)
    Shell: 5.0.17 - /bin/bash
  Binaries:
    Node: 20.14.0 - /tmp/xfs-0ef1189f/node
    Yarn: 4.2.2 - /tmp/xfs-0ef1189f/yarn
  npmPackages:
    @redwoodjs/core: 7.6.2 => 7.6.2
    @redwoodjs/project-config: 7.6.2 => 7.6.2
    @redwoodjs/realtime: 7.6.2 => 7.6.2
    @redwoodjs/studio: 11 => 11.4.0
  redwood.toml:
    [web]
      title = "Hill Grow Agency"
      port = 8910
      apiUrl = "/.redwood/functions" # You can customize graphql and dbauth urls individually too: see https://redwoodjs.com/docs/app-configuration-redwood-toml#api-paths
      includeEnvironmentVariables = [
        # Add any ENV vars that should be available to the web side to this array
        # See https://redwoodjs.com/docs/environment-variables#web
      ]
    [api]
      port = 8911
    [browser]
      open = true
    [notifications]
      versionUpdates = ["latest"]
cannikin commented 3 weeks ago

Have you seen the "SSH and Non-interactive Sessions" callout in the doc? https://redwoodjs.com/docs/deploy/baremetal#server-setup

If you have something like nvm set up to manage node versions, but it's only installed in a interactive session (like when you manually login via ssh) then it won't be available to the shell that's executing the baremetal setup, and whatever version it sets (20.x) won't be set when the baremetal script logs in and runs the commands.

imcodingideas commented 3 weeks ago

@cannikin it so happens that I am using nvm. I'm going to pay special attention to SSH and Non-interactive Sessions.

dthyresson commented 2 weeks ago

Hi @imcodingideas — following up, were you able to resolve this issue having looked at the SSH / Sessions docs?