unoffical-sonos-controller-for-linux icon indicating copy to clipboard operation
unoffical-sonos-controller-for-linux copied to clipboard

[Bug] Local Music causes unhandled promise rejection

Open kalsan opened this issue 4 years ago • 4 comments

Thanks for this awesome application! Here's a bug report for local devices:

  • Installed from snap (today with --edge)
  • Enabled local music server ("server already running")
  • Set local music folder /home/me/Musik which is a symlink to /home/me/stuff/music (both belong to the user the controller is running at)
  • Select music rouces "On this device"
(node:3612) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'length' of undefined
    at MetadataCollector.postFixPicture (/snap/sonos-controller-unofficial/28/resources/app.asar/node_modules/music-metadata/lib/common/MetadataCollector.js:200:26)
    at MetadataCollector.postMap (/snap/sonos-controller-unofficial/28/resources/app.asar/node_modules/music-metadata/lib/common/MetadataCollector.js:109:22)
    at MetadataCollector.toCommon (/snap/sonos-controller-unofficial/28/resources/app.asar/node_modules/music-metadata/lib/common/MetadataCollector.js:227:18)
    at MetadataCollector.addTag (/snap/sonos-controller-unofficial/28/resources/app.asar/node_modules/music-metadata/lib/common/MetadataCollector.js:73:14)
    at APEv2Parser.parseTags (/snap/sonos-controller-unofficial/28/resources/app.asar/node_modules/music-metadata/lib/apev2/APEv2Parser.js:113:39)
    at async ID3v1Parser.parse (/snap/sonos-controller-unofficial/28/resources/app.asar/node_modules/music-metadata/lib/id3v1/ID3v1Parser.js:99:13)
    at async MpegParser.parseID3v2 (/snap/sonos-controller-unofficial/28/resources/app.asar/node_modules/music-metadata/lib/id3v2/AbstractID3Parser.js:47:13)
    at async MpegParser.parse (/snap/sonos-controller-unofficial/28/resources/app.asar/node_modules/music-metadata/lib/id3v2/AbstractID3Parser.js:24:13)
    at async Function._parse (/snap/sonos-controller-unofficial/28/resources/app.asar/node_modules/music-metadata/lib/ParserFactory.js:161:9)
    at async parseFile (/snap/sonos-controller-unofficial/28/resources/app.asar/node_modules/music-metadata/lib/index.js:46:16)
(node:3612) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:3612) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:3612) UnhandledPromiseRejectionWarning: Error: ENOENT, localMusic.sqlite not found in /snap/sonos-controller-unofficial/28/resources/app.asar
    at createError (electron/js2c/asar_bundle.js:5:1255)
    at Object.t.<computed> [as open] (electron/js2c/asar_bundle.js:5:2526)
    at Object.writeFile (fs.js:1345:6)
    at internal/util.js:297:30
    at new Promise (<anonymous>)
    at Object.writeFile (internal/util.js:296:12)
    at end (/snap/sonos-controller-unofficial/28/resources/app.asar/localMusic/db.js:36:39)
    at EventEmitter.<anonymous> (/snap/sonos-controller-unofficial/28/resources/app.asar/localMusic/db.js:142:13)
(node:3612) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 3)

Hope this helps. Best, Kalsan

kalsan avatar Dec 12 '20 11:12 kalsan

Does it work without the symlink?

pascalopitz avatar Mar 06 '21 01:03 pascalopitz

Thanks for coming back. The behaviour is the same when pointing to the actual folder directly.

kalsan avatar Mar 07 '21 13:03 kalsan

I had a similar problem as well and found that #173 solved this for me.

s1037989 avatar Dec 30 '21 17:12 s1037989

0.3.0-alpha3 still doesn't work but has a different behavior.

  • Music folder symlink is: /home/me/mymusic -> /home/me/subdirectory/music
  • current path is /home/me
  • when selecting the folder /home/me/mymusic/myalbum, the message is:
  <-- POST /smapi
[Error: ENOENT: no such file or directory, stat '/home/me/mymusic/../subdirectory/music/myalbum'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'stat',
  path: '/home/me/mymusic/../subdirectory/music/myalbum'
}
Action getMetadata caused Error {
  Envelope: {
    'xmlns:s': 'http://schemas.xmlsoap.org/soap/envelope/',
    'xmlns:ns': 'http://www.sonos.com/Services/1.1',
    Header: { credentials: [Object] },
    Body: { getMetadata: [Object] }
  }
}
  --> POST /smapi 404 4ms -

kalsan avatar Jan 02 '22 15:01 kalsan