Repository navigation
[Bug] [25.0.0RC4] Custom background doesn't stay (404) #34596
Copy link
Copy link
Closed
Labels
Milestone
Description
⚠️ This issue respects the following points: ⚠️
- This is a bug, not a question or a configuration/webserver/proxy issue.
- This issue is not already reported on Github (I've searched it).
- Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
- Nextcloud Server is running on 64bit capable CPU, PHP and OS.
- I agree to follow Nextcloud's Code of Conduct.
Bug description
Getting a 404 on a custom background: GET https://.../index.php/apps/theming/background
MariaDB [nextcloud]> select * from oc_preferences where userid='alice' and appid in ('dashboard', 'theming');
+--------+-----------+-------------------+-------------+
| userid | appid | configkey | configvalue |
+--------+-----------+-------------------+-------------+
| alice | dashboard | firstRun | 0 |
| alice | theming | background | custom |
| alice | theming | backgroundVersion | 1 |
+--------+-----------+-------------------+-------------+
3 rows in set (0.001 sec)
file "background.jpg" is missing on disk in "data/appdata_*/theming/alice"
Steps to reproduce
- Create three users Alice, Bob and Charles
- Login as Alice
- Upload an image
- Set that image as custom background
- Go to files app and shift+refresh to see it
Expected behavior
Background appears and exists on disk
Installation method
No response
Operating system
No response
PHP engine version
No response
Web server
No response
Database engine version
No response
Is this bug present after an update or on a fresh install?
No response
Are you using the Nextcloud Server Encryption module?
No response
What user-backends are you using?
- Default user-backend (database)
- LDAP/ Active Directory
- SSO - SAML
- Other
Configuration report
No response
List of activated Apps
N/ANextcloud Signing status
No response
Nextcloud Logs
{
"reqId": "yGU73Yn4alZXEjEKqNf7",
"level": 3,
"time": "2022-10-14T07:50:24+00:00",
"remoteAddr": "127.0.0.1",
"user": "--",
"app": "index",
"method": "GET",
"url": "/index.php/apps/theming/background?v=2",
"message": "Call to a member function getUID() on null",
"userAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36",
"version": "25.0.0.16",
"exception": {
"Exception": "Error",
"Message": "Call to a member function getUID() on null",
"Code": 0,
"Trace": [
{
"function": "__construct",
"class": "OCA\\Theming\\Controller\\UserThemeController",
"type": "->",
"args": [
"theming",
{
"__class__": "OC\\AppFramework\\Http\\Request"
},
{
"__class__": "OC\\AllConfig"
},
{
"__class__": "OC\\User\\Session"
},
{
"__class__": "OCA\\Theming\\Service\\ThemesService"
},
{
"__class__": "OCA\\Theming\\ThemingDefaults"
},
{
"__class__": "OCA\\Theming\\Service\\BackgroundService"
}
]
},
{
"file": "/srv/www/htdocs/server/lib/private/AppFramework/Utility/SimpleContainer.php",
"line": 108,
"function": "newInstanceArgs",
"class": "ReflectionClass",
"type": "->",
"args": [
[
"theming",
{
"__class__": "OC\\AppFramework\\Http\\Request"
},
{
"__class__": "OC\\AllConfig"
},
{
"__class__": "OC\\User\\Session"
},
{
"__class__": "OCA\\Theming\\Service\\ThemesService"
},
{
"__class__": "OCA\\Theming\\ThemingDefaults"
},
{
"__class__": "OCA\\Theming\\Service\\BackgroundService"
}
]
]
},
{
"file": "/srv/www/htdocs/server/lib/private/AppFramework/Utility/SimpleContainer.php",
"line": 116,
"function": "buildClass",
"class": "OC\\AppFramework\\Utility\\SimpleContainer",
"type": "->",
"args": [
{
"__class__": "ReflectionClass",
"name": "OCA\\Theming\\Controller\\UserThemeController"
}
]
},
{
"file": "/srv/www/htdocs/server/lib/private/AppFramework/Utility/SimpleContainer.php",
"line": 133,
"function": "resolve",
"class": "OC\\AppFramework\\Utility\\SimpleContainer",
"type": "->",
"args": [
"OCA\\Theming\\Controller\\UserThemeController"
]
},
{
"file": "/srv/www/htdocs/server/lib/private/AppFramework/DependencyInjection/DIContainer.php",
"line": 465,
"function": "query",
"class": "OC\\AppFramework\\Utility\\SimpleContainer",
"type": "->",
"args": [
"OCA\\Theming\\Controller\\UserThemeController"
]
},
{
"file": "/srv/www/htdocs/server/lib/private/AppFramework/DependencyInjection/DIContainer.php",
"line": 437,
"function": "queryNoFallback",
"class": "OC\\AppFramework\\DependencyInjection\\DIContainer",
"type": "->",
"args": [
"OCA\\Theming\\Controller\\UserThemeController"
]
},
{
"file": "/srv/www/htdocs/server/lib/private/AppFramework/App.php",
"line": 159,
"function": "query",
"class": "OC\\AppFramework\\DependencyInjection\\DIContainer",
"type": "->",
"args": [
"OCA\\Theming\\Controller\\UserThemeController"
]
},
{
"file": "/srv/www/htdocs/server/lib/private/Route/Router.php",
"line": 298,
"function": "main",
"class": "OC\\AppFramework\\App",
"type": "::",
"args": [
"OCA\\Theming\\Controller\\UserThemeController",
"getBackground",
{
"__class__": "OC\\AppFramework\\DependencyInjection\\DIContainer"
},
[
"theming.userTheme.getBackground"
]
]
},
{
"file": "/srv/www/htdocs/server/lib/base.php",
"line": 1047,
"function": "match",
"class": "OC\\Route\\Router",
"type": "->",
"args": [
"/apps/theming/background"
]
},
{
"file": "/srv/www/htdocs/server/index.php",
"line": 36,
"function": "handleRequest",
"class": "OC",
"type": "::",
"args": []
}
],
"File": "/srv/www/htdocs/server/apps/theming/lib/Controller/UserThemeController.php",
"Line": 76,
"CustomMessage": "--"
}
}Additional info
No response
Reactions are currently unavailable
Activity
PVince81 commentedon Oct 14, 2022
how can getUser() be null ? is there an issue with the lifecycle ?
PVince81 commentedon Oct 14, 2022
I've done further tests and directly after setting the background, I see background.jpg appearing in appdata under the "theming" app
but as soon as I shift+refresh, that file disappears
maybe the migration code / cron (ajax cron on local env) is wrongly deleting the file. Ref: #34587
PVince81 commentedon Oct 14, 2022
@blizzz FYI
PVince81 commentedon Oct 14, 2022
it's not the migration job, when commented out a shift+refresh (at most 2x) will delete "background.jpg".
not sure if it's the null user or something else at play
PVince81 commentedon Oct 14, 2022
also note, I have custom theme colors set, in case it matters:
PVince81 commentedon Oct 14, 2022
it's not the "/background" endpoint, I tried refreshing it in a separate tab and background.jpg does not get deleted
maybe it's the settings page that resets it upon reload?
PVince81 commentedon Oct 14, 2022
ok, we found the issue, it has multiple layers:
Here we are clearing the theme's cache:
server/apps/theming/lib/Controller/UserThemeController.php
Line 185 in dff4f8a
When clearing the admin theme, it will delete everything inside the "appdata_*/theming folder" including the user data.
The cache buster value and the user names are colliding inside the "theming" folder => here we need to separate the global and user theme data into separate folders "theming/global/$cacheBusterValue" and "theming/global/$userId"
PVince81 commentedon Oct 14, 2022
Fix is here: #34599
mueslo commentedon Oct 25, 2022
I do not believe this is fixed. I just upgraded from NC 24.0.5 to 25.0.0 (stable) and the background image disappeared.
The previously-set background image caused 404s (I did not immediately notice it after the upgrade due to client-side caching, I assume). But today, it resulted in 404s for the background image, and in the admin panel the background image was also empty.
Skamandrios commentedon Nov 24, 2022
I just upgraded from 24.0.7 to 25.0.1 and the custom theming was not applied. This affects the background, as well as the custom logos.
ffried commentedon Dec 12, 2022
Same here. Upgraded two NextCloud instances to 25.0.2 and both of them have no background images now. One of them had a custom logo as well which is also gone now.
Logs on both instances show this:
Or in raw:
ffried commentedon Dec 12, 2022
And I think the issue is this line:
https://github.com/nextcloud/server/pull/34677/files#diff-359221f5daddbe538fe970eddb46e5f77d6993679fb9626eacf8e3cdf81c230fR105
This should probably be
jdkruzr commentedon Dec 24, 2022
hi, this error shows up on my new 25.0.2 install, and I haven't even set a custom background. the error shows up when I try to manually run cron.php (which I have to do in order to troubleshoot cron, because the cron job just isn't working for some reason)
Draluy commentedon Dec 27, 2022
I'm exactly on the same page as @jdkruzr here. I launched cron.php manually once to test, and subsequent runs show this error.
jdkruzr commentedon Dec 27, 2022
@Draluy I have since gotten it working, although I couldn't tell you exactly how. But, maybe of some note: my installation isn't even Dockerized and we had the same issue.
kyrofa commentedon Jan 1, 2023
Just saw that error in the snap when upgrading from v24 to v25. Something seems to be broken, but whatever it is only seems to happen on upgrade-- works fine once the upgrade is done. Maybe a left-over queued job from v24 with a different argument than expected in the v25 codebase?