loeeeee / immich-in-lxc

Install Immich in LXC with optional CUDA support
30 stars 3 forks source link

Installer fails in install.sh #31

Closed ahmadhadidi closed 19 hours ago

ahmadhadidi commented 3 days ago

Hello,

I've been following along with this guide and reached the step "Install Immich Server", with the user "immich" I ran sudo ./install.sh inside the directory immich-in-lxc. It runs fine but then it fails with the an error (I copied the log -- entry 55 is where the error occurs):

0 verbose cli /usr/bin/node /usr/bin/npm
1 info using npm@9.2.0
2 info using node@v18.19.1
3 timing npm:load:whichnode Completed in 0ms
4 timing config:load:defaults Completed in 2ms
5 timing config:load:file:/usr/share/nodejs/npm/npmrc Completed in 2ms
6 timing config:load:builtin Completed in 2ms
7 timing config:load:cli Completed in 1ms
8 timing config:load:env Completed in 0ms
9 timing config:load:file:/home/immich/source/web/.npmrc Completed in 0ms
10 timing config:load:project Completed in 1ms
11 timing config:load:file:/root/.npmrc Completed in 0ms
12 timing config:load:user Completed in 0ms
13 timing config:load:file:/etc/npmrc Completed in 0ms
14 timing config:load:global Completed in 0ms
15 timing config:load:setEnvs Completed in 0ms
16 timing config:load Completed in 9ms
17 timing npm:load:configload Completed in 9ms
18 timing npm:load:mkdirpcache Completed in 0ms
19 timing npm:load:mkdirplogs Completed in 0ms
20 verbose title npm ci
21 verbose argv "ci"
22 timing npm:load:setTitle Completed in 1ms
23 timing config:load:flatten Completed in 3ms
24 timing npm:load:display Completed in 4ms
25 verbose logfile logs-max:10 dir:/root/.npm/_logs/2024-09-16T12_29_35_246Z-
26 verbose logfile /root/.npm/_logs/2024-09-16T12_29_35_246Z-debug-0.log
27 timing npm:load:logFile Completed in 6ms
28 timing npm:load:timers Completed in 0ms
29 timing npm:load:configScope Completed in 0ms
30 timing npm:load Completed in 20ms
31 silly logfile start cleaning logs, removing 1 files
32 timing config:load:flatten Completed in 1ms
33 timing arborist:ctor Completed in 1ms
34 silly logfile done cleaning log files
35 timing idealTree:init Completed in 2ms
36 timing idealTree:userRequests Completed in 0ms
37 silly idealTree buildDeps
38 silly fetch manifest @immich/sdk@file:../open-api/typescript-sdk
39 silly placeDep ROOT @immich/sdk@1.115.0 REPLACE for: immich-web@1.115.0 want: file:../open-api/typescript-sdk
40 silly fetch manifest @oazapfts/runtime@^1.0.2
41 http fetch GET 200 https://registry.npmjs.org/@oazapfts%2fruntime 14ms (cache hit)
42 timing idealTree:#root Completed in 25ms
43 silly placeDep ROOT @oazapfts/runtime@1.0.3 OK for: @immich/sdk@1.115.0 want: ^1.0.2
44 timing idealTree:node_modules/@immich/sdk Completed in 2ms
45 timing idealTree:node_modules/@oazapfts/runtime Completed in 0ms
46 timing idealTree:buildDeps Completed in 27ms
47 timing idealTree:fixDepFlags Completed in 4ms
48 timing idealTree Completed in 43ms
49 timing command:ci Completed in 381ms
50 verbose stack Error: 
50 verbose stack `npm ci` can only install packages when your package.json and package-lock.json or npm-shrinkwrap.json are in sync. Please update your lock file with `npm install` before continuing.
50 verbose stack
50 verbose stack Missing: @oazapfts/runtime@1.0.3 from lock file
50 verbose stack
50 verbose stack Clean install a project
50 verbose stack
50 verbose stack Usage:
50 verbose stack npm ci
50 verbose stack
50 verbose stack Options:
50 verbose stack [-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer|--save-bundle]
50 verbose stack [-E|--save-exact] [-g|--global] [--install-strategy <hoisted|nested|shallow>]
50 verbose stack [--legacy-bundling] [--global-style]
50 verbose stack [--omit <dev|optional|peer> [--omit <dev|optional|peer> ...]]
50 verbose stack [--strict-peer-deps] [--no-package-lock] [--foreground-scripts]
50 verbose stack [--ignore-scripts] [--no-audit] [--no-bin-links] [--no-fund] [--dry-run]
50 verbose stack [-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
50 verbose stack [-ws|--workspaces] [--include-workspace-root] [--no-install-links]
50 verbose stack
50 verbose stack aliases: clean-install, ic, install-clean, isntall-clean
50 verbose stack
50 verbose stack Run "npm help ci" for more info
50 verbose stack     at CI.usageError (/usr/share/nodejs/npm/lib/base-command.js:96:26)
50 verbose stack     at CI.exec (/usr/share/nodejs/npm/lib/commands/ci.js:58:18)
50 verbose stack     at async module.exports (/usr/share/nodejs/npm/lib/cli.js:133:5)
51 verbose cwd /home/immich/source/web
52 verbose Linux 6.8.8-2-pve
53 verbose node v18.19.1
54 verbose npm  v9.2.0
55 error code EUSAGE
56 error
56 error `npm ci` can only install packages when your package.json and package-lock.json or npm-shrinkwrap.json are in sync. Please update your lock file with `npm install` before continuing.
56 error
56 error Missing: @oazapfts/runtime@1.0.3 from lock file
56 error
56 error Clean install a project
56 error
56 error Usage:
56 error npm ci
56 error
56 error Options:
56 error [-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer|--save-bundle]
56 error [-E|--save-exact] [-g|--global] [--install-strategy <hoisted|nested|shallow>]
56 error [--legacy-bundling] [--global-style]
56 error [--omit <dev|optional|peer> [--omit <dev|optional|peer> ...]]
56 error [--strict-peer-deps] [--no-package-lock] [--foreground-scripts]
56 error [--ignore-scripts] [--no-audit] [--no-bin-links] [--no-fund] [--dry-run]
56 error [-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
56 error [-ws|--workspaces] [--include-workspace-root] [--no-install-links]
56 error
56 error aliases: clean-install, ic, install-clean, isntall-clean
56 error
56 error Run "npm help ci" for more info
57 verbose exit 1
58 timing npm Completed in 426ms
59 verbose code 1
60 error A complete log of this run can be found in:
60 error     /root/.npm/_logs/2024-09-16T12_29_35_246Z-debug-0.log

Did anyone else encounter this?

loeeeee commented 3 days ago

Thanks for trying out the script.

with the user "immich" I ran sudo ./install.sh inside the directory immich-in-lxc

The install script should be run as immich user, i.e. ./install.sh should do. 😄

I guess it is time for me to note what user to use in every part of the guide. 😂

ahmadhadidi commented 3 days ago

Hey @loeeeee, I tried to run the script without sudo, it gave me this result:

+ SCRIPT_DIR=/home/immich/immich-in-lxc
+ create_install_env_file
+ '[' '!' -f /home/immich/immich-in-lxc/.env ']'
+ load_environment_variables
+ cd /home/immich/immich-in-lxc
+ set -a
+ . ./.env
++ REPO_TAG=v1.115.0
++ INSTALL_DIR=/home/immich
++ UPLOAD_DIR=/home/immich/upload
++ isCUDA=false
++ PROXY_NPM=
++ PROXY_POETRY=
+ set +a
+ set +x
v1.115.0
/home/immich
/home/immich/upload
false

+ INSTALL_DIR_src=/home/immich/source
+ INSTALL_DIR_app=/home/immich/app
+ INSTALL_DIR_ml=/home/immich/app/machine-learning
+ INSTALL_DIR_geo=/home/immich/geodata
+ REPO_URL=https://github.com/immich-app/immich
+ clean_previous_build
+ rm -rf /home/immich/app
rm: cannot remove '/home/immich/app/machine-learning': Permission denied

sadly it did not work.

martiperez commented 3 days ago

I guess it is time for me to note what user to use in every part of the guide. 😂

You have one pull request from me doing exactly that 😃

loeeeee commented 2 days ago

Hey @loeeeee, I tried to run the script without sudo, it gave me this result:

+ SCRIPT_DIR=/home/immich/immich-in-lxc
+ create_install_env_file
+ '[' '!' -f /home/immich/immich-in-lxc/.env ']'
+ load_environment_variables
+ cd /home/immich/immich-in-lxc
+ set -a
+ . ./.env
++ REPO_TAG=v1.115.0
++ INSTALL_DIR=/home/immich
++ UPLOAD_DIR=/home/immich/upload
++ isCUDA=false
++ PROXY_NPM=
++ PROXY_POETRY=
+ set +a
+ set +x
v1.115.0
/home/immich
/home/immich/upload
false

+ INSTALL_DIR_src=/home/immich/source
+ INSTALL_DIR_app=/home/immich/app
+ INSTALL_DIR_ml=/home/immich/app/machine-learning
+ INSTALL_DIR_geo=/home/immich/geodata
+ REPO_URL=https://github.com/immich-app/immich
+ clean_previous_build
+ rm -rf /home/immich/app
rm: cannot remove '/home/immich/app/machine-learning': Permission denied

sadly it did not work.

This is because last time you ran the script, you did so using root user. As a result, the script left the machine-learning folder in the wrong permission settings, making it inaccessible to immich user.

All you need to do is deleting the /home/immich/app folder using root user. 😃

loeeeee commented 2 days ago

I guess it is time for me to note what user to use in every part of the guide. 😂

You have one pull request from me doing exactly that 😃

My bad. I was enjoying the free time after the exam period.

ahmadhadidi commented 1 day ago

Hey @loeeeee thanks for shedding light on the I've been encountering, I finally received the success message. P.S. I also noticed that the source/ folder also needs to be removed if the script was ran under root.

loeeeee commented 19 hours ago

Hey @loeeeee thanks for shedding light on the I've been encountering, I finally received the success message. P.S. I also noticed that the source/ folder also needs to be removed if the script was ran under root.

Bravo, mate! @ahmadhadidi