jagrosh / jagrosh/MusicBot

[Bug] Not reading the config file

Open
#1,791 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
5.8k
Forks
2.8k
PR merge metrics
No merged PRs in 30d

Description

### Bug Description

I am trying to set up JMB to start on system startup. I have an in-home server that runs a bunch of stuff, and every time I lose power or the server updates/shuts down/whatever, I have to manually remote in or go to the server rack to start JMB. So I went into the Startup Applications Preferences and am trying to add the Java arguments to start the bot on boot up. When adding `java -jar /home/wildfyr/Desktop/MusicBot/JMusicBot.jar` instead of starting the bot, it asks me to input a bot token, even though the config has an existing bot token. The config file resides in the location where it was initially created, /home/wildfyr/Desktop/MusicBot. When I click cancel, the pop up tells me it created a config file in /home/wildfyr. However, no such config file exists and the bot does not start.

*Edit: It does work find when spliting up the commands, such like `cd /home/wildfyr/Desktop/MusicBot && java -jar JMusicBot.jar` it works fine and starts no problem. But not when making it all one command.*

### Steps to Reproduce

Open a terminal line
Run the start up args `java -jar /home/user/wherever/your/bot/is`
Does not read the config file

### Expected Result

I expect the bot to read the config file in /home/wildfyr/Desktop/MusicBot and start normally

### Debug Output

I cannot do this as the bot does not actually start because of this issue

### Additional Info

_No response_

### Checklist

- [X] I have looked for information about this [within the documentation](https://jmusicbot.com/)
- [X] I have searched for similar issues [on the issues page](https://github.com/jagrosh/MusicBot/issues?q=is%3Aissue)
- [X] I am using an official release from [the releases page](https://github.com/jagrosh/MusicBot/releases)

### JMusicBot Version

0.4.3

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the startup command with the JMusicBot.jar absolute path, then compare it with `cd /home/wildfyr/Desktop/MusicBot && java -jar JMusicBot.jar`. Trace how startup locates the existing config file under `/home/wildfyr/Desktop/MusicBot`; done means the single command reads that config and starts without requesting a token.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.