astubenbord / paperless-mobile

An (almost) fully fledged mobile paperless client.
GNU General Public License v3.0
739 stars 37 forks source link

[Bug]: Unable to login to Paperless Mobile (only) ! #391

Closed mrsumanbiswas closed 9 months ago

mrsumanbiswas commented 9 months ago

What happened?

Server version: docker-compose.postgres-tika.yml Mobile app version: 3.2.1 (from play store)

Actual error's screenshot

Screenshot_20240228_175805

Some logs

Paperless Mobile:

2024-02-28 17:57:29.267 DEBUG   --- [      AuthenticationCubit] - restoreSession           : There is nothing to restore.
2024-02-28 17:57:29.270 INFO    --- [                         ] -                          : Setting refresh rate to 60.000003814697266
2024-02-28 17:58:00.232 DEBUG   --- [      AuthenticationCubit] - login                    : Trying to log in username@pa***in...
2024-02-28 17:58:00.233 DEBUG   --- [      AuthenticationCubit] - _addUser                 : Adding new user username@pa***in..
2024-02-28 17:58:00.233 DEBUG   --- [      AuthenticationCubit] - _addUser                 : Fetching bearer token from the server...
2024-02-28 17:58:01.183 DEBUG   --- [      AuthenticationCubit] - _addUser                 : Bearer token successfully retrieved.
2024-02-28 17:58:01.184 DEBUG   --- [      AuthenticationCubit] - _getApiVersion           : Trying to fetch API version...
2024-02-28 17:58:01.267 WARNING --- [      AuthenticationCubit] - _getApiVersion           : The server is running a newer API version (5) than the app supports (v3), falling back to latest supported version (v3). Warning: This might lead to unexpected behavior!
2024-02-28 17:58:01.267 DEBUG   --- [      AuthenticationCubit] - _getApiVersion           : Successfully retrieved API version (3).
2024-02-28 17:58:01.267 DEBUG   --- [      AuthenticationCubit] - _addUser                 : Trying to fetch remote paperless user for username@pa***in.
2024-02-28 18:12:29.678 DEBUG   --- [      AuthenticationCubit] - restoreSession           : Trying to restore previous session...
2024-02-28 18:12:29.679 DEBUG   --- [      AuthenticationCubit] - restoreSession           : There is nothing to restore.
2024-02-28 18:12:29.681 INFO    --- [                         ] -                          : Setting refresh rate to 60.0
2024-02-28 18:18:32.767 DEBUG   --- [      AuthenticationCubit] - restoreSession           : Trying to restore previous session...
2024-02-28 18:18:32.767 DEBUG   --- [      AuthenticationCubit] - restoreSession           : There is nothing to restore.
2024-02-28 18:18:32.769 INFO    --- [                         ] -                          : Setting refresh rate to 60.0
2024-02-28 18:19:03.682 DEBUG   --- [      AuthenticationCubit] - login                    : Trying to log in username@pa***in...
2024-02-28 18:19:03.682 DEBUG   --- [      AuthenticationCubit] - _addUser                 : Adding new user username@pa***in..
2024-02-28 18:19:03.683 DEBUG   --- [      AuthenticationCubit] - _addUser                 : Fetching bearer token from the server...
2024-02-28 18:19:05.264 DEBUG   --- [      AuthenticationCubit] - _addUser                 : Bearer token successfully retrieved.
2024-02-28 18:19:05.265 DEBUG   --- [      AuthenticationCubit] - _getApiVersion           : Trying to fetch API version...
2024-02-28 18:19:05.514 WARNING --- [      AuthenticationCubit] - _getApiVersion           : The server is running a newer API version (5) than the app supports (v3), falling back to latest supported version (v3). Warning: This might lead to unexpected behavior!
2024-02-28 18:19:05.515 DEBUG   --- [      AuthenticationCubit] - _getApiVersion           : Successfully retrieved API version (3).
2024-02-28 18:19:05.515 DEBUG   --- [      AuthenticationCubit] - _addUser                 : Trying to fetch remote paperless user for username@pa***in.
2024-02-28 18:35:32.062 DEBUG   --- [      AuthenticationCubit] - restoreSession           : Trying to restore previous session...
2024-02-28 18:35:32.062 DEBUG   --- [      AuthenticationCubit] - restoreSession           : There is nothing to restore.
2024-02-28 18:35:32.064 INFO    --- [                         ] -                          : Setting refresh rate to 60.0
2024-02-28 18:36:02.549 DEBUG   --- [      AuthenticationCubit] - login                    : Trying to log in username@19***75...
2024-02-28 18:36:02.550 DEBUG   --- [      AuthenticationCubit] - _addUser                 : Adding new user username@19***75..
2024-02-28 18:36:02.550 DEBUG   --- [      AuthenticationCubit] - _addUser                 : Fetching bearer token from the server...
2024-02-28 18:36:03.332 DEBUG   --- [      AuthenticationCubit] - _addUser                 : Bearer token successfully retrieved.
2024-02-28 18:36:03.333 DEBUG   --- [      AuthenticationCubit] - _getApiVersion           : Trying to fetch API version...
2024-02-28 18:36:03.374 WARNING --- [      AuthenticationCubit] - _getApiVersion           : The server is running a newer API version (5) than the app supports (v3), falling back to latest supported version (v3). Warning: This might lead to unexpected behavior!
2024-02-28 18:36:03.374 DEBUG   --- [      AuthenticationCubit] - _getApiVersion           : Successfully retrieved API version (3).
2024-02-28 18:36:03.374 DEBUG   --- [      AuthenticationCubit] - _addUser                 : Trying to fetch remote paperless user for username@19***75.

server log

[server time (same as mobile)] [WARNING] [django.request] Forbidden: /api/users/4/

additional Information

Steps to reproduce

  1. Opened the app.
  2. Entered the server address.
  3. Entered the correct login credentials.
  4. Got stuck in a loop and encountered the error: "Instance of 'PaperlessUnauthorizedException'."

Log output from the app

2024-02-28 17:57:29.267 DEBUG   --- [      AuthenticationCubit] - restoreSession           : Trying to restore previous session...
2024-02-28 17:57:29.267 DEBUG   --- [      AuthenticationCubit] - restoreSession           : There is nothing to restore.
2024-02-28 17:57:29.270 INFO    --- [                         ] -                          : Setting refresh rate to 60.000003814697266
2024-02-28 17:58:00.232 DEBUG   --- [      AuthenticationCubit] - login                    : Trying to log in username@pa***in...
2024-02-28 17:58:00.233 DEBUG   --- [      AuthenticationCubit] - _addUser                 : Adding new user username@pa***in..
2024-02-28 17:58:00.233 DEBUG   --- [      AuthenticationCubit] - _addUser                 : Fetching bearer token from the server...
2024-02-28 17:58:01.183 DEBUG   --- [      AuthenticationCubit] - _addUser                 : Bearer token successfully retrieved.
2024-02-28 17:58:01.184 DEBUG   --- [      AuthenticationCubit] - _getApiVersion           : Trying to fetch API version...
2024-02-28 17:58:01.267 WARNING --- [      AuthenticationCubit] - _getApiVersion           : The server is running a newer API version (5) than the app supports (v3), falling back to latest supported version (v3). Warning: This might lead to unexpected behavior!
2024-02-28 17:58:01.267 DEBUG   --- [      AuthenticationCubit] - _getApiVersion           : Successfully retrieved API version (3).
2024-02-28 17:58:01.267 DEBUG   --- [      AuthenticationCubit] - _addUser                 : Trying to fetch remote paperless user for username@pa***in.
2024-02-28 18:12:29.678 DEBUG   --- [      AuthenticationCubit] - restoreSession           : Trying to restore previous session...
2024-02-28 18:12:29.679 DEBUG   --- [      AuthenticationCubit] - restoreSession           : There is nothing to restore.
2024-02-28 18:12:29.681 INFO    --- [                         ] -                          : Setting refresh rate to 60.0
2024-02-28 18:18:32.767 DEBUG   --- [      AuthenticationCubit] - restoreSession           : Trying to restore previous session...
2024-02-28 18:18:32.767 DEBUG   --- [      AuthenticationCubit] - restoreSession           : There is nothing to restore.
2024-02-28 18:18:32.769 INFO    --- [                         ] -                          : Setting refresh rate to 60.0
2024-02-28 18:19:03.682 DEBUG   --- [      AuthenticationCubit] - login                    : Trying to log in username@pa***in...
2024-02-28 18:19:03.682 DEBUG   --- [      AuthenticationCubit] - _addUser                 : Adding new user username@pa***in..
2024-02-28 18:19:03.683 DEBUG   --- [      AuthenticationCubit] - _addUser                 : Fetching bearer token from the server...
2024-02-28 18:19:05.264 DEBUG   --- [      AuthenticationCubit] - _addUser                 : Bearer token successfully retrieved.
2024-02-28 18:19:05.265 DEBUG   --- [      AuthenticationCubit] - _getApiVersion           : Trying to fetch API version...
2024-02-28 18:19:05.514 WARNING --- [      AuthenticationCubit] - _getApiVersion           : The server is running a newer API version (5) than the app supports (v3), falling back to latest supported version (v3). Warning: This might lead to unexpected behavior!
2024-02-28 18:19:05.515 DEBUG   --- [      AuthenticationCubit] - _getApiVersion           : Successfully retrieved API version (3).
2024-02-28 18:19:05.515 DEBUG   --- [      AuthenticationCubit] - _addUser                 : Trying to fetch remote paperless user for username@pa***in.
2024-02-28 18:35:32.062 DEBUG   --- [      AuthenticationCubit] - restoreSession           : Trying to restore previous session...
2024-02-28 18:35:32.062 DEBUG   --- [      AuthenticationCubit] - restoreSession           : There is nothing to restore.
2024-02-28 18:35:32.064 INFO    --- [                         ] -                          : Setting refresh rate to 60.0
2024-02-28 18:36:02.549 DEBUG   --- [      AuthenticationCubit] - login                    : Trying to log in username@19***75...
2024-02-28 18:36:02.550 DEBUG   --- [      AuthenticationCubit] - _addUser                 : Adding new user username@19***75..
2024-02-28 18:36:02.550 DEBUG   --- [      AuthenticationCubit] - _addUser                 : Fetching bearer token from the server...
2024-02-28 18:36:03.332 DEBUG   --- [      AuthenticationCubit] - _addUser                 : Bearer token successfully retrieved.
2024-02-28 18:36:03.333 DEBUG   --- [      AuthenticationCubit] - _getApiVersion           : Trying to fetch API version...
2024-02-28 18:36:03.374 WARNING --- [      AuthenticationCubit] - _getApiVersion           : The server is running a newer API version (5) than the app supports (v3), falling back to latest supported version (v3). Warning: This might lead to unexpected behavior!
2024-02-28 18:36:03.374 DEBUG   --- [      AuthenticationCubit] - _getApiVersion           : Successfully retrieved API version (3).
2024-02-28 18:36:03.374 DEBUG   --- [      AuthenticationCubit] - _addUser                 : Trying to fetch remote paperless user for username@19***75.

Screenshots

Screenshot_20240228_175805

Paperless-ng*x Version

latest

Paperless-Mobile Version

3.2.1

Device

Samsung S20 FE 5G

Operating System Version

Android 13

Device Locale

India

Selected Locale

English (US)

Additional Context

astubenbord commented 9 months ago

Please make sure to add the permissions to your account as described on the page where you enter your credentials. Is this user an admin?

mrsumanbiswas commented 9 months ago

Thank you for your prompt response! I'm delighted to report that the issue was resolved when I switched to an admin account. Your app is incredibly useful, and it has inspired me to delve deeper into learning and contributing.

Regarding the permissions required for non-admin users to access the app, could you kindly provide specific details on the necessary permissions? Your guidance will ensure that all users can make the most out of the app.

Looking forward to your assistance on this matter!