nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
26.64k stars 3.99k forks source link

[Bug]: Temporary error Please try again During Login #43301

Open AndyXheli opened 7 months ago

AndyXheli commented 7 months ago

⚠️ This issue respects the following points: ⚠️

Bug description

Every time i close the browser and go to nextcloud server url i get propped to singed in and after trying to sign in i get below error

image

Steps to reproduce

  1. Sign into nextcloud via chrome
  2. Close out chrome
  3. Open Chrome
  4. Go to Nextcloud Users is singed off automatically and should not be
  5. Enter correct username and password
  6. Then get Temporary error Please try again.
  7. Enter correct username and password
  8. Signe me in

Expected behavior

Should not sing user out and should be see this error

never had this issue on NC 27 ever since i upgrade to NC 28

Installation method

None

Nextcloud Server version

28

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.3

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. 22 to 23)

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

What user-backends are you using?

Configuration report

"system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "REMOVED SENSITIVE VALUE"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "28.0.2.5",
        "overwrite.cli.url": "REMOVED SENSITIVE VALUE",
        "htaccess.RewriteBase": "\/",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "simpleSignUpLink.shown": false,
        "skeletondirectory": "",
        "default_locale": "en_US",
        "default_phone_region": "US",
        "allow_local_remote_servers": true,
        "ffmpeg": "\/usr\/bin\/ffmpeg",
        "preview_max_memory": 1280,
        "enabledPreviewProviders": [
            "OC\\Preview\\TXT",
            "OC\\Preview\\MarkDown",
            "OC\\Preview\\PDF",
            "OC\\Preview\\Image",
            "OC\\Preview\\Photoshop",
            "OC\\Preview\\TIFF",
            "OC\\Preview\\SVG",
            "OC\\Preview\\Font",
            "OC\\Preview\\MP3",
            "OC\\Preview\\Movie",
            "OC\\Preview\\MKV",
            "OC\\Preview\\MP4",
            "OC\\Preview\\AVI",
            "OC\\Preview\\MOV",
            "OC\\Preview\\HEIC",
            "OC\\Preview\\OpenDocument",
            "OC\\Preview\\MSOfficeDoc"
        ],
        "mail_smtpmode": "smtp",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_sendmailmode": "smtp",
        "mail_smtpport": "587",
        "mail_smtpauthtype": "LOGIN",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "log.condition": {
            "apps": [
                "admin_audit"
            ]
        },
        "loglevel": 2,
        "logtimezone": "America\/Chicago",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 6379
        },
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "maintenance": false,
        "maintenance_window_start": 1,
        "twofactor_enforced": "true",
        "twofactor_enforced_groups": [],
        "twofactor_enforced_excluded_groups": [],
        "theme": "",
        "mail_smtpauth": 1,
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "updater.release.channel": "stable",
        "memories.exiftool": "\/var\/www\/nextcloud\/apps\/memories\/bin-ext\/exiftool-amd64-glibc",
        "memories.vod.path": "\/var\/www\/nextcloud\/apps\/memories\/bin-ext\/go-vod-amd64",
        "memories.vod.ffmpeg": "\/usr\/bin\/ffmpeg",
        "memories.vod.ffprobe": "\/usr\/bin\/ffprobe",
        "memories.gis_type": 1,
        "defaultapp": "dashboard,files,memories",
        "updater.secret": "***REMOVED SENSITIVE VALUE***"
    }
}

List of activated Apps

Enabled:
  - activity: 2.20.0
  - admin_audit: 1.18.0
  - bruteforcesettings: 2.8.0
  - cloud_federation_api: 1.11.0
  - comments: 1.18.0
  - contactsinteraction: 1.9.0
  - dashboard: 7.8.0
  - dav: 1.29.1
  - federatedfilesharing: 1.18.0
  - federation: 1.18.0
  - files: 2.0.0
  - files_external: 1.20.0
  - files_pdfviewer: 2.9.0
  - files_reminders: 1.1.0
  - files_sharing: 1.20.0
  - files_trashbin: 1.18.0
  - files_versions: 1.21.0
  - firstrunwizard: 2.17.0
  - impersonate: 1.15.0
  - integration_youtube: 0.1.5
  - logreader: 2.13.0
  - lookup_server_connector: 1.16.0
  - memories: 6.2.2
  - nextcloud_announcements: 1.17.0
  - notifications: 2.16.0
  - notify_push: 0.6.9
  - oauth2: 1.16.3
  - password_policy: 1.18.0
  - photos: 2.4.0
  - previewgenerator: 5.4.0
  - privacy: 1.12.0
  - provisioning_api: 1.18.0
  - recognize: 6.1.0-beta.2
  - recommendations: 2.0.0
  - related_resources: 1.3.0
  - richdocuments: 8.3.1
  - sendent: 2.0.5
  - serverinfo: 1.18.0
  - settings: 1.10.1
  - sharebymail: 1.18.0
  - spreed: 18.0.3
  - support: 1.11.0
  - survey_client: 1.16.0
  - suspicious_login: 6.0.0
  - systemtags: 1.18.0
  - text: 3.9.1
  - theming: 2.3.0
  - theming_customcss: 1.15.0
  - twofactor_admin: 4.4.0
  - twofactor_backupcodes: 1.17.0
  - twofactor_email: 2.7.4
  - twofactor_nextcloud_notification: 3.8.0
  - twofactor_totp: 10.0.0-beta.2
  - updatenotification: 1.18.0
  - user_status: 1.8.1
  - viewer: 2.2.0
  - weather_status: 1.8.0
  - workflowengine: 2.10.0
Disabled:
  - circles: 28.0.0-dev (installed 27.0.1)
  - encryption: 2.16.0
  - user_ldap: 1.19.0

Nextcloud Signing status

No response

Nextcloud Logs

No response

Additional info

No response

solracsf commented 7 months ago

This is due to https://github.com/nextcloud/server/pull/40799

MattiaMarchiorato commented 6 months ago

Hello, is this resolved? We still have this problem on 28.0.3

Thanks

MM

chritd commented 6 months ago

we have the same issue but worse. some users can not login at all and get the error-message "Temporary error" repeatedly. It's randomly some ldap and some nextcloud generated users get this behavior. In the admin interface we can not switch between the different ldap configs as it gets stuck in "testing configuration ..." From the CL with occ ldap:show-config it shows that the 1st configuration has "no name" also showing in the database the fields just starting with "ldap". The second ldap configuration then has configuration name "s01" and also shows in the database with "s01ldap". the 3rd with s02, etc. Don't know if thats maybe the issue and is an error in the upgrade transition and the first config should have s01 and so forth

when I try impersonate as admin from user administration with affected users I get "Could not impersonate user - CSRF check failed"

nerozero commented 6 months ago

Experiencing similar error on Nextcloud 27.1.6

moreamazingnick commented 6 months ago

I got it working by

after the I could login again using Chrome

MattiaMarchiorato commented 6 months ago

@moreamazingnick that is normal, if is a CSRF tocken bug and you reload the page it will works.

chritd commented 6 months ago

The CSRF issue seems not to be the problem. Or above solution has no effect. We still cannot log in local users or ldap users. No specific errors in nextcloud log, reverse proxy nginx or ldap logs Problem persists on all browsers: Safari, Chrome, Firefox

romanbatt commented 5 months ago

I'm also having this issue on version 27.1.7.

Clearing my cookies and cache did not fix things.

tvlpirb commented 5 months ago

Can confirm this issue. Clearing cookies helps to log in and reach dashboard. However, viewing files and memories causes me to be logged out again with a CSRF token error show sometimes.

chritd commented 5 months ago

We installed a complete new instance to get it resolved and imported the database__mobile On Mar 18, 2024, at 10:16, Talhah Peerbhai @.***> wrote: Can confirm this issue. Clearing cookies helps to log in and reach dashboard. However, viewing files and memories causes me to be logged out again with a CSRF token error show sometimes.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

Ostantia commented 5 months ago

I have also this issue (using snap version "nextcloud 27.1.7snap1 40887 latest/stable nextcloud✓ -")

TheoBinar commented 5 months ago

I have the exact same problem. Using docker compose and I am not even to get to the dashboard page. For some reason, mobile app works perfectly.

JulesWerne commented 5 months ago

I have the same problem. Running 28.0.3 in a container on Proxmox.

Had it a few days ago, but somehow it worked again. Now not anymore. Sometimes after reloading the page I reach the "enter TOTP site". After that it brings me back to the start and to the temporary error again.

TheoBinar commented 5 months ago

I have the same problem. Running 28.0.3 in a container on Proxmox.

Had it a few days ago, but somehow it worked again. Now not anymore.

Sometimes after reloading the page I reach the "enter TOTP site". After that it brings me back to the start and to the temporary error again.

Yes, exactly the same problem. The weirdest thing is, sometimes it works, sometimes not. If you find out the solution, please tell us.

TobySegar commented 5 months ago

Try disabling collabora office plugin if you are able to get in.

andypmuc commented 5 months ago

Also, when I disable Nextcloud Office and Collabora Plugin it's working

jr0w3 commented 5 months ago

Same issue with 28.0.4 without office or any Addon app. Happening with latest chrome or brave from desktop and Android.

JulesWerne commented 5 months ago

I don't use Nextcloud Office or the Collabora Plugin either. Error persists on Windows and MacOS (Brave, LibreWolf and Safari).

jackkerouac commented 5 months ago

Same issue here. No amount of cache clearing, cookie cleaning, etc. will allow me in. Mobile app works fine, however. It only started today, before that everything was fine.

Getting the following error in the logs:

TypeError: OCA\UserStatus\Controller\UserStatusController::__construct(): Argument #3 ($userId) must be of type string, null given at /var/www/html/apps/user_status/lib/Controller/UserStatusController.php#54

unnilennium commented 5 months ago

same here since upgrade from 27 to 28.0.4. using ldap connector for user database

nicoagr commented 4 months ago

Same thing happenning here, started happening when upgrading from 28.0.3 to 28.0.4. Nextcloud direct install

