Assistance getting it to run through docker on windows.
I pulled down the latest image through Docker for Windows and the ran the recommended command however I suspect it isn't working correctly because it just reports a version number and nothing else before exiting.
I suspect this is because I'm using powershell and this is BASH script. Could you tell me how I could either interface with Docker in BASH or translate this to be interpreted by docker through Powershell.
I truly did try to solve this on my own but after 2 weeks of spinning my wheels I thought I'd try my luck.
If you're using Docker it shouldn't matter whether you're using PS or Bash on the host.
Can you post any logs that Muse creates before exiting?
I tried running the command as it is written to which when interfacing with Docker through PowerShell it responds "Invalid reference format"
Then I tried running it removing all options reducing the command to: docker run codetheweb\muse However, expectedly since it didn't get the tokens it failed out with the below output.
PS C:\Users\ParsecPC> docker run codetheweb/muse
yarn run v1.22.15
$ npm run env:set-database-url -- node --experimental-json-modules dist/src/scripts/migrate-and-start.js
> [email protected] env:set-database-url
> node dist/src/scripts/run-with-database-url.js "node" "--experimental-json-modules" "dist/src/scripts/migrate-and-start.js"
(node:53) ExperimentalWarning: Importing JSON modules is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
Missing environment variable for DISCORD_TOKEN
file:///usr/app/node_modules/execa/lib/error.js:59
error = new Error(message);
^
Error: Command failed with exit code 1: node --experimental-json-modules dist/src/scripts/migrate-and-start.js
at makeError (file:///usr/app/node_modules/execa/lib/error.js:59:11)
at handlePromise (file:///usr/app/node_modules/execa/index.js:119:26)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async file:///usr/app/dist/src/scripts/run-with-database-url.js:6:5 {
shortMessage: 'Command failed with exit code 1: node --experimental-json-modules dist/src/scripts/migrate-and-start.js',
command: 'node --experimental-json-modules dist/src/scripts/migrate-and-start.js',
escapedCommand: 'node --experimental-json-modules "dist/src/scripts/migrate-and-start.js"',
exitCode: 1,
signal: undefined,
signalDescription: undefined,
stdout: undefined,
stderr: undefined,
timedOut: false,
isCanceled: false,
killed: false
}
npm notice
npm notice New minor version of npm available! 8.1.0 -> 8.3.2
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v8.3.2>
npm notice Run `npm install -g [email protected]` to update!
npm notice
error Command failed with exit code 1.
I did try shuffling the command to append the expected info and then it didn't recognize one of the options:
PS C:\Users\ParsecPC> docker run codetheweb/muse -it -v "$(pwd)/data":/data -e DISCORD_TOKEN='xxxxxxx' -e SPOTIFY_CLIENT_ID='xxxxxxx' -e SPOTIFY_CLIENT_SECRET='xxxxxxx' -e YOUTUBE_API_KEY='xxxxxxx'
node: bad option: -it
Then I tried removing the -it option and it just reported the version number as before and exited with code 1.
PS C:\Users\ParsecPC>docker run codetheweb/muse -v "$(pwd)/data":/data -e DISCORD_TOKEN='xxxxxxx' -e SPOTIFY_CLIENT_ID='xxxxxxx' -e SPOTIFY_CLIENT_SECRET='xxxxxxx' -e YOUTUBE_API_KEY='xxxxxxx'
v16.13.0
Ah, my bad--I don't think $(pwd) will work in PS.
Try doing -v "C:\full\path:/data" instead.
I know this is an old issue but I've been trying to work my way around this without bothering you too much, here's what I've resolved so far:
It's easier just to use Git Bash to interface with Docker on Windows. So from Git BASH I used the command as stated (with a winpty prefix to interpret it) which seems to work with the output below
~/muse (master)
$ winpty docker run -it -v "$(pwd)/data":/data -e DISCORD_TOKEN='exampletoken' -e SPOTIFY_CLIENT_ID='exampletoken' -e SPOTIFY_CLIENT_SECRET='exampletoken' -e YOUTUBE_API_KEY='exampletoken' codetheweb/muse:latest
yarn run v1.22.19
$ npm run env:set-database-url -- tsx src/scripts/migrate-and-start.ts
> [email protected] env:set-database-url
> tsx src/scripts/run-with-database-url.ts
========================================
========================================
================= muse =================
========================================
=========== Made with � by ============
==== https://github.com/codetheweb =====
========================================
========================================
Running version 2.1.4 built on 8/20/2022 (commit 7c643df7adbbf8436989289d5bad4f8
a1b4d0b0a)
� Need help? https://github.com/codetheweb/muse/discussions/new
� Bug? https://github.com/codetheweb/muse/issues/new
✨ New feature? https://github.com/codetheweb/muse/issues/new
☕ Discussion? https://github.com/codetheweb/muse/discussions/new
� Help me? https://www.paypal.me/codetheweb https://github.com/sponsors/codethe
web
✔ Database migrations applied.
✔ Ready! Invite the bot with https://discordapp.com/oauth2/authorize?client_id=9
99999999999999999&scope=bot%20applications.commands&permissions=36700160
I of course followed the link and added the bot to my desired server. However when attempting to search a song I receive the below error. Any idea where I went wrong?
Recursive Insurance
BOT
— Today at 11:55 PM
🚫ope: Missing catch or finally after try
See https://github.com/codetheweb/muse/issues/774.
Using the temporary fix has resolved my issue. For the record if anyone else is attempting to set this up on Docker for Windows.
Install Git with default settings Open git bash and input the docker command listed on the setup page with the winpty prefix
winpty docker run -it -v "$(pwd)/data":/data -e DISCORD_TOKEN='exampletoken' -e SPOTIFY_CLIENT_ID='exampletoken' -e SPOTIFY_CLIENT_SECRET='exampletoken' -e YOUTUBE_API_KEY='exampletoken' codetheweb/muse:latest
Stop the container and pull the temporary fix for the ytdl issue from ghcr.io/xmikux/muse:fix
winpty docker run -it -v "$(pwd)/data":/data -e DISCORD_TOKEN='exampletoken' -e SPOTIFY_CLIENT_ID='exampletoken' -e SPOTIFY_CLIENT_SECRET='exampletoken' -e YOUTUBE_API_KEY='exampletoken' ghcr.io/xmikux/muse:fix
Invite the bot with the link generated upon successful start.
Please note that if it generates an error in BASH it might be like me that it was left in a guild with sufficient permissions as well.