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

nextcloud snappymail does not load after upgrade to 2.37.0 #1703

Closed
HenkVirtual opened this issue Aug 12, 2024 · 12 comments
Closed

nextcloud snappymail does not load after upgrade to 2.37.0 #1703

HenkVirtual opened this issue Aug 12, 2024 · 12 comments
Labels
bug Something isn't working Nextcloud

Comments

@HenkVirtual
Copy link

error as below

Please refresh the page and try again.SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data

@JonTabor
Copy link

I just ran across this as well. I can't seem to come up with anything useful when enabling debug logging, either.

Here's the exact error I get:
An error occurred.
Please refresh the page and try again.
SyntaxError: Unexpected token '<', "<!DOCTYPE "... is not valid JSON

So far I have been unable to track this down. Usually I see this when something returns HTML when it was expecting JSON, but so far I haven't found anything useful.

@the-djmaze the-djmaze added external Issue is outside our code workaround Nextcloud labels Aug 12, 2024
@the-djmaze
Copy link
Owner

the-djmaze commented Aug 12, 2024

Nextcloud has a bad habbit of failing update tasks.
Nextcloud keeps switching between apps and custom-apps and there's only one thing you can do:

Go to /nextcloud/settings/admin/additional
Then go back to /nextcloud/apps/snappymail/ or /nextcloud/custom_apps/snappymail/

Nextcloud bugs are outside our development scope and this specific issue is already reported here several times and i can't reproduce them in my Nextcloud instances.

@the-djmaze
Copy link
Owner

An error occurred. Please refresh the page and try again. SyntaxError: Unexpected token '<', "<!DOCTYPE "... is not valid JSON_

Correct!
The file does not exist on that location, see your developer tools network requests for the "404 Not Found" mess that Nextcloud creates.

@HenkVirtual
Copy link
Author

admin/additional

unfortunately my nc 29. is generating the same error on the snappy admin page, even after server restart;
An error occurred.
Please refresh the page and try again.SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data

@JonTabor
Copy link

An error occurred. Please refresh the page and try again. SyntaxError: Unexpected token '<', "<!DOCTYPE "... is not valid JSON_

Correct! The file does not exist on that location, see your developer tools network requests for the "404 Not Found" mess that Nextcloud creates.

Yeah, I was looking for 404s in the dev tools, but there are none. Just a long string of 200s. The workaround above doesn't work for me, so I'm thinking this is a different issue.

@HenkVirtual
Copy link
Author

mm I removed snappymail from the apps and installed it again, but I am getting the same error also with 2.37.1
where is this error pointing to ? [unexpected character at line 1 column 1 of the JSON data]
is it possible that after removel that there is something left in the database ?
running Nextcloud Hub 8 (29.0.4)

@the-djmaze
Copy link
Owner

That's because Nextcloud is serving an HTML document instead.
So Nextcloud does not serve a 404, but just throws a 200 with HTML.

And SnappyMail needs JSON.

I will modify the fetch code to detect this misbehavior.
It will not solve it, but should give more insight then.

the-djmaze pushed a commit that referenced this issue Aug 12, 2024
@the-djmaze the-djmaze added bug Something isn't working and removed external Issue is outside our code workaround labels Aug 12, 2024
@the-djmaze
Copy link
Owner

the-djmaze commented Aug 12, 2024

I found an issue due to O365 login!
47d18ca#r144395031

So in this case it was my fault 😱

@JonTabor
Copy link

I found an issue due to O365 login! 47d18ca#r144395031

So in this case it was my fault 😱

Microsoft causing problems for people? Color me shocked.

Nice find! And thanks for looking into it for us!

@the-djmaze
Copy link
Owner

Microsoft causing problems for people? Color me shocked.

I'm not eligible for a Pwnie Award like CrowdStrike.

@joshtrichards
Copy link

Nextcloud has a bad habbit of failing update tasks.

Nextcloud keeps switching between apps and custom-apps and there's only one thing you can do:

Go to /nextcloud/settings/admin/additional
Then go back to /nextcloud/apps/snappymail/ or /nextcloud/custom_apps/snappymail/

Nextcloud bugs are outside our development scope and this specific issue is already reported here several times and i can't reproduce them in my Nextcloud instances.

Hey @the-djmaze - Josh here (a member/contributor over at the Nextcloud project). I'm not clear what bug this is referencing.

Is there some situation where a URL is hard coded in Snappy or something?

In Nextcloud, the apps_paths are defined by config not hardcoded. Any number of apps paths are valid and admins can name them whatever they want.

https://docs.nextcloud.com/server/latest/admin_manual/apps_management.html#using-custom-app-directories

By convention several of the installation methods (like our micro-services and AIO Do keep images) do use apps/ for shipped apps and custom_apps/ for app store installed apps, but that's entirely arbitrary.

@the-djmaze
Copy link
Owner

the-djmaze commented Oct 13, 2024

Hi @joshtrichards somehow Nextcloud switches the path.
When you have /apps/snappymail then after upgrade it is /custom_apps/snappymail (or viceversa).

Snappymail stores the path in application.ini so after upgrade it fails.

Also people seem to have multiple installations of Snappymail after that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Nextcloud
Projects
None yet
Development

No branches or pull requests

4 participants