hoonlight commented 4 months ago

It happens more frequently with some users, and a full reinstall doesn't fix it. I don't use Collabora, Office.

chritd commented 4 months ago

We got it solved by installing a complete new empty instance without proxy and then importing the database.

We never could find out what the actual reason for this was. __ mobile

On Apr 18, 2024, at 5:18 PM, Ki Hoon Kim @.***> wrote:

It happens more frequently with some users, and a full reinstall doesn't fix it. I don't use Collabora, Office.

— Reply to this email directly, view it on GitHub https://github.com/nextcloud/server/issues/43301#issuecomment-2065522976, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATB4T2BBBH6FASC26EEFPITY6BPEXAVCNFSM6AAAAABCXBUQMCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANRVGUZDEOJXGY. You are receiving this because you commented.

sbe-arg commented 4 months ago

Everytime this happens to me I freak out a bit and the easier solution i found is to login via vpn or change my public ip if I'm login remotely.

I assume the is a bug somewhere in the login ip throttle or suspicious login checks but I can login everytime changing the ip.

Funny story is that there are no identifiable events logged when this happens.

Hope it helps.

nicoagr commented 4 months ago

Same thing happenning here, started happening when upgrading from 28.0.3 to 28.0.4. Nextcloud direct install

Got it working. It didn't come to me immediately as I was checking nextcloud's logs, not the PHP error logs. The issue was there. I will describe an specific error here, but yours could be different. Recently I modified the "upload_max_filesize" and "post_max_size" settings in my php.ini. The thing is, I set those settings to "2G", so 2 gigabytes of maximum post size. But php didn't recognize that "G" so it setted the maximum post size to "2" bytes. Indeed, php was blocking my post requests because of its size. So, as a solution, if you want to set the "upload_max_filesize" and "post_max_size" settings do it in megabytes - as "2000M" instead of "2G". When php rejects post requests, nextcloud will give an ambiguous error.

ilyaspvl commented 4 months ago

"2000M" instead of "2G".

That works! Thanks a lot! ))

quangyen commented 4 months ago

I got it working by

  • opening the developer settings in chrome
  • reload the page
  • right click on ...login... in network
  • clear browser cache
  • clear browser cookie
  • reload the page

after the I could login again using Chrome

Fast test with the solution above. I open new incognito window, and login => It work, OMG, thank @moreamazingnick

aminnairi commented 3 months ago

I had this issue recently, and when looking at the logs in my installation, I could see that there was en error with the encryption/decryption of the tokens.

I think this error had a relation to my recent change in my installation. I had to increase the size of my VPS, since I was using the built-in VPS storage, and had to allow more spaces, I bought a Volume Block Storage and migrated all my data from the VPS to the volume using Digital Ocean.

I think the permissions got all mixed up when doing so, so I initially fixed the permissions by issueing the following command.

sudo chown -R www-data:www-data /var/www/html/*

But in the mean time, I tried to update Nextcloud to version 29.0.1, and this is where the issue started.

Turns out, for some reasons, there was multiple authentication tokens for the same device. Looks like a unhandled case in my opinion.

After deleting all authentication tokens, and login again, everything works as expected.

In order to do that using Nextcloud 29.0.1, you can use the following commands.

./occ user:list # list users
./occ user:auth-tokens:list username # list all tokens for this user
./occ user:auth-tokens:delete username 1 # delete token of id 1 for user username

Unfortunately, if you have many authentication tokens for one user, you have to do this by hand for each and every one of them.

Hope that helps!

pabloeisenhut commented 3 months ago

I was able to solve the problem by disabling caching on my reverse proxy (Nginx).

grollek commented 3 months ago

I deleted all entries in table [oc_authtoken] this forced me to log in on every device once again and also resolved CSRF check fail on logout.

NC 29.0.2 (lscr.io/linuxserver/nextcloud) | Mysql 11.4.2-MariaDB-ubu2404 Dockers on Unraid

Benjamin-Watson0 commented 2 months ago

I was able to solve the problem by disabling caching on my reverse proxy (Nginx proxy manger). I believe that is the right way.

DCCInterstellar commented 2 months ago

I was having this same issue, until a couple of people commented before me to disable caching on my reverse proxy (Nginx Proxy Manager). I am no longer getting that error anymore when I log in or logging out.

ivanjx commented 2 months ago

@pabloeisenhut is this the correct config for the nginx? thanks

proxy_cache off;
expires off;
pabloeisenhut commented 2 months ago

@pabloeisenhut is this the correct config for the nginx? thanks

proxy_cache off;
expires off;

I have deactivated the Cache Assets switch in Nginx Proxy Manager.

With Nginx it should be the following configuration, as far as I understand it.

proxy_no_cache 1;
proxy_cache_bypass 1;
proxy_cache off;

https://github.com/NginxProxyManager/nginx-proxy-manager/issues/389#issuecomment-895485154

Hope I could help : )

ivanjx commented 1 month ago

so apparently i only see this problem on my ios safari browser. even after successfully logged in, it will log me out after a few days.