Problem with logging in to Nextcloud

Since I updated to Nextcloud 12.0.4, I sometimes have trouble behaviors after logging in.
I succeed in login processing, but immediately return to the login screen. Sometimes an error is displayed. Not every time. The error is “Access is prohibited.” This may be the only hint. It is similar to the behavior when the guest account accesses the administrator URL in WordPress. Login is completed with the second login.
At that time, no error is displayed in the log. It seems that the user has not been determined to have failed the authentication.

Access to my Nextcloud is always the top URL. For example, https://my.nextcloud-domain.com/.
Bookmark is also registered with it.

Is there a workaround for this?
*I can log in with the second time, so it is not a fatal problem.


Nextcloud version (eg, 10.0.2): 12.0.4
Operating system and version (eg, Ubuntu 16.04): CentOS 7.3
Apache or nginx version (eg, Apache 2.4.25): nginx 1.11.10
PHP version (eg, 5.6): 7.1.12
Is this the first time you’ve seen this error?:
Yes
Can you reliably replicate it? (If so, please outline steps):
I only have to try logging in.

I have exactly the same problem, but for me it only happens sometimes, not every single time, and I never see an error. What I also noticed it, that for a short moment, the lock (for https) in the url bar disappears and comes back then.
I also don’t see any errors in the logs.

I will try to investigate further and see if it also happens in Chrome (only remember Safari for now) and if it happens in a specific context.

So, it also happens to me in Chrome.

This is how it looks like in the devtools:
14

The post request to /login:

The request that redirects to /login even though the login was successful:

Nextcloud version (eg, 10.0.2): 12.0.4
Operating system and version (eg, Ubuntu 16.04): Ubuntu 16.04
Apache or nginx version (eg, Apache 2.4.25): Apache 2.4.18
PHP version (eg, 5.6): PHP 7.0.22
Can you reliably replicate it? (If so, please outline steps):
Only sometimes. It doesn’t depend on cookies that were set from a previous visit.

The frequency of this problem has increased.
This can be confirmed in Firefox, Vivaldi, Safari on iOS. Is there any reason to pray that this will be improved in Version 12.0.5?

Hi,

I’m no dev and cannot give any insights about possible bugs in 12.0.4 or fixes in 12.0.5, but I find this issue interesting, because I don’t see it on my server.
Can you see anything else in the logs? Maybe you can increase the log level.
What do:

  • nextcloud log
  • webserver (error) log
  • webserver access log
  • system log

say? Any hints there?
Maybe a timeout issue? I don’t know, maybe due to the spin-up of the hard drives?

The log level is set to 4. I also saw the server’s logs and nextcloud.log, but there were no change in any logs. I have not changed even when I look at the log file update date and time.

I guess this issue may be choosing a browser. It seems likely to happen in Firefox. I don’t use Chrome, so I don’t know it, but it is hard to occur in Vivaldi based on the same Chromium. I experienced about twice in Safari on the iPhone. This may no longer be a coincidence.

Since the time of Nextcloud(12.0.3) Firefox has not changed. The compatibility between 12.0.4 and Firefox is doubtful.
Recently, when accessing with Firefox it surely required login twice. It is the same even if I start Firefox in safe mode.

I have recently become more difficult to use with Firefox. Login succeeds for the second time. I seemed to be able to use Nextcloud and suddenly returned to the login screen more often. What is this forced logout behavior? No errors are displayed in any logs. Firefox(57.0.4) is the same in safe mode.

I may have understood the cause.
Delete the cache from “Delete Recent History” in the history menu of the menu bar. And if I set ‘Remember History’ in Firefox’s privacy setting, I don’t seem to fail login.
To adjust third party cookies, I changed the setting to “Use custom settings for history”. Was Firefox 57 becoming a big difference in its setting?
In order to use it with Firefox as I have setting so far, I seem to be able to log in at once by reloading the login screen (without entering anything).

After all?
This was a problem with Firefox ‘57’. *There is no problem with Firefox 56.

I expected to solve this problem in Nextcloud 13, but it seems not improving.
This issue is limited to Firefox (57/58). It does not occur in Waterfox which is a Firefox compatible browser (substantial Firefox 56).

I tried logging in Nextcloud by installing Firefox 58 on a PC that I can touch. Except for my main PC, there are two PCs. All Windows 10. These are the initial states of Firefox. I have not set anything. It was the same behavior on all PCs. In order to use NC in Firefox, I need to login after pushing the reload button on the login page.

Can you have a look at the browser debug console?
Furthermore please have a look at the network analysis and the runtime analysis in the web developer console of Firefox.
Please look for everything which is taking long or that indicates issues.

Best might be to post it here directly.

I look at Console.

Source map error:
SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data

/core/vendor/jquery/dist/jquery.min.js
/core/vendor/blueimp-md5/js/md5.min.js
/core/vendor/DOMPurify/dist/purify.min.js

When I look at the console, the following error is displayed.
They seem to have errors similar to the following for every element after I can log in to Nextcloud, not just the login screen.

But this is when I can log in. When the first login is rejected, no error is displayed.

I look at the network on first loggin. Especially, it is not time consuming. There are two warning icons. It is index.php/login and apps/files/. The part of “files”. If I change the default setting to mail or calendar, it will be mail or calendar instead of files. That is, it is not limited to files. It seems to be a “303 error” in the first launch application.

Is this problem only for me?
Even on a different PC under my network, PC under a completely different network of others, it will still occur in Firefox 57/58(new profile/safe mode) Mac and Windows. I also experienced it only once in Safari(Mac).