Conversation
Signed-off-by: Robin Appelman <robin@icewind.nl>
Signed-off-by: Robin Appelman <robin@icewind.nl>
Codecov Report
@@ Coverage Diff @@
## master #7113 +/- ##
============================================
+ Coverage 50.73% 50.74% +<.01%
- Complexity 24412 24414 +2
============================================
Files 1579 1579
Lines 93321 93325 +4
Branches 1359 1359
============================================
+ Hits 47347 47357 +10
+ Misses 45974 45968 -6
|
|
It seems to work, although I still get some error messages in the nextcloud log: during the initial setup I get a lot of after the setup finished and I upload I file I get this error messages; maybe that's not a problem, we just try to access a file/preview which is not there yet. Still it is bad if we spam the nextcloud.log for every file operation. |
|
I only get the errors when I first try the install on master, and then switch to this PR. So I think this is caused by an inconsistent state from the first failed install. |
|
I can reproduce it. I switch first to your branch, delete the database (mariadb) and create a new/empty one. Delete the s3 bucket and then do the initial setup. Before I perform the initial setup I already add to the config.php following, so that the object storage is configures right from the beginning: I also have all the example files in the skeleton directory: https://github.com/nextcloud/example-files. Maybe this makes a difference, if more files are created during initial setup/login? If I navigate after the installation into the "Photos" directory I get this errors: If I upload a non-empty text file, I get this errors: At the end all files are accessible and the preview are generated and shown. But it seems like in the process there is a situation where we try to access a non existing file. As said, at the end everything seems to work, but I would feel more comfortable without this errors. |
|
If I just set "installed" to false in the config.php, cleanup the database but keep the s3 bucket from the first try and then reinstall Nextcloud I don't get the error messages mentioned above. So maybe that's the difference between our tests? That I delete the bucket first so that a new bucket needs to be created and all files needs to be uploaded again and you install it with a already existing bucket which contains already files from previous tries? |
|
@MorrisJobke you can't reproduce the 404 on preview generation? Did you tried it the way I described it? Real Amazon S3 backend? bucket doesn't exist before installation? Anything else you do different, different storage config in the config.php? I can still reproduce it... 😕 |
As of now I tried it with a fakes3 bucket, but an empty one. AFAIK there is no support for a prefilled bucket. I just then uploaded some documents, photos and movies. All were played back/shown correctly. |
|
I think fakes3 doesn't help here. The whole problem we try to fix here didn't showed up with fakes3 at all. |
|
The strange thing is also. If I debug it, the fopen which fails comes from here: https://github.com/nextcloud/server/blob/master/lib/private/Files/ObjectStore/ObjectStoreStorage.php#L301 As you can see we do a file_exists() first. Still the fopen fails and returns false so that we continue with Maybe a timing issue, that the file is already added to the file cache but not uploaded, that would explain why file_exists() return true but fopen fails |
|
with primary object store, |
|
@icewind1991 so maybe the timing issue i described, that the file is added to the cache before the upload was completed? Did you tried it already the way I described it? |
|
@schiessle I can't reproduce the issue, imo we should merge this and look into the issue seperatly |
|
@icewind1991 ok, let's merge it and backport it for now |
|
@icewind1991 can you create a backport? Thanks! |
| @@ -364,7 +364,7 @@ public function touch($path, $mtime = null) { | |||
| $fileId = $this->getCache()->put($path, $stat); | |||
| try { | |||
| //read an empty file from memory | |||
touching an objectstore file.