Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server crashs when initialising a fresh syncronisation from a client #45

Closed
derritter88 opened this issue Apr 19, 2021 · 21 comments
Closed

Comments

@derritter88
Copy link

derritter88 commented Apr 19, 2021

Hello there,
I recently tried the MM server but unfortunately I get an exception at the initial sync:

PS C:\Users\mmuehlbacher\Downloads\MMS-win64-0.3.2> .\mms.exe --ssdpLog Database loaded in 5 ms ================================================== MMS v0.3.2 running at http://x.x.x.x:10222 (or http://localhost:10222) Connect using a web browser or using MediaMonkey 5. ================================================== 101243 files has been read from SQL DB in 10138 milliseconds Scan music directory: file:G:/Musik, 57504 files to process

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
1: 00007FF60DCEBBFF RC4_options+2528383
2: 00007FF60DCB4C56 RC4_options+2303190
3: 00007FF60DCBABC0 RC4_options+2327616
4: 00007FF60E0E2DFE RC4_options+6686334
5: 00007FF60E0ABF56 RC4_options+6461398
6: 00007FF60E1CCC4C RC4_options+7644364
7: 00007FF60E1C7F14 RC4_options+7624596
8: 00007FF60E1FB1C4 RC4_options+7834180
9: 00007FF60E1742E8 RC4_options+7281512
10: 00007FF60E0AC47B RC4_options+6462715
11: 00007FF60E0F0676 RC4_options+6741750
12: 00007FF60DCA0026 RC4_options+2218150
13: 00007FF60E4B80BE RC4_options+10705214
14: 00007FF60E4B72CB RC4_options+10701643
15: 00007FF60E4B7768 RC4_options+10702824
16: 00007FF60E4B757B RC4_options+10702331
17: 000000FC75FDC5C1

@JL102
Copy link
Collaborator

JL102 commented Apr 19, 2021

Intriguing. Maybe the prebuilt executable doesn't have enough maximum memory allocated to it?

Could you try running it from the source, instead of from the prebuilt release, and see if that changes things?
Instructions on how to set it up are on the main README. The only discrepancy is that I don't think the command npm install -global windows-build-tools works anymore. Just go to that link for node-gyp (https://github.com/nodejs/node-gyp) and follow the instructions for Windows, and you should be good.

@derritter88
Copy link
Author

I will try that but installing development tools on Windows Server is a bit tricky.

@derritter88
Copy link
Author

Unfortunately I always get an error message

npm ERR! code 1
npm ERR! path C:\Users\mmuehlbacher\Downloads\mms-master\node_modules\windows-trayicon
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c autogypi && node-gyp configure build
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@3.8.0
npm ERR! gyp info using node@15.14.0 | win32 | x64
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Command failed: C:\Program Files\Python\Python38\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3];
npm ERR! gyp ERR! stack   File "<string>", line 1
npm ERR! gyp ERR! stack     import sys; print "%s.%s.%s" % sys.version_info[:3];
npm ERR! gyp ERR! stack                       ^
npm ERR! gyp ERR! stack SyntaxError: invalid syntax
npm ERR! gyp ERR! stack
npm ERR! gyp ERR! stack     at ChildProcess.exithandler (node:child_process:326:12)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:369:20)
npm ERR! gyp ERR! stack     at maybeClose (node:internal/child_process:1067:16)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
npm ERR! gyp ERR! System Windows_NT 10.0.17763
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\mmuehlbacher\\Downloads\\mms-master\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure" "build"
npm ERR! gyp ERR! cwd C:\Users\mmuehlbacher\Downloads\mms-master\node_modules\windows-trayicon
npm ERR! gyp ERR! node -v v15.14.0
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\mmuehlbacher\AppData\Local\npm-cache\_logs\2021-04-19T17_42_29_866Z-debug.log  

I don't know if this is being caused by a faulty dev environment or by some other errors?!

@derritter88
Copy link
Author

I think I have solved this issue by downloading the windows-trayicon-module from here and put it in the node_modules folder.

Anyway I think this should be fixed in the sources.

@derritter88
Copy link
Author

Okay so after running npm start I received following error messages


> mediamonkeyserver@0.3.2 start
> node server.js

node:internal/modules/cjs/loader:927
  throw err;
  ^

Error: Cannot find module 'passport'
Require stack:
- C:\Users\mmuehlbacher\Downloads\mms-master\lib\auth.js
- C:\Users\mmuehlbacher\Downloads\mms-master\lib\upnpServer.js
- C:\Users\mmuehlbacher\Downloads\mms-master\api.js
- C:\Users\mmuehlbacher\Downloads\mms-master\server.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:924:15)
    at Function.Module._load (node:internal/modules/cjs/loader:769:27)
    at Module.require (node:internal/modules/cjs/loader:996:19)
    at require (node:internal/modules/cjs/helpers:92:18)
    at Object.<anonymous> (C:\Users\mmuehlbacher\Downloads\mms-master\lib\auth.js:6:18)
    at Module._compile (node:internal/modules/cjs/loader:1092:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1121:10)
    at Module.load (node:internal/modules/cjs/loader:972:32)
    at Function.Module._load (node:internal/modules/cjs/loader:813:14)
    at Module.require (node:internal/modules/cjs/loader:996:19)
    at require (node:internal/modules/cjs/helpers:92:18)
    at Object.<anonymous> (C:\Users\mmuehlbacher\Downloads\mms-master\lib\upnpServer.js:16:14)
    at Module._compile (node:internal/modules/cjs/loader:1092:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1121:10)
    at Module.load (node:internal/modules/cjs/loader:972:32)
    at Function.Module._load (node:internal/modules/cjs/loader:813:14) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    'C:\\Users\\mmuehlbacher\\Downloads\\mms-master\\lib\\auth.js',
    'C:\\Users\\mmuehlbacher\\Downloads\\mms-master\\lib\\upnpServer.js',
    'C:\\Users\\mmuehlbacher\\Downloads\\mms-master\\api.js',
    'C:\\Users\\mmuehlbacher\\Downloads\\mms-master\\server.js'
  ]
}

