Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Getting Unexpected error: Invalid response 401 in Files app #49187

Open
4 of 8 tasks
ostasevych opened this issue Nov 10, 2024 · 5 comments · May be fixed by #49208
Open
4 of 8 tasks

[Bug]: Getting Unexpected error: Invalid response 401 in Files app #49187

ostasevych opened this issue Nov 10, 2024 · 5 comments · May be fixed by #49208

Comments

@ostasevych
Copy link

⚠️ This issue respects the following points: ⚠️

Bug description

After upgrade from 28 to 29 I've started to get Unexpected error: Invalid response 401 in Files app when trying to open any folder in Files webUI after leaving the webpage for a while. Clicking on Retry is not helpful. The only way is to manually reload the webpage.
Image

Steps to reproduce

  1. Open webUI files
  2. Go somewhere
  3. Leave it for a while: 3-6-12 hours
  4. Click on any folder in the Files app
  5. Observe Unexpected error: Invalid response 401

Expected behavior

The webpage should transparently renew without manual intrusion of a user, when a user comes back to it, similarly to Google Drive or any other cloud solution.

Nextcloud Server version

29

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.2

Web server

Apache (supported)

Database engine version

MariaDB

Is this bug present after an update or on a fresh install?

Upgraded to a MAJOR version (ex. 28 to 29)

Are you using the Nextcloud Server Encryption module?

None

What user-backends are you using?

  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other

Configuration report

List of activated Apps

Nextcloud Signing status

Nextcloud Logs

Additional info

No response

@ostasevych ostasevych added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Nov 10, 2024
@joshtrichards
Copy link
Member

joshtrichards commented Nov 10, 2024

I've never encountered this across numerous deployments. You'll need to do a bit more digging / give us more more details to help sort out why you're encountering this.

What's the request that is failing in your browser inspector?
What about your config, such as session/logout parameters?
Reverse proxy?
etc.

@ostasevych
Copy link
Author

I've never encountered this across numerous deployments. You'll need to do a bit more digging / give us more more details to help sort out why you're encountering this.

What's the request that is failing in your browser inspector? What about your config, such as session/logout parameters? Reverse proxy? etc.

I am facing with this issue every time after certain delay.
No reverse proxy, working behind VPN.

# cat config.php
<?php
$CONFIG = array (
  'instanceid' => '****',
  'passwordsalt' => '****',
  'secret' => '*****',
  'trusted_domains' =>
  array (
    0 => 'mycloud.tld',
    1 => 'office.mycloud.tld,
  ),
  'overwrite.cli.url' => 'https://mycloud.tld',
  'datadirectory' => '/nc/data,
  'dbtype' => 'mysql',
  'version' => '29.0.9.2',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'server',
  'dbpassword' => '****',
  'installed' => true,
  'mail_smtpmode' => 'smtp',
  'mail_sendmailmode' => 'smtp',
  'mail_domain' => 'mail.com',
  'mail_send_plaintext_only' => false,
  'default_phone_region' => '**',
  'force_locale' => '**',
  'force_language' => '**',
  'allow_user_to_change_display_name' => false,
  'auth.webauthn.enabled' => false,
  'remember_login_cookie_lifetime' => 1296000,
  'session_lifetime' => 21600,
  'session_relaxed_expiry' => false,
  'session_keepalive' => false,
  'auto_logout' => false,
  'skeletondirectory' => '/nc/data/skeleton',
  'maintenance' => false,
  'maintenance_window_start' => 23,
  'sort_groups_by_name' => true,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'redis' =>
  array (
    'host' => '127.0.0.1',
    'port' => 6379,
  ),
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'app_install_overwrite' =>
  array (
    0 => 'files_fulltextsearch',
    1 => 'fulltextsearch_elasticsearch',
    2 => 'fulltextsearch',
    3 => 'files_fulltextsearch_tesseract',
    4 => 'twofactor_gateway',
    5 => 'files_rightclick',
    6 => 'twofactor_reminder',
  ),
  'activity_use_cached_mountpoints' => true,
  'mail_from_address' => 'cloud',
  'mail_smtpsecure' => 'ssl',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpauth' => 1,
  'mail_smtphost' => 'smtp.mail.com',
  'mail_smtpport' => '465',
  'mail_smtpname' => 'mycloud',
  'mail_smtppassword' => '*****',
  'theme' => '',
  'logtype' => 'file',
  'logfile' => '/nc/data/nextcloud.log',
  'loglevel' => 2,
  'loglevel_frontend' => 2,
  'log_rotate_size' => 104857600,
  'trashbin_retention_obligation' => 'auto, 30',
  'logtimezone' => 'Europe/***',
  'filesystem_check_changes' => 0,
  'profile.enabled' => false,
  'enable_previews' => true,
  'preview_format' => 'webp',
  'preview_max_x' => '2048',
  'preview_max_y' => '2048',
  'enabledPreviewProviders' =>
  array (
    0 => 'OC\\Preview\\Image',
    1 => 'OC\\Preview\\PNG',
    2 => 'OC\\Preview\\JPEG',
    3 => 'OC\\Preview\\WebP',
  ),
  'jpeg_quality' => '75',
  'preview_concurrency_new' => '1',
  'twofactor_enforced' => 'true',
  'allow_local_remote_servers' => true,
  'has_internet_connection' => true,
  'defaultapp' => '',
);

@susnux
Copy link
Contributor

susnux commented Nov 11, 2024

This sounds like the csrf token is not updated.
Have you tried to clear all browser cache after the update?

Could you send the browser dev tools outputs?

@joshtrichards
Copy link
Member

'session_keepalive' => false,

Likely why. In which case this seems expected behavior based on your configuration.

@susnux
Copy link
Contributor

susnux commented Nov 11, 2024

Likely why. In which case this seems expected behavior based on your configuration.

Makes sense!

@susnux susnux added 3. to review Waiting for reviews and removed needs info 0. Needs triage Pending check for reproducibility or if it fits our roadmap labels Nov 11, 2024
@susnux susnux self-assigned this Nov 11, 2024
@susnux susnux linked a pull request Nov 11, 2024 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants