Closed andreir1723 closed 1 week ago
Do they share the same database? Because, if not, file should be on the S3 (if the bucket is the same) but not visible on Nextcloud.
Hi @andreir1723,
"objectstore": {
"class": "\\OC\\Files\\ObjectStore\\S3",
"arguments": {
"bucket": "csnextcloudlocal",
"autocreate": true,
"key": "***REMOVED SENSITIVE VALUE***",
"secret": "***REMOVED SENSITIVE VALUE***",
"hostname": "s3.us-east-2.wasabisys.com",
"region": "us-east-2",
"port": 443,
"use_ssl": true,
"use_path_style": false
}
},
All files uploaded to the external storage should appear on the Nextcloud server regardless of the upload method. The files should never be deleted from the external storage without user consent.
You're using S3 as Primary Storage not External Storage. There is a tremendous difference. Please see https://docs.nextcloud.com/server/latest/admin_manual/configuration_files/primary_storage.html#differences-from-external-storage
During the upgrade, the old instance was accidentally accessed by a user, and some files were uploaded to the external S3 Wasabi storage. When the new instance was up and running, the uploaded files disappeared from the external storage.
Where is your PostgreSQL database for each Nextcloud deployment in this scenario? Is it co-hosted on the same EC2 instances you're cloning?
You pointed two distinct deployments of Nextcloud Server (different versions or not) at the same Primary Storage object store. This is not a reasonable setup.
Particularly if the database is not also shared.
I'm sorry to hear you may have lost some data, but what you described sounds more like a workflow matter and expected behavior for the scenario described, not a bug on the Nextcloud side.
Hope that helps some (and that I'm not misunderstanding your report).
Hi @joshtrichards,
You can categorize it as an upgrade mashup, but it shouldn't have ended with object storage data loss. According to the document you referred to, https://docs.nextcloud.com/server/latest/admin_manual/configuration_files/primary_storage.html#differences-from-external-storage, "The metadata is only stored in the database and the object store only holds the file content by unique identifier." That's how it's supposed to work. If the metadata in the database is not present, the file content in the object store should still be there. In my case, the file content in the object store is missing. Anyway, thank you for your time looking into the issue.
If the metadata in the database is not present, the file content in the object store should still be there.
Only in a static situation.
E.g. if you lose your database, your file content will be there in the bucket. That's not what happened.
The Nextcloud you brought up thinks it's authoritative for whatever is in that bucket. Just as authoritative as the other one. There will be overlapping file ids. File actions will be associated with the wrong file content.
As @solracsf suggested, the content written by the other Nextcloud may still be in the bucket itself, but it will not appear in Nextcloud. Or, if it does, it's likely associated with the wrong metadata. If you are lucky enough that the overlapping bits haven't lead to destructive actions against file content, it may be there, but that's certainly not guaranteed.
How are you determining that the file content is missing anyhow?
OK. For example, I can query the database on the backed-up instance and see a file "userID/files/myfile.txt" with urn:id:77777.
If I query the database on the upgraded instance, I don't see a file with the filename "myfile.txt" whatsoever. If that file were assigned a different ID or if urn:id:77777 were assigned to a different file, I'd agree with your overlapping file IDs hypothesis. However, urn:id:77777 is not present either.
To determine if the content is present on S3, I do a direct query to the object storage. No trace of the file is found there.
Do they share the same database? Because, if not, file should be on the S3 (if the bucket is the same) but not visible on Nextcloud.
That is the expected behavior, but it is not what happened in my case. Thank you for your feedback, @solracsf.
urn:id:77777
77777 is the fileid from the oc_filecache table.
If you find higher fileids in the table, then it was most likely an overlapping id.
@kesselb Overlapping IDs should not remove actual data from the S3 storage. An overlapping ID would make the file invisible on the Nextcloud server, and that would be acceptable. However, the problem is that the file does not exist on the storage anymore.
Do you find, on the new node, higher file ids?
It's possible that files are generated during the upgrade and stored in appdata. That's also on objectstore and the file might be deleted right after the upgrade.
This issue has been automatically marked as stale because it has not had recent activity and seems to be missing some essential information. It will be closed if no further activity occurs. Thank you for your contributions.
⚠️ This issue respects the following points: ⚠️
Bug description
The Nextcloud server based on an AWS EC2 instance was cloned, and the new instance was upgraded to Nextcloud version 29.0.1.1. During the upgrade, the old instance was accidentally accessed by a user, and some files were uploaded to the external S3 Wasabi storage. When the new instance was up and running, the uploaded files disappeared from the external storage.
Steps to reproduce
Expected behavior
All files uploaded to the external storage should appear on the Nextcloud server regardless of the upload method. The files should never be deleted from the external storage without user consent.
Installation method
Community Manual installation with Archive
Nextcloud Server version
29
Operating system
Debian/Ubuntu
PHP engine version
PHP 8.2
Web server
Apache (supported)
Database engine version
PostgreSQL
Is this bug present after an update or on a fresh install?
Upgraded to a MAJOR version (ex. 28 to 29)
Are you using the Nextcloud Server Encryption module?
Encryption is Disabled
What user-backends are you using?
Configuration report
List of activated Apps
Nextcloud Signing status
Nextcloud Logs
Additional info
No response