IrosTheBeggar / mStream

The easiest music streaming server available
http://mstream.io
GNU General Public License v3.0
2.21k stars 186 forks source link

Unable to start the instance #399

Closed guillaumesoucy94 closed 1 year ago

guillaumesoucy94 commented 1 year ago

Hello,

After adding a new directory to contain music files, I'm now unable to start the instance. It thrown that error instead:

               ____  _
     _ __ ___ / ___|| |_ _ __ ___  __ _ _ __ ___
    | '_ ` _ \\___ \| __| '__/ _ \/ _` | '_ ` _ \
    | | | | | |___) | |_| | |  __/ (_| | | | | | |
    |_| |_| |_|____/ \__|_|  \___|\__,_|_| |_| |_|
v5.11.4

Check out our Discord server:
https://discord.gg/AM896Rr

2022-11-30T21:36:49.972Z error: Failed to validate config file
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string or an instance of Buffer or URL. Received undefined
    at Object.stat (node:internal/fs/promises:781:10)
    at exports.setup (/mnt/disk/musicshare.zsites.ca/src/state/config.js:126:20)
    at async exports.serveIt (/mnt/disk/musicshare.zsites.ca/src/server.js:36:5)

To start the instance it is npm run-script start right?

I did look into the currents other users issues on GitHub and couldn't be able to find anything.

How to make it work again?

Thank-you,

Guillaume

guillaumesoucy94 commented 1 year ago

Good day,

When you'll have time, could you please help me out to figure what wrong?

Thank-you

Guillaume

aroundmyroom commented 1 year ago

please check the config json and try to see if you have a valid path compared to the previous ones.

guillaumesoucy94 commented 1 year ago

@aroundmyroom

Hello,

I did not change anything in that file. I make a copy of the original one and I've downloaded that file using wget: https://raw.githubusercontent.com/IrosTheBeggar/mStream/master/src/state/config.js

and the issue keep happening.

Guillaume

aroundmyroom commented 1 year ago

the config.js is not the file where you put the path. check mStream/config/save/conf where the default.json is

and check here if the path is valid.

The error given states that the config file (which is the default.json) cannot be validated. So there must be an error in it.

guillaumesoucy94 commented 1 year ago

You mean the path to the file default.json in config.js or if paths to audio content directories are valid in default.json ?

I just look and the paths to those directories in defaults.json exist on the server. The problem starts after adding more of those paths using the WebGUI.

Guillaume

aroundmyroom commented 1 year ago

So please give us the info about your default.json with the path parts

here you see what I have

"folders": { "Music": { "root": "/media/music" }, "12-inches": { "root": "/media/music/12 inches A-Z" } },

you can also paste your default.json totally where you remove pwd's or other keys. But at this time your default.json is not a valid json file (what the error is saying)

guillaumesoucy94 commented 1 year ago

This is my default.json file:

{ "secret": "removed", "folders": { "guillaumesoucy": { "musicsharezsitesca": { "root": "/mnt/disk/data/musicshare.zsites.ca", "type": "audio-books" }, "guillaumesoucy": { "root": "/mnt/disk/data/musicshare.zsites.ca/guillaumesoucy", "type": "audio-books" } } }, "users": { "admin": { "vpaths": [ "guillaumesoucy" ], "password": "removed", "salt": "removed", "admin": true, "username": "admin" }, "guillaumesoucy": { "vpaths": [ "guillaumesoucy" ], "password": "removed", "salt": "removed", "admin": false, "username": "guillaumesoucy" } }, "port": "80" }

Yes I saw in the error message that the json file is not valid. I don't know how to deal with that one. Unfortunately.

Thanks for your continuous help!

Guillaume

aroundmyroom commented 1 year ago

actually I bave no clue, the json is valid, but mStream states it cannot validate did you install all needed NPM modules? like with npm link ?

guillaumesoucy94 commented 1 year ago

I'd follow the instructions from there https://github.com/IrosTheBeggar/mStream/blob/master/docs/install.md and everything was fine at first. What are the NPM modules that you suggest me to install?

Thanks,

Guillaume

aroundmyroom commented 1 year ago

that up to mStream, maybe its not even needed anymore. I have no clue why this is happening. as the config seems valid, but cannot be validated

guillaumesoucy94 commented 1 year ago

Ok, in that case is there another thing that I can try before trying to re-deploy it?

Guillaume

aroundmyroom commented 1 year ago

you might redeploy and see where it crashes when you have the default settings. ie. first start with 1 folder to see what is happening.

guillaumesoucy94 commented 1 year ago

It is possible to redeploy it without reinstalling the OS, Ubuntu Server on the VM? In other words to remove mStream only and to reinstall it?

Thank-you,

Guillaume

Steve-Tech commented 1 year ago

I also had this strange bug when adding 2 folders in the UI where a folder gets inherited by another and becomes incompatible with what mStream is expecting. @guillaumesoucy94 I haven't tested it, but I think this should work:

{
  "secret": "removed",
  "folders": {
    "musicsharezsitesca": {
      "root": "/mnt/disk/data/musicshare.zsites.ca",
      "type": "audio-books"
    },
    "guillaumesoucy": {
      "root": "/mnt/disk/data/musicshare.zsites.ca/guillaumesoucy",
      "type": "audio-books"
    }
  },
  "users": {
    "admin": {
      "vpaths": [
        "guillaumesoucy"
      ],
      "password": "removed",
      "salt": "removed",
      "admin": true,
      "username": "admin"
    },
    "guillaumesoucy": {
      "vpaths": [
        "guillaumesoucy"
      ],
      "password": "removed",
      "salt": "removed",
      "admin": false,
      "username": "guillaumesoucy"
    }
  },
  "port": "80"
}
guillaumesoucy94 commented 1 year ago

@Steve-Tech

Thanks it works now! :-P