Today, when trying to log in into my nextcloud instance from the Internet with Chrome 70, I got these errors in the console:
core.js?v=6a8b8710-7:7 JQMIGRATE: Migrate is installed, version 1.4.0
merged-template-prepend.js:5295 Uncaught SyntaxError: Invalid or unexpected token
search.js?v=6a8b8710-7:391 Uncaught ReferenceError: OCA is not defined
at search.js?v=6a8b8710-7:391
at search.js?v=6a8b8710-7:392
ca.js?v=6a8b8710-7:1 Uncaught ReferenceError: OC is not defined
at ca.js?v=6a8b8710-7:1
merged-share-backend.js:3697 Uncaught SyntaxError: Invalid or unexpected token
viewer.js?v=6a8b8710-7:15 Uncaught ReferenceError: OC is not defined
at viewer.js?v=6a8b8710-7:15
ca.js?v=6a8b8710-7:1 Uncaught ReferenceError: OC is not defined
at ca.js?v=6a8b8710-7:1
fileinfo.js?v=6a8b8710-7:142 Uncaught ReferenceError: OC is not defined
at fileinfo.js?v=6a8b8710-7:142
client.js?v=6a8b8710-7:931 Uncaught ReferenceError: OC is not defined
at client.js?v=6a8b8710-7:931
contactsmenu.js?v=6a8b8710-7:538 Uncaught ReferenceError: OC is not defined
at contactsmenu.js?v=6a8b8710-7:538
merged-login.js:1 Failed to load resource: net::ERR_CONTENT_LENGTH_MISMATCH
theming?v=7:2 Uncaught ReferenceError: OCA is not defined
at theming?v=7:2
at theming?v=7:12
And cannot login; it looks like the button is not working. Last time I tried (a week ago) it was working OK....does anybody else has the same problem?
I'm on stable channel, 13.0.6snap1 right now.
No issues with Chrome v70.0 on Windows 7, 10, or OS 10.14.
However, server is running 14.0.0 from 14/candidate channel.
Well, I just realized is not a problem with Chrome 70, but with the snap. It seems that I'm getting broken JS files from the server.
Do you get broken JS files on all browsers, though?
Yes, for all browsers that I tested @kyrofa
Its quite strange, as it seems to work OK when I move to another revision/channel of the snap, but when I come back to 8973 I does not really work OK...maybe something rotted between reverts?
Ah, I wonder if this is indeed because you do so much testing/reverting etc. Basically, Nextcloud puts the JS and CSS cache in the datadir, which as you know is in $SNAP_COMMON, and thus isn't included in a revert. Try clearing out those caches:
$ sudo rm -r /var/snap/nextcloud/common/nextcloud/data/appdata_*/css/* /var/snap/nextcloud/common/nextcloud/data/appdata_*/js/*
Then re-generate:
$ sudo nextcloud.occ files:scan-app-data
Yep, that was it! This should be in the wiki as a tip, I will try to add it!
Thans @kyrofa !
I agree, it should. Definitely something to keep in mind as you switch revs back and forth. Maybe during Christmas vacation I'll look into proposing a patch to put that cache in a place defined by an environment variable instead of the datadir, which would allow us to put them in $SNAP_DATA instead of $SNAP_COMMON. I say that, only to remember how much pain CSS and JS caching has caused us in the past, and then shudder in fear :stuck_out_tongue: .
I think I was hit by this again after reverting from v17 to v16, but I don't seem to be able to solve it now. This is what I see on that directory:
root@ubuntu:/var/snap/nextcloud/common/nextcloud# ls
tmp
Any ideas @kyrofa ?
OK, I found out why it wasn't working: I now have all the nextcloud data on an external drive, so the cache it's there.
Just for my own future use, this is what I needed to do this time:
$ sudo su
$ rm -r /media/nextcloud-external-3.1/data/appdata_*/css/* /media/nextcloud-external-3.1/data/appdata_*/js/*
$ exit
$ sudo nextcloud.occ files:scan-app-data
Most helpful comment
Ah, I wonder if this is indeed because you do so much testing/reverting etc. Basically, Nextcloud puts the JS and CSS cache in the datadir, which as you know is in
$SNAP_COMMON, and thus isn't included in a revert. Try clearing out those caches:Then re-generate: