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

v2023.12.0 completely broken in FreeBSD #12764

Open
temtemy opened this issue Dec 23, 2023 · 7 comments
Open

v2023.12.0 completely broken in FreeBSD #12764

temtemy opened this issue Dec 23, 2023 · 7 comments
Labels
⚠️bug? This might be a bug

Comments

@temtemy
Copy link

temtemy commented Dec 23, 2023

💡 Summary

When I attempt to upgrade to v2023.12.0 with pnpm install, rollup prevents me from progressing:

│ /home/misskey/misskey/node_modules/.pnpm/rollup@4.9.1/node_modules/rollup/dist/native.js:38
│     atthrow new Error(
│     at      ^
│ Error: Your current platform "freebsd" and architecture "x64" combination is not yet supported by the native Rollup…
│ The following platform-architecture combinations are supported:
│ android-arm
│ android-arm64
│ darwin-arm64
│ darwin-x64
│ linux-arm
│ linux-arm64
│ linux-arm64 (musl)
│ linux-riscv64
│ linux-x64
│ linux-x64 (musl)
│ win32-arm64
│ win32-ia32
│ win32-x64

Against better judgment I decided to force it to progress further by hacking around the dependencies. I tried using the WASM version of rollup as suggested here as well as downgrading rollup to 3.29.4 and vite to 4.5.0. Both approaches allowed building to continue. But when the time came for running Misskey itself:

[misskey@chaotic ~/misskey]$ NODE_ENV=production node /usr/local/bin/pnpm start

> misskey@2023.12.0 start /home/misskey/misskey
> pnpm check:connect && cd packages/backend && node ./built/boot/entry.js


> misskey@2023.12.0 check:connect /home/misskey/misskey
> cd packages/backend && pnpm check:connect


> backend@ check:connect /home/misskey/misskey/packages/backend
> node ./check_connect.js

  _____ _         _
 |     |_|___ ___| |_ ___ _ _
 | | | | |_ -|_ -| '_| -_| | |
 |_|_|_|_|___|___|_,_|___|_  |
 v2023.12.0              |___|

 Misskey is an open-source decentralized microblogging platform.
 If you like Misskey, please donate to support development. https://www.patreon.com/syuilo

--- chaotic.ninja (PID: 61146) ---
INFO *  [core boot]     Welcome to Misskey!
INFO *  [core boot]     Misskey v2023.12.0
INFO *  [core boot env] NODE_ENV: production
INFO *  [core boot nodejs]      Version v20.10.0 detected.
DONE *  [core boot config]      Loaded
DONE *  [core boot]     Misskey initialized
INFO *  [core nest]     NestFactory: Starting Nest application...
INFO *  [core nest]     InstanceLoader: MainModule dependencies initialized
INFO *  [core nest]     InstanceLoader: QueueModule dependencies initialized
INFO *  [core nest]     InstanceLoader: GlobalModule dependencies initialized
INFO *  [core nest]     InstanceLoader: RepositoryModule dependencies initialized
INFO *  [core nest]     InstanceLoader: DaemonModule dependencies initialized
INFO *  [core nest]     InstanceLoader: ServerModule dependencies initialized
INFO *  [core nest]     InstanceLoader: EndpointsModule dependencies initialized
INFO *  [core nest]     InstanceLoader: CoreModule dependencies initialized
ERR  *  [core]  Error: Nest could not find RoleService1 element (this provider does not exist in the current context)
{
  e: UnknownElementException [Error]: Nest could not find RoleService1 element (this provider does not exist in the current context)
      at InstanceLinksHost.get (/home/misskey/misskey/node_modules/.pnpm/@nestjs+core@10.2.10_@nestjs+common@10.2.10_reflect-metadata@0.1.14_rxjs@7.8.1/node_modules/@nestjs/core/injector/instance-links-host.js:15:19)
      at ModuleRef.find (/home/misskey/misskey/node_modules/.pnpm/@nestjs+core@10.2.10_@nestjs+common@10.2.10_reflect-metadata@0.1.14_rxjs@7.8.1/node_modules/@nestjs/core/injector/abstract-instance-resolver.js:8:60)
      at ModuleRef.get (/home/misskey/misskey/node_modules/.pnpm/@nestjs+core@10.2.10_@nestjs+common@10.2.10_reflect-metadata@0.1.14_rxjs@7.8.1/node_modules/@nestjs/core/injector/module.js:389:29)
      at UserListService1.onModuleInit (file:///home/misskey/misskey/packages/backend/built/core/UserListService.js:60:43)
      at MapIterator.iteratee (/home/misskey/misskey/node_modules/.pnpm/@nestjs+core@10.2.10_@nestjs+common@10.2.10_reflect-metadata@0.1.14_rxjs@7.8.1/node_modules/@nestjs/core/hooks/on-module-init.hook.js:22:43)
      at MapIterator.next (/home/misskey/misskey/node_modules/.pnpm/iterare@1.2.1/node_modules/iterare/lib/map.js:13:39)
      at IteratorWithOperators.next (/home/misskey/misskey/node_modules/.pnpm/iterare@1.2.1/node_modules/iterare/lib/iterate.js:21:28)
      at Function.from (<anonymous>)
      at IteratorWithOperators.toArray (/home/misskey/misskey/node_modules/.pnpm/iterare@1.2.1/node_modules/iterare/lib/iterate.js:180:22)
      at callOperator (/home/misskey/misskey/node_modules/.pnpm/@nestjs+core@10.2.10_@nestjs+common@10.2.10_reflect-metadata@0.1.14_rxjs@7.8.1/node_modules/@nestjs/core/hooks/on-module-init.hook.js:23:10)
      at callModuleInitHook (/home/misskey/misskey/node_modules/.pnpm/@nestjs+core@10.2.10_@nestjs+common@10.2.10_reflect-metadata@0.1.14_rxjs@7.8.1/node_modules/@nestjs/core/hooks/on-module-init.hook.js:43:23)
      at NestApplicationContext.callInitHook (/home/misskey/misskey/node_modules/.pnpm/@nestjs+core@10.2.10_@nestjs+common@10.2.10_reflect-metadata@0.1.14_rxjs@7.8.1/node_modules/@nestjs/core/nest-application-context.js:223:50)
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
      at async NestApplicationContext.init (/home/misskey/misskey/node_modules/.pnpm/@nestjs+core@10.2.10_@nestjs+common@10.2.10_reflect-metadata@0.1.14_rxjs@7.8.1/node_modules/@nestjs/core/nest-application-context.js:100:9)
      at async server (file:///home/misskey/misskey/packages/backend/built/boot/common.js:14:17)
      at async masterMain (file:///home/misskey/misskey/packages/backend/built/boot/master.js:73:13)
      at async file:///home/misskey/misskey/packages/backend/built/boot/entry.js:54:5
}
Trace: UnknownElementException [Error]: Nest could not find RoleService1 element (this provider does not exist in the current context)
    at InstanceLinksHost.get (/home/misskey/misskey/node_modules/.pnpm/@nestjs+core@10.2.10_@nestjs+common@10.2.10_reflect-metadata@0.1.14_rxjs@7.8.1/node_modules/@nestjs/core/injector/instance-links-host.js:15:19)
    at ModuleRef.find (/home/misskey/misskey/node_modules/.pnpm/@nestjs+core@10.2.10_@nestjs+common@10.2.10_reflect-metadata@0.1.14_rxjs@7.8.1/node_modules/@nestjs/core/injector/abstract-instance-resolver.js:8:60)
    at ModuleRef.get (/home/misskey/misskey/node_modules/.pnpm/@nestjs+core@10.2.10_@nestjs+common@10.2.10_reflect-metadata@0.1.14_rxjs@7.8.1/node_modules/@nestjs/core/injector/module.js:389:29)
    at UserListService1.onModuleInit (file:///home/misskey/misskey/packages/backend/built/core/UserListService.js:60:43)
    at MapIterator.iteratee (/home/misskey/misskey/node_modules/.pnpm/@nestjs+core@10.2.10_@nestjs+common@10.2.10_reflect-metadata@0.1.14_rxjs@7.8.1/node_modules/@nestjs/core/hooks/on-module-init.hook.js:22:43)
    at MapIterator.next (/home/misskey/misskey/node_modules/.pnpm/iterare@1.2.1/node_modules/iterare/lib/map.js:13:39)
    at IteratorWithOperators.next (/home/misskey/misskey/node_modules/.pnpm/iterare@1.2.1/node_modules/iterare/lib/iterate.js:21:28)
    at Function.from (<anonymous>)
    at IteratorWithOperators.toArray (/home/misskey/misskey/node_modules/.pnpm/iterare@1.2.1/node_modules/iterare/lib/iterate.js:180:22)
    at callOperator (/home/misskey/misskey/node_modules/.pnpm/@nestjs+core@10.2.10_@nestjs+common@10.2.10_reflect-metadata@0.1.14_rxjs@7.8.1/node_modules/@nestjs/core/hooks/on-module-init.hook.js:23:10)
    at callModuleInitHook (/home/misskey/misskey/node_modules/.pnpm/@nestjs+core@10.2.10_@nestjs+common@10.2.10_reflect-metadata@0.1.14_rxjs@7.8.1/node_modules/@nestjs/core/hooks/on-module-init.hook.js:43:23)
    at NestApplicationContext.callInitHook (/home/misskey/misskey/node_modules/.pnpm/@nestjs+core@10.2.10_@nestjs+common@10.2.10_reflect-metadata@0.1.14_rxjs@7.8.1/node_modules/@nestjs/core/nest-application-context.js:223:50)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async NestApplicationContext.init (/home/misskey/misskey/node_modules/.pnpm/@nestjs+core@10.2.10_@nestjs+common@10.2.10_reflect-metadata@0.1.14_rxjs@7.8.1/node_modules/@nestjs/core/nest-application-context.js:100:9)
    at async server (file:///home/misskey/misskey/packages/backend/built/boot/common.js:14:17)
    at async masterMain (file:///home/misskey/misskey/packages/backend/built/boot/master.js:73:13)
    at async file:///home/misskey/misskey/packages/backend/built/boot/entry.js:54:5
    at process.<anonymous> (file:///home/misskey/misskey/packages/backend/built/boot/entry.js:45:17)
    at process.emit (node:events:514:28)
    at process._fatalException (node:internal/process/execution:178:25)
    at loadESM (node:internal/process/esm_loader:40:33)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async handleMainPromise (node:internal/modules/run_main:113:12)

I'm stuck now in this limbo because I didn't backup my database before doing the migration step (don't be like me guys)... Workarounds are very much welcome in order to bring my Misskey instance back up again

🥰 Expected Behavior

rollup should've been fine with freebsd-x64 in the first place

But even with the use of WASM version instead, the backend and frontend should be running fine

🤬 Actual Behavior

rollup fails to build

Backend and frontend not running at all, resulting in nginx returning 502

📝 Steps to Reproduce

No response

💻 Frontend Environment

No response

🛰 Backend Environment (for server admin)

* Installation Method or Hosting Service: Manual
* Misskey: 2023.12.0
* Node: v20.10.0
* PostgreSQL: 15.5
* Redis: 7.2.3
* OS and Architecture: FreeBSD 13.2 x86-64
@temtemy temtemy added the ⚠️bug? This might be a bug label Dec 23, 2023
@fruitriin
Copy link
Contributor

fruitriin commented Dec 23, 2023

hmm?

Misskey not officially supported nodjes <=20.9
But, in fact, Misskey not have to (so newer) node.js now.
you can revert this pr in your local and run your compatible nodejs I guess
#12755

@temtemy
Copy link
Author

temtemy commented Dec 23, 2023

@fruitriin Nope, reverting that PR didn't help. :( rollup still fails to build without putting the "resolutions" workaround, and with the workaround it still fails to run with the same RoleService1 error...

@fruitriin
Copy link
Contributor

fruitriin commented Dec 23, 2023

when you change node version, need to clean install node_modules

these steps maybe help you

  1. set to node stable(18latest or 20.5.x?)
  2. npm i -g pnpm (if you need
  3. pnpm clean-all (in your misskey directory
  4. pnpm install and pnpm build (you may need this step twice
  5. pnpm start

@temtemy
Copy link
Author

temtemy commented Dec 23, 2023

Btw for the record downgrading back to 2023.11.1 does make Misskey run again, but since the database got modified during the upgrade it now results in profile pages failing to load. If I were to rollback to the older version I need a way to somehow revert 1702718871541-ffVisibility.js which is causing the breakage

@fruitriin
Copy link
Contributor

It seem Misskey not consider rollback migration safety.
full dump and restore is best way

@temtemy
Copy link
Author

temtemy commented Dec 24, 2023

I am now back in 2023.11.1 and everything is working again (including logging in which I forgot also broke, I think that one's more important than profile pages getting broken lol) thanks to #12767 and a few pnpm reverts (why is this not documented? I didn't know Misskey can rollback migration safely)

Will still leave this issue open because the latest version is definitely still broken in FreeBSD, and I want this to serve as a reference for admins running Misskey on FreeBSD that may run into the same issue as mine.

@kakkokari-gtyih
Copy link
Contributor

This could be a workaround for a while: unjs/nitro#2010 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⚠️bug? This might be a bug
Projects
None yet
Development

No branches or pull requests

3 participants