Ensemble icon indicating copy to clipboard operation
Ensemble copied to clipboard

Thumbnails/Images don't use custom port

Open bloedboemmel opened this issue 9 months ago • 3 comments

I am running Music Assistant Server on Port 80, because I don't want to type in ports on my local network.

Ensemble seems to have an error when putting together the Address for the images.

Here are the important logs

[13:34:08.192] INFO  ⚡ SharedPreferences cached
[13:34:08.193] INFO  Initializing database...
[13:34:08.193] INFO  Database initialized successfully
[13:34:08.193] INFO  💾 Database initialized
[13:34:08.314] INFO  Migration skipped - no ownerName to migrate
[13:34:08.317] INFO  🔐 Secure storage migration complete
[13:34:08.317] INFO  📦 Loading library from database cache...
[13:34:08.326] INFO  📦 Loaded 0 albums, 0 artists, 0 audiobooks, 0 playlists from cache
[13:34:08.326] INFO  📦 Source providers: 0 albums, 0 artists tracked
[13:34:08.326] INFO  📦 Library cache loaded
[13:34:08.334] INFO  🎵 AudioService initialized - background playback and media notifications ENABLED
[13:34:08.337] INFO  🚀 AppStartup: Settings loaded, hasCompletedOnboarding=false
[13:34:08.337] INFO  🐛 DEBUG: Server URL from SharedPreferences: null
[13:34:08.362] INFO  📦 No cached players in database
[13:34:08.362] INFO  📦 Loading library from database cache...
[13:34:08.368] INFO  📦 Loaded 0 albums, 0 artists, 0 audiobooks, 0 playlists from cache
[13:34:08.368] INFO  📦 Source providers: 0 albums, 0 artists tracked
[13:34:19.157] INFO  📱 App paused (backgrounded)
[13:34:22.091] INFO  📱 App resumed - checking WebSocket connection...
[13:34:22.091] INFO  🔄 checkAndReconnect called - state: MAConnectionState.disconnected
[13:34:22.091] INFO  🔄 No server URL saved, skipping reconnect
[13:34:24.180] INFO  📱 App resumed - checking WebSocket connection...
[13:34:24.180] INFO  🔄 checkAndReconnect called - state: MAConnectionState.disconnected
[13:34:24.180] INFO  🔄 No server URL saved, skipping reconnect
[13:34:25.064] INFO  Connecting to: http://music:80
[13:34:25.068] INFO  Original server URL: http://music:80
[13:34:25.068] INFO  Using WebSocket session ID: session_1a890d7c-1e21-4ff3-b4c2-98a456c3d35f
[13:34:25.068] INFO  Using port from URL: 80
[13:34:25.068] INFO  Attempting unsecure (WS) connection
[13:34:25.068] INFO  Final WebSocket URL: ws://music:80/ws?client_id=session_1a890d7c-1e21-4ff3-b4c2-98a456c3d35f
[13:34:25.068] INFO  Connection: No authentication configured
[13:34:25.093] INFO  Received message: (server_id, server_version, schema_version, ..., homeassistant_addon, onboard_done)
[13:34:25.093] INFO  Received server info: 2.7.8 (schema: 28)
[13:34:25.093] INFO  Server: Requires authentication
[13:34:25.093] INFO  🔗 WebSocket connected to MA server
[13:34:25.093] INFO  🔐 MA auth required, attempting authentication...
[13:34:25.093] INFO  Connection: Connected to server
[13:34:25.093] INFO  Authenticating with Music Assistant...
[13:34:25.502] INFO  Logging in with credentials...
[13:34:25.502] INFO  🔐 Logging in with credentials...
[13:34:25.530] INFO  ❌ MA authentication failed - no valid token or credentials
[13:34:25.608] INFO  Received message: (message_id, result, partial)
[13:34:25.609] INFO  ✓ Got access token, authenticating session...
[13:34:25.618] INFO  Received message: (message_id, result, partial)
[13:34:25.619] INFO  ✅ Login and authentication successful
[13:34:25.619] INFO  Creating long-lived token...
[13:34:25.620] INFO  ✅ MA authentication successful
[13:34:25.620] INFO  🚀 Initializing after connection...
[13:34:25.620] INFO  📥 Fetching initial state...
[13:34:25.626] INFO  Received message: (message_id, error_code, details)
[13:34:25.626] INFO  Command error: 12 - Invalid command: auth/create_token
[13:34:25.626] INFO  ⚠️ Token creation error: Exception: 12: Invalid command: auth/create_token
[13:34:25.675] INFO  MA token saved for future logins
[13:34:25.785] INFO  Manual name entered: jakobdersteuernde
[13:34:25.785] INFO  Setting active profile: jakobdersteuernde (source: manual)
[13:34:25.813] INFO  Profile activated: jakobdersteuernde (jakobdersteuernde)
[13:34:25.955] INFO  Received message: (message_id, result, partial)
[13:34:25.956] INFO  ✓ Provider manifests loaded: 67 providers with 57 icons
[13:34:25.957] INFO  ✅ Initial state fetch complete
[13:34:25.967] INFO  Received message: (message_id, result, partial)
[13:34:25.967] INFO  🔍 auth/me raw response keys: [message_id, result, partial]
[13:34:25.967] INFO  ✓ Got user info: username=jakobdersteuernde, display_name=null
[13:34:25.970] INFO  ✅ Set owner name from MA profile: jakobdersteuernde
[13:34:25.970] INFO  🔓 No provider filter - all providers visible
[13:34:25.970] INFO  🔓 No player filter - all players visible
[13:34:25.970] INFO  🎵 Loading music providers...
[13:34:25.975] INFO  Received message: (message_id, result, partial)
[13:34:25.975] INFO  🎵 Found 3 music providers: Audiobookshelf, Soundcloud, Tidal
[13:34:25.978] INFO  🔓 No provider filter - all 3 providers enabled
[13:34:25.978] INFO  👻 Fresh install detected, searching for adoptable ghost for "jakobdersteuernde"...
[13:34:25.978] INFO  Ghost adoption: Looking for existing player for "jakobdersteuernde"
[13:34:25.984] INFO  Received message: (message_id, result, partial)
[13:34:25.985] INFO  Ghost adoption: Searching for "jakobdersteuernde's Phone" or "jakobdersteuernde's Phone"
...
[13:34:26.993] ERROR [FlutterError] Flutter error: ClientException with SocketException: Connection refused (OS Error: Connection refused, errno = 111), address = music, port = 58874, uri=http://music:8095/imageproxy?provider=tidal--2d8wKU5Y&size=256&fmt=jpeg&path=https%3A%2F%2Fresources.tidal.com%2Fimages%2F31c3e96b%2F1f63%2F43ca%2F9683%2F1e9bcc749ef2%2F750x750.jpg
[13:34:26.993] ERROR [FlutterError] Stack trace:

[13:34:27.001] ERROR [FlutterError] Flutter error: ClientException with SocketException: Connection refused (OS Error: Connection refused, errno = 111), address = music, port = 58868, uri=http://music:8095/imageproxy?provider=tidal--2d8wKU5Y&size=256&fmt=jpeg&path=https%3A%2F%2Fresources.tidal.com%2Fimages%2Fda979cac%2F2743%2F4ee3%2F8d54%2Fd2a0feb1b133%2F750x750.jpg
[13:34:27.001] ERROR [FlutterError] Stack trace:

[13:34:27.008] ERROR [FlutterError] Flutter error: ClientException with SocketException: Connection refused (OS Error: Connection refused, errno = 111), address = music, port = 58900, uri=http://music:8095/imageproxy?provider=tidal--2d8wKU5Y&size=256&fmt=jpeg&path=https%3A%2F%2Fresources.tidal.com%2Fimages%2F5db16576%2Ffcbc%2F4b8f%2F95b0%2F2acd59742d56%2F750x750.jpg
[13:34:27.008] ERROR [FlutterError] Stack trace:

[13:34:27.009] ERROR [FlutterError] Flutter error: ClientException with SocketException: Connection refused (OS Error: Connection refused, errno = 111), address = music, port = 58898, uri=http://music:8095/imageproxy?provider=tidal--2d8wKU5Y&size=256&fmt=jpeg&path=https%3A%2F%2Fresources.tidal.com%2Fimages%2Fbca814d9%2F6056%2F42a2%2Fb71a%2F7b0cf51a768e%2F750x750.jpg
[13:34:27.009] ERROR [FlutterError] Stack trace:

[13:34:27.010] ERROR [FlutterError] Flutter error: ClientException with SocketException: Connection refused (OS Error: Connection refused, errno = 111), address = music, port = 58888, uri=http://music:8095/imageproxy?provider=spotify--6rYvLikK&size=256&fmt=jpeg&path=https%3A%2F%2Fi.scdn.co%2Fimage%2Fab6761610000e5ebb96be52905f6019b1c2897d6
[13:34:27.010] ERROR [FlutterError] Stack trace:

[13:34:27.011] ERROR [FlutterError] Flutter error: ClientException with SocketException: Connection refused (OS Error: Connection refused, errno = 111), address = music, port = 58902, uri=http://music:8095/imageproxy?provider=tidal--2d8wKU5Y&size=256&fmt=jpeg&path=https%3A%2F%2Fresources.tidal.com%2Fimages%2F6ba587b1%2Ff3ac%2F400c%2Fa05e%2F1ea70cca818d%2F750x750.jpg
[13:34:27.011] ERROR [FlutterError] Stack trace:

[13:34:27.011] ERROR [FlutterError] Flutter error: ClientException with SocketException: Connection refused (OS Error: Connection refused, errno = 111), address = music, port = 58910, uri=http://music:8095/imageproxy?provider=spotify--6rYvLikK&size=256&fmt=jpeg&path=https%3A%2F%2Fi.scdn.co%2Fimage%2Fab6761610000e5eb0e94f3e9cd3e721bfcf4a0ee
[13:34:27.011] ERROR [FlutterError] Stack trace:

[13:34:27.012] ERROR [FlutterError] Flutter error: ClientException with SocketException: Connection refused (OS Error: Connection refused, errno = 111), address = music, port = 58912, uri=http://music:8095/imageproxy?provider=spotify--6rYvLikK&size=256&fmt=jpeg&path=https%3A%2F%2Fi.scdn.co%2Fimage%2Fab6761610000e5ebc8c38f50f2e113e0fcea89d7
[13:34:27.012] ERROR [FlutterError] Stack trace:

[13:34:27.016] ERROR [FlutterError] Flutter error: ClientException with SocketException: Connection refused (OS Error: Connection refused, errno = 111), address = music, port = 58926, uri=http://music:8095/imageproxy?provider=tidal--2d8wKU5Y&size=256&fmt=jpeg&path=https%3A%2F%2Fresources.tidal.com%2Fimages%2F90fe2835%2F3442%2F4a24%2Fb56a%2Fc4158ec5efc6%2F750x750.jpg
[13:34:27.016] ERROR [FlutterError] Stack trace:

[13:34:27.018] ERROR [FlutterError] Flutter error: ClientException with SocketException: Connection refused (OS Error: Connection refused, errno = 111), address = music, port = 58922, uri=http://music:8095/imageproxy?provider=tidal--2d8wKU5Y&size=256&fmt=jpeg&path=https%3A%2F%2Fresources.tidal.com%2Fimages%2Fd1ffc798%2Fede1%2F4e3c%2F8da8%2F497c2c836b87%2F750x750.jpg
[13:34:27.018] ERROR [FlutterError] Stack trace:

[13:34:27.021] DEBUG [ArtistCard] MA image failed for "Thomas Lizzara", scheduling fallback
[13:34:27.021] DEBUG [ArtistCard] MA image failed for "The Wombats", scheduling fallback
[13:34:27.021] DEBUG [ArtistCard] MA image failed for "Super8 & Tab", scheduling fallback
[13:34:27.021] DEBUG [ArtistCard] MA image failed for "Neele Ternes", scheduling fallback
[13:34:27.021] DEBUG [ArtistCard] MA image failed for "Burkhard Dallwitz", scheduling fallback
[13:34:27.021] ERROR [FlutterError] Flutter error: ClientException with SocketException: Connection refused (OS Error: Connection refused, errno = 111), address = music, port = 58946, uri=http://music:8095/imageproxy?provider=spotify--6rYvLikK&size=256&fmt=jpeg&path=https%3A%2F%2Fi.scdn.co%2Fimage%2Fab67616d0000b273798f84ec8974d5142b51a7fb
[13:34:27.021] ERROR [FlutterError] Stack trace:

[13:34:27.021] ERROR [FlutterError] Flutter error: ClientException with SocketException: Connection refused (OS Error: Connection refused, errno = 111), address = music, port = 58940, uri=http://music:8095/imageproxy?provider=spotify--6rYvLikK&size=256&fmt=jpeg&path=https%3A%2F%2Fi.scdn.co%2Fimage%2Fab67616d0000b2734e97d34e9e6d5cc472ffd823
[13:34:27.021] ERROR [FlutterError] Stack trace:

[13:34:27.024] ERROR [FlutterError] Flutter error: ClientException with SocketException: Connection refused (OS Error: Connection refused, errno = 111), address = music, port = 58966, uri=http://music:8095/imageproxy?provider=spotify--6rYvLikK&size=256&fmt=jpeg&path=https%3A%2F%2Fi.scdn.co%2Fimage%2Fab67616d0000b27302f2d2d6aa0a0dca852e6fe3
[13:34:27.024] ERROR [FlutterError] Stack trace:

[13:34:27.025] ERROR [FlutterError] Flutter error: ClientException with SocketException: Connection refused (OS Error: Connection refused, errno = 111), address = music, port = 58956, uri=http://music:8095/imageproxy?provider=spotify--6rYvLikK&size=256&fmt=jpeg&path=https%3A%2F%2Fi.scdn.co%2Fimage%2Fab67616d0000b27328c216cf67f79fdd621cfe32
[13:34:27.025] ERROR [FlutterError] Stack trace:

[13:34:27.026] ERROR [FlutterError] Flutter error: ClientException with SocketException: Connection refused (OS Error: Connection refused, errno = 111), address = music, port = 58964, uri=http://music:8095/imageproxy?provider=spotify--6rYvLikK&size=256&fmt=jpeg&path=https%3A%2F%2Fi.scdn.co%2Fimage%2Fab67616d0000b273a1e8b73748ee972a4c22be16
[13:34:27.026] ERROR [FlutterError] Stack trace:

[13:34:27.032] ERROR [FlutterError] Flutter error: ClientException with SocketException: Connection refused (OS Error: Connection refused, errno = 111), address = music, port = 58976, uri=http://music:8095/imageproxy?provider=spotify--6rYvLikK&size=256&fmt=jpeg&path=https%3A%2F%2Fi.scdn.co%2Fimage%2Fab67616d0000b2731c2282de1886a840f999112d
[13:34:27.032] ERROR [FlutterError] Stack trace:

What I expect:

App should also use port 80 for the images

What's happening:

App uses default port 8095

Possible Code-Snippets responsible for this:

https://github.com/CollotsSpot/Ensemble/blob/0e5679262c1cf58649a75c8019f3b8f033ff48c8/lib/services/music_assistant_api.dart#L138-L170

https://github.com/CollotsSpot/Ensemble/blob/0e5679262c1cf58649a75c8019f3b8f033ff48c8/lib/constants/network.dart#L6

bloedboemmel avatar Feb 20 '26 12:02 bloedboemmel

Hi @bloedboemmel try this build and key me know if the issue is resolved.

https://github.com/CollotsSpot/Ensemble/actions/runs/22275078268/artifacts/5606423651

CollotsSpot avatar Feb 22 '26 11:02 CollotsSpot

@CollotsSpot This works perfectly. I don't see any errors anymore and my library shows finally all pcitures!

bloedboemmel avatar Feb 22 '26 11:02 bloedboemmel

Excellent. Will be included in next release 👍🏼

CollotsSpot avatar Feb 22 '26 11:02 CollotsSpot