spotube icon indicating copy to clipboard operation
spotube copied to clipboard

App Shows "Authentication Failure" Popup on Launch Due to DioException (404)

Open SudiptaSaha20 opened this issue 7 months ago • 2 comments

Is there an existing issue for this? (Please read the description)

  • [ ] I have searched the existing issues

Current Behavior

When the app is launched, a modal dialog immediately appears with the following error message:

Error Authentication Failure
DioException [bad response]: This exception was thrown because the response has a status code of 404 and RequestOptions.validateStatus was configured to throw for this status code.
The status code of 404 has the following meaning: "Client error - the request contains bad syntax or cannot be fulfilled"

This happens before any user interaction, and the app becomes unusable without any recovery option.

Expected Behavior

The app should launch without crashing or throwing an exception.

Steps to reproduce

  1. I opened the app
  2. A pop-up appeared with the error message

Logs

Logs
[2025-06-12 06:38:35.949189]---------------------
Bad state: Logs file is empty or non-existent
#0      logsProvider.<anonymous closure> (package:spotube/provider/logs/logs_provider.dart:11)
<asynchronous suspension>
#1      _AsBroadcastStreamController.add (dart:async/broadcast_stream_controller.dart:487)
<asynchronous suspension>

----------------------------------------
[2025-06-12 06:38:42.738062]---------------------
OAuth authorization error (invalid_token): The access token expired.
#0      Client.send (package:oauth2/src/client.dart:134)
<asynchronous suspension>
#1      BaseClient._sendUnstreamed (package:http/src/base_client.dart:93)
<asynchronous suspension>
#2      SpotifyApiBase._getImpl.<anonymous closure> (package:spotify/src/spotify_base.dart:211)
<asynchronous suspension>
#3      SpotifyApiBase._requestWrapper (package:spotify/src/spotify_base.dart:247)
<asynchronous suspension>
#4      SpotifyApiBase._getImpl (package:spotify/src/spotify_base.dart:210)
<asynchronous suspension>
#5      CursorPages.getPage (package:spotify/src/endpoints/endpoint_paging.dart:292)
<asynchronous suspension>
#6      SinglePages.stream.handlePageAndGetNext (package:spotify/src/endpoints/endpoint_paging.dart:187)
<asynchronous suspension>

----------------------------------------
[2025-06-12 06:38:42.742054]---------------------
DioException [bad response]: This exception was thrown because the response has a status code of 401 and RequestOptions.validateStatus was configured to throw for this status code.
The status code of 401 has the following meaning: "Client error - the request contains bad syntax or cannot be fulfilled"
Read more about status codes at https://developer.mozilla.org/en-US/docs/Web/HTTP/Status
In order to resolve this exception you typically have either to verify and fix your request code or you have to fix the server code.

#0      DioMixin.fetch (package:dio/src/dio_mixin.dart:520)
<asynchronous suspension>
#1      CustomSpotifyEndpoints.getHomeFeed (package:spotube/services/custom_spotify_endpoints/spotify_endpoints.dart:131)
<asynchronous suspension>
#2      FutureHandlerProviderElementMixin.handleFuture.<anonymous closure>.<anonymous closure> (package:riverpod/src/async_notifier/base.dart:355)
<asynchronous suspension>

----------------------------------------
[2025-06-12 06:38:42.743043]---------------------
DioException [bad response]: This exception was thrown because the response has a status code of 401 and RequestOptions.validateStatus was configured to throw for this status code.
The status code of 401 has the following meaning: "Client error - the request contains bad syntax or cannot be fulfilled"
Read more about status codes at https://developer.mozilla.org/en-US/docs/Web/HTTP/Status
In order to resolve this exception you typically have either to verify and fix your request code or you have to fix the server code.

#0      DioMixin.fetch (package:dio/src/dio_mixin.dart:520)
<asynchronous suspension>
#1      CustomSpotifyEndpoints.getView (package:spotube/services/custom_spotify_endpoints/spotify_endpoints.dart:80)
<asynchronous suspension>
#2      FutureHandlerProviderElementMixin.handleFuture.<anonymous closure>.<anonymous closure> (package:riverpod/src/async_notifier/base.dart:355)
<asynchronous suspension>

