pssc / ha-addon-lms

Logitech Media Server Addon for Home Assistant
GNU General Public License v3.0
55 stars 13 forks source link

Unable to Save Playlist (502 Error), "upstream prematurely closed connection while reading response header" error, and "Bad Logitech Media Server config" error #59

Closed kylepyke closed 7 months ago

kylepyke commented 8 months ago

Hi,

I'm having the following errors in the log:

2023/11/28 22:15:18 [error] 596#596: *358 upstream prematurely closed connection while reading response header from upstream, client: 172.30.32.2, server: fc57b866-lms, request: "POST /jsonrpc.js HTTP/1.1", upstream: "http://127.0.0.1:9000/jsonrpc.js", host: "homeassistant.local:8123", referrer: "http://homeassistant.local:8123/api/hassio_ingress/xcQTalmOHhGNc4ThQy5jRJuHhlChxV38dV4uz4TtJJY/"
2023/11/28 22:15:26 [error] 596#596: *358 upstream prematurely closed connection while reading response header from upstream, client: 172.30.32.2, server: fc57b866-lms, request: "POST /jsonrpc.js HTTP/1.1", upstream: "http://127.0.0.1:9000/jsonrpc.js", host: "homeassistant.local:8123", referrer: "http://homeassistant.local:8123/api/hassio_ingress/xcQTalmOHhGNc4ThQy5jRJuHhlChxV38dV4uz4TtJJY/"
[23-11-28 22:15:18.1738] Slim::Web::JSONRPC::requestMethod (477) Request failed with error: Bad Logitech Media Server config
[23-11-28 22:15:26.4456] Slim::Web::JSONRPC::requestMethod (477) Request failed with error: Bad Logitech Media Server config

Is some sort of config file corrupt? Any way to have it auto-regenerated, or do I need a complete reinstall?

Unsure if related, but I'm also unable to save playlists in the interface with the error:

"Failed to save play queue! (Error: Request failed with status code 502)"

This has been super solid for over a year, and I've just started getting TONS of weird errors and behavior. Any advice is appreciated.

Thanks!

pssc commented 8 months ago

Hi @kylepyke not seen that one before and I have been running LMS for well over a decade,

Things to check.

permissions on LMS config dirs, and try toggling the set_permissions option. Not sure what your running on iffy disc or SD Card? You could wind back /conig/lms back to a known good all the state is in there. What do you see if you go direct to port 9000 ?

kylepyke commented 8 months ago

Running this as an addon in Home Assistant– not sure how to change permissions on HAos? I'm not seeing a set_permissions option.

Interesting... It could be the disk? It's fairly old SSD (almost 10 years of light-medium use), but I haven't had any issues until now. Maybe it is starting to go.

Going direct to port 9000 shows the normal interface as you would expect.

Thanks for your help and suggestions!

kylepyke commented 8 months ago

Oddly enough as soon as I wrote to you, I got this error:

[23-11-29 11:40:02.9182] main::init (377) Starting Logitech Media Server (v8.3.1, 1676361197, Fri 17 Feb 2023 06:37:09 AM CET) perl 5.036000 - x86_64-linux-gnu-thread-multi
[23-11-29 11:40:03.0988] Slim::Utils::Strings::parseStrings (387) Error: Parsing line 279:     EN   <br><b>Password</b>: Device password
parse error: Expected string key before ':' at line 1, column 4
parse error: Expected string key before ':' at line 1, column 4
parse error: Expected string key before ':' at line 1, column 4
parse error: Expected string key before ':' at line 1, column 4
parse error: Expected string key before ':' at line 1, column 4
parse error: Expected string key before ':' at line 1, column 4
parse error: Expected string key before ':' at line 1, column 4

Also, one of my media_player entities has been randomly turning off. In the entity history, It just says "turned off". No service or user.

pssc commented 8 months ago

Yes, set permissions is an add-on option for LMS still worth a go, does all smack of file corruption...

On Thu, 30 Nov 2023, 01:56 kylepyke, @.***> wrote:

Oddly enough as soon as I wrote to you, I got this error:

[23-11-29 11:40:02.9182] main::init (377) Starting Logitech Media Server (v8.3.1, 1676361197, Fri 17 Feb 2023 06:37:09 AM CET) perl 5.036000 - x86_64-linux-gnu-thread-multi [23-11-29 11:40:03.0988] Slim::Utils::Strings::parseStrings (387) Error: Parsing line 279: EN
Password: Device password parse error: Expected string key before ':' at line 1, column 4 parse error: Expected string key before ':' at line 1, column 4 parse error: Expected string key before ':' at line 1, column 4 parse error: Expected string key before ':' at line 1, column 4 parse error: Expected string key before ':' at line 1, column 4 parse error: Expected string key before ':' at line 1, column 4 parse error: Expected string key before ':' at line 1, column 4

— Reply to this email directly, view it on GitHub https://github.com/pssc/ha-addon-lms/issues/59#issuecomment-1832982257, or unsubscribe https://github.com/notifications/unsubscribe-auth/AANORYLRDEWHCXBENBQPSIDYG7RWTAVCNFSM6AAAAAA76Z5GLWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMZSHE4DEMRVG4 . You are receiving this because you were assigned.Message ID: @.***>

kylepyke commented 8 months ago

So I replaced my hard drive, and it seems some issues went away. I do occasionally see the "parse error: Expected string key before ':' at line 1, column 4" error, but it doesn't seem to affect functionality and I only see it on startup?

I am still unable to save playlists, regardless of whether set permissions is toggled or not. Do I need to set the LMS user as admin or run the addon unprotected? Should the directory be set in the addon config?

Also seems the "upgrade_packages" options causes the addon to hang. The log reads "After this operation, 4096 B of additional disk space will be used." then fails to respond until HA is restarted.

Thanks for your help!

steamboy23 commented 8 months ago

Same here. Also create new dynamic playlist results in 404 not found. set permison checked on

pssc commented 8 months ago

Yes you need to make sure your saving it to somewhere that LMS can write to this would be under /config/lms/ by default you need to make sure the uid that lms runs as (1000 by default can write to your location)

cd /config/lms
mkdir playlists
chown 1000 playlists

If you wanted to create a suitable subdir for playlists for example.

pssc commented 8 months ago

I can confirm that upgrading the packages is broken :-(, I will look to address that in the next release