[Bug]: Old log location is recreated and then moving these files to the new location failes on linux
- Dominant language
- C++
- Stars
- 3.9k
- Forks
- 1k
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 127
Description
### ⚠️ Before submitting, please verify the following: ⚠️
- [x] This is a **bug**, not a question or a configuration issue.
- [x] This issue is **not** already reported on Github (I've searched it).
- [x] Nextcloud Server and Desktop Client are **up to date**. See [Server Maintenance and Release Schedule](https://github.com/nextcloud/server/wiki/Maintenance-and-Release-Schedule) and [Desktop Releases](https://nextcloud.com/install/#install-clients) for supported versions.
- [x] I agree to follow Nextcloud's [Code of Conduct](https://nextcloud.com/contribute/code-of-conduct/)
### Bug description
I noticed in the logs that the client tries to move the old config location and the log files from `$HOME/.local/share/Nextcloud` to `$HOME/.config/Nextcloud`.
When I remove the old location it is recreated on the next start of the client.
Also when I remove the log files from the new location they are moved but the error reappears after the next start because the files in the new location are not allowed to be overwritten.
Trying to understand the second case I noticed the timestamps of the log files in both locations.
It appears that the client first tries to move the files from the old location to the new location and then writes to the old location.
### Steps to reproduce
1. Stop the client
1. Remove `$HOME/.config/Nextcloud/nextcloud*.log` and `$HOME/.local/share/Nextcloud`
1. Start the client
1. (the old location `$HOME/.local/share/Nextcloud` is recreated)
1. Restart the client
1. (the logs from the previous start are moved to the new location and then the client recreates and writes to the old location)
### Expected behavior
Migration should be consistent.
### Which files are affected by this bug
-
### Operating system
Linux
### Which version of the operating system you are running.
Arch Linux
### Package
Distro package manager
### Nextcloud Server version
30.0.3.2
### Nextcloud Desktop Client version
2:3.15.0-1
### Is this bug present after an update or on a fresh install?
Updated to a major version (ex. 3.3.6 to 3.4.0)
### Are you using the Nextcloud Server Encryption module?
Encryption is Disabled
### Are you using an external user-backend?
- [x] Default internal user-backend
- [ ] LDAP/ Active Directory
- [ ] SSO - SAML
- [ ] Other
### Nextcloud Server logs
```shell
```
### Additional info
System logs:
> 13/12/2024 07:29 kded6 Service ":1.214" unregistered
> 13/12/2024 07:29 systemd dbus-:1.3-com.nextcloudgmbh.Nextcloud@11.service: Consumed 2.084s CPU time, 68.4M memory peak.
> 13/12/2024 07:29 systemd Started dbus-:1.3-com.nextcloudgmbh.Nextcloud@12.service.
> 13/12/2024 07:29 nextcloud QGuiApplication::setDesktopFileName: the specified desktop file name ends with .desktop. For compatibility reasons, the .desktop suffix will be removed. Please specify a desktop file name without .desktop suffix
> 13/12/2024 07:29 kded6 Registering ":1.217/StatusNotifierItem" to system tray
>
> 13/12/2024 07:30 kded6 Service ":1.217" unregistered
> 13/12/2024 07:30 systemd dbus-:1.3-com.nextcloudgmbh.Nextcloud@12.service: Consumed 1.814s CPU time, 68.9M memory peak.
> 13/12/2024 07:30 systemd Started dbus-:1.3-com.nextcloudgmbh.Nextcloud@13.service.
> 13/12/2024 07:30 nextcloud QGuiApplication::setDesktopFileName: the specified desktop file name ends with .desktop. For compatibility reasons, the .desktop suffix will be removed. Please specify a desktop file name without .desktop suffix
> 13/12/2024 07:30 nextcloud nextcloud.gui.application: Migrating old config from "$HOME/.local/share/Nextcloud" to "$HOME/.config/Nextcloud"
> 13/12/2024 07:30 nextcloud nextcloud.gui.application: Failed to move the old config directory to its new location ( "$HOME/.local/share/Nextcloud" to "$HOME/.config/Nextcloud" )
> 13/12/2024 07:30 nextcloud nextcloud.gui.application: Will move the individual files QList("nextcloud-work_sync.log", "nextcloud_sync.log")
> 13/12/2024 07:30 kded6 Registering ":1.220/StatusNotifierItem" to system tray
Contributor guide
Assessment
This issue has not been assessed yet.