----------------------------------------
[2025-06-12 06:38:42.750054]---------------------
OAuth authorization error (invalid_token): The access token expired.
#0      Client.send (package:oauth2/src/client.dart:134)
<asynchronous suspension>
#1      BaseClient._sendUnstreamed (package:http/src/base_client.dart:93)
<asynchronous suspension>
#2      SpotifyApiBase._getImpl.<anonymous closure> (package:spotify/src/spotify_base.dart:211)
<asynchronous suspension>
#3      SpotifyApiBase._requestWrapper (package:spotify/src/spotify_base.dart:247)
<asynchronous suspension>
#4      SpotifyApiBase._getImpl (package:spotify/src/spotify_base.dart:210)
<asynchronous suspension>
#5      Me.get (package:spotify/src/endpoints/me.dart:22)
<asynchronous suspension>
#6      SpotifyApiWrapper.invoke (package:spotube/provider/spotify/spotify.dart:96)
<asynchronous suspension>
#7      FutureHandlerProviderElementMixin.handleFuture.<anonymous closure>.<anonymous closure> (package:riverpod/src/async_notifier/base.dart:355)
<asynchronous suspension>

----------------------------------------
[2025-06-12 06:38:42.751044]---------------------
OAuth authorization error (invalid_token): The access token expired.
#0      Client.send (package:oauth2/src/client.dart:134)
<asynchronous suspension>
#1      BaseClient._sendUnstreamed (package:http/src/base_client.dart:93)
<asynchronous suspension>
#2      SpotifyApiBase._getImpl.<anonymous closure> (package:spotify/src/spotify_base.dart:211)
<asynchronous suspension>
#3      SpotifyApiBase._requestWrapper (package:spotify/src/spotify_base.dart:247)
<asynchronous suspension>
#4      SpotifyApiBase._getImpl (package:spotify/src/spotify_base.dart:210)
<asynchronous suspension>
#5      Pages.getPage (package:spotify/src/endpoints/endpoint_paging.dart:253)
<asynchronous suspension>
#6      SpotifyApiWrapper.invoke (package:spotube/provider/spotify/spotify.dart:96)
<asynchronous suspension>
#7      FeaturedPlaylistsNotifier.fetch (package:spotube/provider/spotify/playlist/featured.dart:33)
<asynchronous suspension>
#8      FeaturedPlaylistsNotifier.build (package:spotube/provider/spotify/playlist/featured.dart:43)
<asynchronous suspension>
#9      FutureHandlerProviderElementMixin.handleFuture.<anonymous closure>.<anonymous closure> (package:riverpod/src/async_notifier/base.dart:355)
<asynchronous suspension>

----------------------------------------
[2025-06-12 06:38:42.752045]---------------------
OAuth authorization error (invalid_token): The access token expired.
#0      Client.send (package:oauth2/src/client.dart:134)
<asynchronous suspension>
#1      BaseClient._sendUnstreamed (package:http/src/base_client.dart:93)
<asynchronous suspension>
#2      SpotifyApiBase._getImpl.<anonymous closure> (package:spotify/src/spotify_base.dart:211)
<asynchronous suspension>
#3      SpotifyApiBase._requestWrapper (package:spotify/src/spotify_base.dart:247)
<asynchronous suspension>
#4      SpotifyApiBase._getImpl (package:spotify/src/spotify_base.dart:210)
<asynchronous suspension>
#5      Pages.getPage (package:spotify/src/endpoints/endpoint_paging.dart:253)
<asynchronous suspension>
#6      SinglePages.stream.handlePageAndGetNext (package:spotify/src/endpoints/endpoint_paging.dart:187)
<asynchronous suspension>

----------------------------------------
[2025-06-12 06:38:42.769046]---------------------
DioException [bad response]: This exception was thrown because the response has a status code of 404 and RequestOptions.validateStatus was configured to throw for this status code.
The status code of 404 has the following meaning: "Client error - the request contains bad syntax or cannot be fulfilled"
Read more about status codes at https://developer.mozilla.org/en-US/docs/Web/HTTP/Status
In order to resolve this exception you typically have either to verify and fix your request code or you have to fix the server code.

#0      DioMixin.fetch (package:dio/src/dio_mixin.dart:520)
<asynchronous suspension>
#1      AuthenticationNotifier.generateTotp (package:spotube/provider/authentication/authentication.dart:172)
<asynchronous suspension>
#2      AuthenticationNotifier.credentialsFromCookie (package:spotube/provider/authentication/authentication.dart:238)
<asynchronous suspension>
#3      AuthenticationNotifier.refreshCredentials (package:spotube/provider/authentication/authentication.dart:97)
<asynchronous suspension>
#4      AuthenticationNotifier.build.<anonymous closure> (package:spotube/provider/authentication/authentication.dart:68)
<asynchronous suspension>

----------------------------------------
[2025-06-12 06:38:42.790113]---------------------
OAuth authorization error (invalid_token): The access token expired.
#0      Client.send (package:oauth2/src/client.dart:134)
<asynchronous suspension>
#1      BaseClient._sendUnstreamed (package:http/src/base_client.dart:93)
<asynchronous suspension>
#2      SpotifyApiBase._getImpl.<anonymous closure> (package:spotify/src/spotify_base.dart:211)
<asynchronous suspension>
#3      SpotifyApiBase._requestWrapper (package:spotify/src/spotify_base.dart:247)
<asynchronous suspension>
#4      SpotifyApiBase._getImpl (package:spotify/src/spotify_base.dart:210)
<asynchronous suspension>
#5      Pages.getPage (package:spotify/src/endpoints/endpoint_paging.dart:253)
<asynchronous suspension>
#6      SinglePages.stream.handlePageAndGetNext (package:spotify/src/endpoints/endpoint_paging.dart:187)
<asynchronous suspension>

----------------------------------------
[2025-06-12 06:38:42.922737]---------------------
DioException [bad response]: This exception was thrown because the response has a status code of 401 and RequestOptions.validateStatus was configured to throw for this status code.
The status code of 401 has the following meaning: "Client error - the request contains bad syntax or cannot be fulfilled"
Read more about status codes at https://developer.mozilla.org/en-US/docs/Web/HTTP/Status
In order to resolve this exception you typically have either to verify and fix your request code or you have to fix the server code.

#0      DioMixin.fetch (package:dio/src/dio_mixin.dart:520)
<asynchronous suspension>
#1      CustomSpotifyEndpoints.getFriendActivity (package:spotube/services/custom_spotify_endpoints/spotify_endpoints.dart:113)
<asynchronous suspension>
#2      FutureHandlerProviderElementMixin.handleFuture.<anonymous closure>.<anonymous closure> (package:riverpod/src/async_notifier/base.dart:355)
<asynchronous suspension>

----------------------------------------
[2025-06-12 06:38:42.929738]---------------------
DioException [bad response]: This exception was thrown because the response has a status code of 404 and RequestOptions.validateStatus was configured to throw for this status code.
The status code of 404 has the following meaning: "Client error - the request contains bad syntax or cannot be fulfilled"
Read more about status codes at https://developer.mozilla.org/en-US/docs/Web/HTTP/Status
In order to resolve this exception you typically have either to verify and fix your request code or you have to fix the server code.

#0      DioMixin.fetch (package:dio/src/dio_mixin.dart:520)
<asynchronous suspension>
#1      AuthenticationNotifier.generateTotp (package:spotube/provider/authentication/authentication.dart:172)
<asynchronous suspension>
#2      AuthenticationNotifier.credentialsFromCookie (package:spotube/provider/authentication/authentication.dart:238)
<asynchronous suspension>
#3      AuthenticationNotifier.refreshCredentials (package:spotube/provider/authentication/authentication.dart:97)
<asynchronous suspension>
#4      SpotifyApiWrapper.invoke (package:spotube/provider/spotify/spotify.dart:102)
<asynchronous suspension>
#5      AlbumReleasesNotifier.fetch (package:spotube/provider/spotify/album/releases.dart:35)
<asynchronous suspension>
#6      AlbumReleasesNotifier.build (package:spotube/provider/spotify/album/releases.dart:50)
<asynchronous suspension>
#7      FutureHandlerProviderElementMixin.handleFuture.<anonymous closure>.<anonymous closure> (package:riverpod/src/async_notifier/base.dart:355)
<asynchronous suspension>

----------------------------------------
[2025-06-12 06:38:42.942766]---------------------
DioException [bad response]: This exception was thrown because the response has a status code of 404 and RequestOptions.validateStatus was configured to throw for this status code.
The status code of 404 has the following meaning: "Client error - the request contains bad syntax or cannot be fulfilled"
Read more about status codes at https://developer.mozilla.org/en-US/docs/Web/HTTP/Status
In order to resolve this exception you typically have either to verify and fix your request code or you have to fix the server code.

#0      DioMixin.fetch (package:dio/src/dio_mixin.dart:520)
<asynchronous suspension>
#1      AuthenticationNotifier.generateTotp (package:spotube/provider/authentication/authentication.dart:172)
<asynchronous suspension>
#2      AuthenticationNotifier.credentialsFromCookie (package:spotube/provider/authentication/authentication.dart:238)
<asynchronous suspension>
#3      AuthenticationNotifier.refreshCredentials (package:spotube/provider/authentication/authentication.dart:97)
<asynchronous suspension>
#4      AuthenticationNotifier.build.<anonymous closure> (package:spotube/provider/authentication/authentication.dart:68)
<asynchronous suspension>

----------------------------------------
[2025-06-12 06:38:47.415644]---------------------
type 'Null' is not a subtype of type 'String' in type cast
#0      _$$InvidiousMonitorImplFromJson (package:invidious/src/models/model.g.dart:477)
#1      new _$InvidiousMonitorImpl.fromJson (package:invidious/src/models/model.freezed.dart:5728)
#2      _$InvidiousMonitorFromJson (package:invidious/src/models/model.freezed.dart:5309)
#3      new InvidiousMonitor.fromJson (package:invidious/src/models/responses/instance.dart:128)
#4      _$$InvidiousInstanceDetailsImplFromJson (package:invidious/src/models/model.g.dart:361)
#5      new _$InvidiousInstanceDetailsImpl.fromJson (package:invidious/src/models/model.freezed.dart:4092)
#6      _$InvidiousInstanceDetailsFromJson (package:invidious/src/models/model.freezed.dart:3858)
#7      new InvidiousInstanceDetails.fromJson (package:invidious/src/models/responses/instance.dart:28)
#8      _$$InvidiousInstanceResponseImplFromJson (package:invidious/src/models/model.g.dart:336)
#9      new _$InvidiousInstanceResponseImpl.fromJson (package:invidious/src/models/model.freezed.dart:3792)
#10     _$InvidiousInstanceResponseFromJson (package:invidious/src/models/model.freezed.dart:3668)
#11     new InvidiousInstanceResponse.fromJson (package:invidious/src/models/responses/instance.dart:11)
#12     InstancesEndpoint.instances.<anonymous closure> (package:invidious/src/endpoints/instances.dart:13)
#13     MappedIterable.elementAt (dart:_internal/iterable.dart:402)
#14     ListIterator.moveNext (dart:_internal/iterable.dart:371)
#15     new _GrowableList._ofEfficientLengthIterable (dart:core-patch/growable_array.dart:190)
#16     new _GrowableList.of (dart:core-patch/growable_array.dart:150)
#17     new List.of (dart:core-patch/array_patch.dart:40)
#18     ListIterable.toList (dart:_internal/iterable.dart:224)
#19     InstancesEndpoint.instances (package:invidious/src/endpoints/instances.dart:17)
<asynchronous suspension>
#20     invidiousInstancesProvider.<anonymous closure> (package:spotube/provider/audio_player/sources/invidious_instances_provider.dart:7)
<asynchronous suspension>
#21     FutureHandlerProviderElementMixin.handleFuture.<anonymous closure>.<anonymous closure> (package:riverpod/src/async_notifier/base.dart:355)
<asynchronous suspension>

----------------------------------------

Operating System

Windows

Spotube version

4.0.2

Installation source

GitHub Releases (Binary), Website (spotube.krtirtho.dev)

Additional information

Image

Self grab

  • [ ] I'm ready to work on this issue!

SudiptaSaha20 avatar Jun 12 '25 01:06 SudiptaSaha20

I don't know how or why, but apparently they have to use other APIs now. They may also have to change the name of the app to reflect on that. Do you have any suggestions?

BlastBlaster17 avatar Jun 13 '25 20:06 BlastBlaster17

Please read the massive notice in the README section of this repository.

dmgnr avatar Jun 17 '25 12:06 dmgnr

Seems last.fm API is also got banned. Cannot login with it

chrislxn avatar Jun 22 '25 04:06 chrislxn