codetheweb / aoede

🎧 a self-hosted Spotify → Discord music bot
MIT License
294 stars 28 forks source link

My cmd says that can't read the config file #15

Closed ztKaizen closed 1 year ago

codetheweb commented 2 years ago

Could you please provide more details? What's the full output?

nodgear commented 2 years ago

I know what his issue is: He's running Aoede built from source. When building from source i got the same result when running aoede, it would say my config.toml file is nowhere to be found (Arch linux x64)

This doesn't happen when exporting vars instead of using the toml file.

codetheweb commented 2 years ago

It might be expecting config.toml to be next to the binary in target/debug or target/release.

nodgear commented 2 years ago

Not the case either. image

codetheweb commented 2 years ago

It's not working for me either.

@cloudybyte any ideas why it's not working?

oleggtro commented 2 years ago

Could you please show us your config file? pls censor the tokens ofc

nodgear commented 2 years ago

Could you please show us your config file? pls censor the tokens ofc

DISCORD_TOKEN="<CENSORED>.<CENSORED>.<CENSORED>"
SPOTIFY_USERNAME="3a3a4glj34s40sw2ppvd1642l"
SPOTIFY_PASSWORD="<CENSORED>"
DISCORD_USER_ID="175314117924487168"
oleggtro commented 2 years ago

Mhm that sounds weird and is definitely a bug. I was able to reproduce it though, so not totally bad news. I'll look into it

oleggtro commented 2 years ago

should be fixed in #18. can you please confirm the fix @nodgear?

codetheweb commented 2 years ago

This should be fixed in v0.4.1, please try it out when you get a chance. :)

jacksight commented 2 years ago

I got this issue,too. I'm using v0.4.1 currently

nodgear commented 2 years ago

I got this issue,too. I'm using v0.4.1 currently

Have you moved the config file to the same place where the binary is?

oleggtro commented 2 years ago

Did the fix work for you @nodgear?

nodgear commented 2 years ago

I will be testing right now, had no time to test previously

Edit: Just built again from source (release)

nodge@hsv:release main ✗ 22h23m ✖ ➜ ./aoede
Couldn't read config
Error: Error { tag: Tag(Default, 1), profile: Some(Profile(Uncased { string: "default" })), metadata: Some(Metadata { name: "TOML file", source: Some(File("/home/nodge/Development/aoede/target/release/config.toml")), provide_location: Some(Location { file: "src/lib/config.rs", line: 19, col: 14 }), interpolater:  }), path: ["DISCORD_USER_ID"], kind: InvalidType(Str("175314117924487168"), "u64"), prev: None }

file list:

total 32468
-rwxr-xr-x   2 nodge nodge 33154328 ago 11 21:28 aoede
-rw-r--r--   1 nodge nodge      190 ago 11 21:28 aoede.d
drwxr-xr-x 103 nodge nodge     4096 ago 11 21:21 build
-rw-r--r--   1 nodge nodge      198 ago 11 21:29 config.toml
drwxr-xr-x   2 nodge nodge    65536 ago 11 21:28 deps
drwxr-xr-x   2 nodge nodge     4096 ago 11 21:21 examples
drwxr-xr-x   2 nodge nodge     4096 ago 11 21:21 incremental

image

oleggtro commented 2 years ago

Oops I forgot to change the sample config after the patch. You need to remove the quotes around the user id

jacksight commented 2 years ago

I open the aoede file on my mac, and then it opens the terminal, and my config.toml is in the release folder. When I execute it, it says: Couldn't read config Missing field: 'DISCORD_TOKEN'

Saving session...completed.

I don't know what happened...

This is my config file: DISCORD_TOKEN= xxxxxxxxxxxxxxxxxxxxxxxx SPOTIFY_USERNAME= xxxxxxxx@xxxxx.com SPOTIFY_PASSWORD= xxxxxxxxx DISCORD_USER_ID= xxxxxxxxxxxxxx

oleggtro commented 2 years ago

The config is supposed to look like this:

DISCORD_TOKEN="Mjk3ODQzNDgzNzgzODU2MjMw.SxDNko.UOdRWlDuz_lFrTOeQWEuzKGBmDFdVTGns3jd4o"
SPOTIFY_USERNAME="mail@example.com"
SPOTIFY_PASSWORD="MySpotifyPassword"
DISCORD_USER_ID=301780655019130880
jacksight commented 2 years ago

I've tried both ways, it's not working

oleggtro commented 2 years ago

Well, can you provide error logs? Please copy paste the example config above and only replace the values in there. Leave the quotes as they are.

jacksight commented 2 years ago

DISCORD_TOKEN="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" SPOTIFY_USERNAME="xxxxxxxxxxxx@hotmail.com" SPOTIFY_PASSWORD="xxxxxxxxxxxxxxx" DISCORD_USER_ID=476622988385714176

(base) jacksight@jacksight-MacBook-Pro ~ % /Users/jacksight/aoede/target/release/aoede ; exit; Couldn't read config Missing field: 'DISCORD_TOKEN'

Saving session...completed.

jacksight commented 2 years ago

So...... What seems to be the problem?

codetheweb commented 2 years ago

That looks right to me. Are you able to try passing in via the environment instead?

Knopfi02 commented 1 year ago

same problem :(

oleggtro commented 1 year ago

Are you using a mac as well? @Knopfi02

Knopfi02 commented 1 year ago

No, I'm on windows @cloudybyte

oleggtro commented 1 year ago

Are you executing the binary via double-clicking it? If yes, please try opening via command line/powershell. Note: you need to be in aoedes root directory for this to work.