muse icon indicating copy to clipboard operation
muse copied to clipboard

Server crash on migration database

Open jojolebobo opened this issue 2 years ago • 2 comments

What's happening? One day i start my Muse bot on my server and it can't load normally, when it start database migration server has an error occured. More details below :

â ‹ Applying database migrations.../home/container/node_modules/@prisma/client/runtime/library.js:60 ${ze(e)}}var Dp=V("prisma:client:engines:resolveEnginePath"),$p=()=>"library",kp=()=>new RegExp(runtime[\\\\/]${$p()}\\.m?js$);async function Xs(e,t){let r={binary:process.env.PRISMA_QUERY_ENGINE_BINARY,library:process.env.PRISMA_QUERY_ENGINE_LIBRARY}[e]??t.prismaPath;if(r!==void 0)return r;let{enginePath:n,searchedLocations:i}=await Ip(e,t);if(Dp("enginePath",n),n!==void 0&&e==="binary"&&ai(n),n!==void 0)return t.prismaPath=n;let o=await ft(),s=t.generator?.binaryTargets??[],a=s.some(d=>d.native),l=!s.some(d=>d.value===o),u=__filename.match(kp())===null,c={searchedLocations:i,generatorBinaryTargets:s,generator:t.generator,runtimeBinaryTarget:o,queryEngineName:ea(e,o),expectedLocation:nr.default.relative(process.cwd(),t.dirname)},p;throw a&&l?p=zs(c):l?p=Ws(c):u?p=Hs(c):p=Ys(c),new U(p,t.clientVersion)}async function Ip(engineType,config){let binaryTarget=await ft(),searchedLocations=[],dirname=eval("__dirname"),searchLocations=[config.dirname,nr.default.resolve(dirname,".."),config.generator?.output?.value??dirname,nr.default.resolve(dirname,"../../../.prisma/client"),"/tmp/prisma-engines",config.cwd];__filename.includes("resolveEnginePath")&&searchLocations.push(ss());for(let e of searchLocations){let t=ea(engineType,binaryTarget),r=nr.default.join(e,t);if(searchedLocations.push(e),Zs.default.existsSync(r))return{enginePath:r,searchedLocations}}return{enginePath:void 0,searchedLocations}}function ea(e,t){return e==="library"?Zn(t,"fs"):query-engine-${t}${t==="windows"?".exe":""}}function ta(e,t){return Np(e)?!t||t.kind==="itx"?{batch:e,transaction:!1}:{batch:e,transaction:!0,isolationLevel:t.options.isolationLevel}:{batch:e,transaction:t?.kind==="batch"?{isolationLevel:t.options.isolationLevel}:void 0}}function Np(e){return typeof e[0].query=="string"}var Di=F(Qt());function ra(e){return e?e.replace(/".*"/g,'"X"').replace(/\s:[/g,t=>${t[0]}5):""}function na(e){return e.split( ^ PrismaClientInitializationError: Prisma Client could not locate the Query Engine for runtime "debian-openssl-3.0.x". This happened because Prisma Client was generated for "debian-openssl-1.1.x", but the actual deployment required "debian-openssl-3.0.x". Add "debian-openssl-3.0.x" to binaryTargetsin the "schema.prisma" file and runprisma generate after saving it: generator client { provider = "prisma-client-js" binaryTargets = ["native", "debian-openssl-3.0.x"] } The following locations have been searched: /home/container/node_modules/.prisma/client /home/container/node_modules/@prisma/client /mnt/server/node_modules/@prisma/client /tmp/prisma-engines /home/container at Xs (/home/container/node_modules/@prisma/client/runtime/library.js:60:793) at en.loadLibrary (/home/container/node_modules/@prisma/client/runtime/library.js:106:598) at ir.loadEngine (/home/container/node_modules/@prisma/client/runtime/library.js:108:538) at ir.instantiateLibrary (/home/container/node_modules/@prisma/client/runtime/library.js:107:1861) { clientVersion: '4.16.0', errorCode: undefined } Error: Command failed with exit code 1: tsx src/scripts/migrate-and-start.ts at makeError (/home/container/node_modules/execa/lib/null:59:11) at handlePromise (/home/container/node_modules/execa/null:119:26) at processTicksAndRejections (node:internal/process/task_queues:96:5) at <anonymous> (/home/container/src/scripts/run-with-database-url.ts:6:3) { shortMessage: 'Command failed with exit code 1: tsx src/scripts/migrate-and-start.ts', command: 'tsx src/scripts/migrate-and-start.ts', escapedCommand: 'tsx "src/scripts/migrate-and-start.ts"', exitCode: 1, signal: undefined, signalDescription: undefined, stdout: undefined, stderr: undefined, failed: true, timedOut: false, isCanceled: false, killed: false }

Screenshot

image image

Runtime I'm running Muse:

  • [ ] Directly from the cloned repository
  • [x] Inside a Docker container
  • [ ] Something else (please elaborate)

Versions

  • Muse: latest
  • Docker (if applicable): Docker version 24.0.5, build ced0996
  • OS: Distributor ID: Ubuntu Description: Ubuntu 22.04.3 LTS Release: 22.04 Codename: jammy

jojolebobo avatar Apr 05 '24 14:04 jojolebobo

You are using Pterodactyl. Do you use the new version of the egg-muse?

Because of the addition of Python in one of the latest updates, the old install script won't work anymore as you see. You can manually update the install script (first two lines) or you use my attached egg.

And change the docker image.

Previous: apt-get update apt-get install git curl jq -y -qq Docker: ghcr.io/parkervcp/yolks:nodejs_16

New: apt-get update apt-get install git curl jq -y python3 python3-pip make build-essential -qq Docker: ghcr.io/parkervcp/yolks:nodejs_20

I have attached my egg here: egg-muse.json

theoneandonlymace avatar Apr 07 '24 21:04 theoneandonlymace

I download your newest egg and now it's run better than ever ! Thanks a lot !

jojolebobo avatar Apr 08 '24 22:04 jojolebobo