@JL102
Copy link
Collaborator

JL102 commented Apr 19, 2021

I think I have solved this issue by downloading the windows-trayicon-module from here and put it in the node_modules folder.

Anyway I think this should be fixed in the sources.

Ah, great. Yeah, the windows-trayicon module is quite problematic; Usually I'm able to get it to work by deleting node_modules, manually doing npm i windows-trayicon, then doing npm install.

Okay so after running npm start I received following error messages


> mediamonkeyserver@0.3.2 start
> node server.js

node:internal/modules/cjs/loader:927
  throw err;
  ^

Error: Cannot find module 'passport'

Oh, goodness gracious. I made a pull request the other day where I was trying to bring the dev branch up to date with the master branch. I've been doing some work on the dev branch with improved user-login stuff. Apparently, somehow, Git still performed the merge from dev to master. Give me a few minutes; I'll get back to you with a fix.

@derritter88
Copy link
Author

Okay - I have recognised a couple of other dependencies.
Most of them have been able to be solved by just `npm install but not all.

I'll wait for your information about the merge.
Will it be able as a master.zip?

@JL102
Copy link
Collaborator

JL102 commented Apr 19, 2021

There we go - I've updated the master branch with those dependency fixes. If you cloned it initially with git clone, you can just do git pull - but if you downloaded as a master.zip, just try redownloading that zip and extracting it into a new location. I really didn't intend for these changes to be put on the master branch yet, but hopefully it works.

The switch to better-sqlite3 is the most major improvement, however; Let me know if it works better for you this time.

@derritter88
Copy link
Author

Okay it works now - compilation worked flawless.
The only issue that I currently see is that I am no longer able to add a music library.
As far as I see is MMS thinks it's hosted on a Linux server as the "create collection" window shows a simple "/".

I have tried to enter the Windows path of my music folder G:\Musik and also G:/Musik.

Didn't work.

@JL102
Copy link
Collaborator

JL102 commented Apr 19, 2021

Huh, strange. Does it not show drive letters here?
image

If not, maybe the front-end thinks you're logged in while the back-end thinks you're logged out. Try clicking the icon on the top-right, click logout, then log back in and try again.

@derritter88
Copy link
Author

Okay the collection shows now up - strange why it did not do that in the first step.
Just for info: In the console output I was able to see my music folder

@derritter88
Copy link
Author

"Sign out" within MM5 is not working. As soon as I click it MM5 says that the server is not working "Server ist ausgefallen." in German.

I'll try to delete and re-add it.

@derritter88
Copy link
Author

Okay did not work - additional MM5 throws a JS alert "listPlaylists error 401 :Not logged in.

@JL102
Copy link
Collaborator

JL102 commented Apr 19, 2021

Ah - I'll be honest, I haven't tested this new system within MM5. Only via the web application.

If it doesn't work for you, I think your best bet will be to install the version of MMS before my accidental merge: https://github.com/mediamonkeyserver/mms/tree/20c7b5083757afc8dd762a03815ef1d671def0e3
You should be able to download this one as a zip. Sorry about all the trouble you're going through.

@derritter88
Copy link
Author

No problems - I just tried to test MMS if this could be used within my network as MM5 throws also an error when I want to install it on my Windows Server 2019.

Regarding the mentioned version: It also throws the windows-trayicon error

@JL102
Copy link
Collaborator

JL102 commented Apr 19, 2021

That dang windows-trayicon package. :P
I found that installing version 3.0.0 seems to be more reliable - Try doing npm install windows-trayicon@3.0.0 and then doing the regular npm install?

@derritter88
Copy link
Author

I will leave it for the moment.
Running development stuff on my production server is not feeling me very comfortable.

I think I'll launch a dedicated VM for that.

Is anyone build regular compiled packages for Windows machines?

@jirihajek
Copy link
Contributor

I suspect that it might be related to the default memory limitations of Node.js. I tried to compile the package option --max_old_space_size=8192 as recommended at https://support.circleci.com/hc/en-us/articles/360009208393-How-can-I-increase-the-max-memory-for-Node-. I updated the MMS-win64-0.3.2.rar package (still the same codebase, just this different runtime option), please try it if you can.

@derritter88
Copy link
Author

Thanks for the update.
Just to be sure: I will find the updated version right here ->https://www.mediamonkey.com/forum/viewtopic.php?f=31&t=90809&sd=d
?

If so then the intial synchronisation is working properly -> MMS is querying the folder for new stuff while MM5 is getting any new music file directly from MMS.

I will stop this process now and wait for MMS to have it's intial process finished and then reconnect MM5 again as this was original issue I had.

@derritter88
Copy link
Author

Okay the syncronisation works flawless.

I recognised that there are sometimes some audio artifacts while streaming via MMS - is this a known issue?

@jirihajek
Copy link
Contributor

Right, the new updated build there was compiled with the new flag. Thanks for confirmation! Will include this flag in future builds, closing this issue now.

As for the audio artifacts, no, this should work fine. Feel free to create a new issue. Would be good to know whether it's related to particular audio format and whether the format needs to be converted on-the-fly for the target device.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants