YunoHost-Apps / calckey_ynh

Calcket package for YunoHost
https://i.calckey.cloud/
GNU Affero General Public License v3.0
9 stars 7 forks source link

Upgrade to Calckey 13.1.1 #12

Closed lapineige closed 1 year ago

lapineige commented 1 year ago

v13.0.6 will be released soon. It introduces some changes in the install process : #10

~Codeberg is not working right know so I can't download the source archive and sha256sum it, hence this is still a draft.~ Downloading the archive is working again.

PR Status

Automatic tests

Automatic tests can be triggered on https://ci-apps-dev.yunohost.org/ after creating the PR, by commenting "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!". (N.B. : for this to work you need to be a member of the Yunohost-Apps organization)

ThatOneCalculator commented 1 year ago

Yeah we redid the release for docker

lapineige commented 1 year ago

And that's the file used ?

Ok then nothing to worry about 🙂

lapineige commented 1 year ago

https://ci-apps-dev.yunohost.org/ci/job/5457 So finally upgrade is working. At least on paper. I will try on my side 🤞

I don't understand how restoration fails. @ThatOneCalculator could you guide me here please ? 🙏

lapineige commented 1 year ago

So finally upgrade is working. At least on paper. I will try on my side crossed_fingers

Upgrade fails :

2023-02-03 12:52:30,261: DEBUG - + sudo -u calckey env PATH=/opt/node_n/n/versions/node/19/bin:/opt/node_n/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin pnpm clean-all
2023-02-03 12:52:33,031: DEBUG - 
2023-02-03 12:52:33,032: DEBUG - > calckey@13.1.0 clean-all /var/www/calckey
2023-02-03 12:52:33,032: DEBUG - > pnpm node ./scripts/clean-all.js
2023-02-03 12:52:33,032: DEBUG - 
2023-02-03 12:52:34,496: DEBUG - node:internal/modules/cjs/loader:1056
2023-02-03 12:52:34,496: DEBUG -   throw err;
2023-02-03 12:52:34,496: DEBUG -   ^
2023-02-03 12:52:34,497: DEBUG - 
2023-02-03 12:52:34,497: DEBUG - Error: Cannot find module 'execa'
2023-02-03 12:52:34,497: DEBUG - Require stack:
2023-02-03 12:52:34,497: DEBUG - - /var/www/calckey/scripts/clean-all.js
2023-02-03 12:52:34,497: DEBUG -     at Module._resolveFilename (node:internal/modules/cjs/loader:1053:15)
2023-02-03 12:52:34,497: DEBUG -     at Module._load (node:internal/modules/cjs/loader:898:27)
2023-02-03 12:52:34,497: DEBUG -     at Module.require (node:internal/modules/cjs/loader:1120:19)
2023-02-03 12:52:34,497: DEBUG -     at require (node:internal/modules/helpers:112:18)
2023-02-03 12:52:34,497: DEBUG -     at Object.<anonymous> (/var/www/calckey/scripts/clean-all.js:2:15)
2023-02-03 12:52:34,498: DEBUG -     at Module._compile (node:internal/modules/cjs/loader:1239:14)
2023-02-03 12:52:34,498: DEBUG -     at Module._extensions..js (node:internal/modules/cjs/loader:1293:10)
2023-02-03 12:52:34,498: DEBUG -     at Module.load (node:internal/modules/cjs/loader:1096:32)
2023-02-03 12:52:34,498: DEBUG -     at Module._load (node:internal/modules/cjs/loader:935:12)
2023-02-03 12:52:34,498: DEBUG -     at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:84:12) {
2023-02-03 12:52:34,498: DEBUG -   code: 'MODULE_NOT_FOUND',
2023-02-03 12:52:34,498: DEBUG -   requireStack: [ '/var/www/calckey/scripts/clean-all.js' ]
2023-02-03 12:52:34,499: DEBUG - }
2023-02-03 12:52:34,506: DEBUG - 
2023-02-03 12:52:34,508: DEBUG - Node.js v19.4.0
2023-02-03 12:52:34,545: DEBUG -  ELIFECYCLE  Command failed with exit code 1.
2023-02-03 12:52:34,582: DEBUG - + ynh_exit_properly
lapineige commented 1 year ago

Also I had an un-signed yarn repository issue before this one, I had to fix it with curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -. Just as https://github.com/YunoHost-Apps/calckey_ynh/blob/testing/scripts/install#L77 was doing before...

So it seems it still calls yarn for some reason :thinking:

lapineige commented 1 year ago

Should we change the service conf too ? How ? :thinking: It uses [/opt/node_n/n/versions/node/19/bin/]npm start right now. Should I hardcode it to /opt/node_n/n/versions/node/19.4.0/bin/pnpm ? We can't let Yunohost manage that path as the help doesn't handle it (right ? ping @yalh76), so we have to manually select the pnpm that corepack enable configure ? (ping @ThatOneCalculator if you have any clue)

lapineige commented 1 year ago

!testme

yunohost-bot commented 1 year ago

:rocket: Test Badge

yunohost-bot commented 1 year ago

:v: Test Badge

lapineige commented 1 year ago

Why is there a new CI from a different domain ? :thinking: (and it's not working btw)

ThatOneCalculator commented 1 year ago

@lapineige corepack enable should automatically select pnpm, if need be you can also add corepack prepare pnpm@latest --activate

ThatOneCalculator commented 1 year ago

manifest.json should be updated to 13.1.1 :)

lapineige commented 1 year ago

What with the sudden change in the master branch ? :thinking: @oufmilo I don't understand what you did to the master branch and the way it affected mine ? :thinking: (also the source url for v13.1.0 was incomplete :) Also I don't understand why you started to work on the upgrade https://github.com/YunoHost-Apps/calckey_ynh/commit/05eca3cf78257c818cf56d8a1b17f4cb615d4544 elsewhere :thinking:

lapineige commented 1 year ago

!testme

yunohost-bot commented 1 year ago

:v: Test Badge

yunohost-bot commented 1 year ago

:rocket: Test Badge

lapineige commented 1 year ago

manifest.json should be updated to 13.1.1 :)

Indeed, I was on it but first trying to figure out why there were so many sudden changes that was difficult to understand (github UI/UX being quite bad :/) :sweat_smile:

lapineige commented 1 year ago

!testme

yunohost-bot commented 1 year ago

Meow :cat2: Test Badge

yunohost-bot commented 1 year ago

Meow :cat2: Test Badge

lapineige commented 1 year ago

It can't find pnpm. I don't know what's the good way to fix this… is that pnpm located locally thanks to corepack ?

lapineige commented 1 year ago

!testme

yunohost-bot commented 1 year ago

:v: Test Badge

yunohost-bot commented 1 year ago

Meow :cat2: Test Badge

lapineige commented 1 year ago

Test Badge thanks @oufmilo

lapineige commented 1 year ago

Ok that's much better, but restoration still fails with the same error :( https://github.com/YunoHost-Apps/calckey_ynh/pull/12#issuecomment-1415813315

lapineige commented 1 year ago

Thanks @oufmilo. And now we have :

sudo -u calckey env PATH=/opt/node_n/n/versions/node/19/bin:/opt/node_n/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin pnpm init 223561 INFO DEBUG -  ERR_PNPM_PACKAGE_JSON_EXISTS  package.json already exists (https://yunorunner.travelpandas.eu/ci/job/9)

ThatOneCalculator commented 1 year ago

Why was pnpm init ever being run?? That's for making a new project 😆

lapineige commented 1 year ago

Well we don't understand at all what these command do… I'm not into NodeJS, and even less in pnpm…

lapineige commented 1 year ago

So we should not use pnpm init in any restore or upgrade ? (even if the app was totally uninstalled before, as restoration can be done after uninstalling ?)

What about the build command ?

lapineige commented 1 year ago

Ok restore is fixed according to CI, well done @oufmilo !

oufmilo commented 1 year ago

!testme

yunohost-bot commented 1 year ago

May the CI gods be with you! Test Badge

yunohost-bot commented 1 year ago

:sunflower: Test Badge

lapineige commented 1 year ago

Upgrade is working too ! (on paper)

🎉

ThatOneCalculator commented 1 year ago

So we should not use pnpm init in any restore or upgrade ? (even if the app was totally uninstalled before, as restoration can be done after uninstalling ?)

What about the build command ?

Only build, no init

lapineige commented 1 year ago
248940 DEBUG + sudo -u calckey env PATH=/opt/node_n/n/versions/node/19/bin:/opt/node_n/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin pnpm clean-all
251739 DEBUG 
251740 DEBUG > calckey@13.1.1 clean-all /var/www/calckey
251740 DEBUG > pnpm node ./scripts/clean-all.js
251740 DEBUG 
252979 DEBUG node:internal/modules/cjs/loader:1063
252979 DEBUG   throw err;
252980 DEBUG   ^
252980 DEBUG 
252980 DEBUG Error: Cannot find module 'execa'
252980 DEBUG Require stack:
252980 DEBUG - /var/www/calckey/scripts/clean-all.js
252980 DEBUG     at Module._resolveFilename (node:internal/modules/cjs/loader:1060:15)
252980 DEBUG     at Module._load (node:internal/modules/cjs/loader:905:27)
252980 DEBUG     at Module.require (node:internal/modules/cjs/loader:1127:19)
252985 DEBUG     at require (node:internal/modules/helpers:112:18)
252985 DEBUG     at Object.<anonymous> (/var/www/calckey/scripts/clean-all.js:2:15)
252985 DEBUG     at Module._compile (node:internal/modules/cjs/loader:1246:14)
252985 DEBUG     at Module._extensions..js (node:internal/modules/cjs/loader:1300:10)
252986 DEBUG     at Module.load (node:internal/modules/cjs/loader:1103:32)
252986 DEBUG     at Module._load (node:internal/modules/cjs/loader:942:12)
252986 DEBUG     at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:83:12) {
252986 DEBUG   code: 'MODULE_NOT_FOUND',
252986 DEBUG   requireStack: [ '/var/www/calckey/scripts/clean-all.js' ]
252986 DEBUG }
252986 DEBUG 
252986 DEBUG Node.js v19.6.0
253016 DEBUG  ELIFECYCLE  Command failed with exit code 1.

Upgrade failed on my side. It seems I have missing (node ?) modules. But I already have an issue since the restoration, where I don't have all modules I guess, and this results in a 502 bad gateway issue.

@ThatOneCalculator do you know how I can reinstall all the (missing) module please ?

edit : fixed with sudo -u calckey NODE_ENV=production yarn install (I don't know what I'm doing, I just tried ^^). Now I'll try to ugprade again.

lapineige commented 1 year ago

!testme

yunohost-bot commented 1 year ago

Meow :cat2: Test Badge

yunohost-bot commented 1 year ago

Alrighty! Test Badge

ThatOneCalculator commented 1 year ago

NODE_ENV=production yarn install

Please DONT do that! We're now using pnpm, not yarn. The correct command is pnpm install

lapineige commented 1 year ago

I wasn't clear : I fixed my current version that was broken, it was Calckey 13.0.5. It was broken because of some node_modules files removed by mistake I believe. Then I could upgrade to 13.1.1 and it worked like a charm ! 🚀

lapineige commented 1 year ago

So… CI is perfectly happy, manual upgrade went well…

@oufmilo let's merge it to testing (so it's available to more people) and then wait for more manual test just in case ? Does it work on your side now ?

oufmilo commented 1 year ago

Yes it's working for me ! 🚀

lapineige commented 1 year ago

edit : fixed with sudo -u calckey NODE_ENV=production yarn install (I don't know what I'm doing, I just tried ^^). Now I'll try to ugprade again.

Turns out when it fails for the same reason on v13.1.2, the same command (with pnpm install now) fix it too :)

In that case the issue was triggered by the server running out of space... for some reason some modules disappeared...