Skip to content

handle case where we can't get the filesize after open in dav get#58550

Merged
susnux merged 1 commit intomasterfrom
dav-open-size-not-found
Mar 5, 2026
Merged

handle case where we can't get the filesize after open in dav get#58550
susnux merged 1 commit intomasterfrom
dav-open-size-not-found

Conversation

@icewind1991
Copy link
Member

@icewind1991 icewind1991 commented Feb 24, 2026

@icewind1991 icewind1991 requested a review from a team as a code owner February 24, 2026 15:34
@icewind1991 icewind1991 requested review from Altahrim, ArtificialOwl, artonge and come-nc and removed request for a team February 24, 2026 15:34
@icewind1991 icewind1991 marked this pull request as draft February 24, 2026 15:34
@icewind1991 icewind1991 force-pushed the dav-open-size-not-found branch from 04eaca0 to 9d7d562 Compare February 24, 2026 17:11
@icewind1991 icewind1991 added the 3. to review Waiting for reviews label Feb 24, 2026
@icewind1991 icewind1991 added this to the Nextcloud 34 milestone Feb 24, 2026
@icewind1991 icewind1991 marked this pull request as ready for review February 24, 2026 17:11
@icewind1991 icewind1991 requested a review from susnux February 24, 2026 19:22
if ($this->getSize() !== $fsSize) {
$logger = Server::get(LoggerInterface::class);
if ($fsSize === false) {
$logger->warning('file not found on storage after successfully opening it');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it make sense (for proper client error code) to throw a StorageNotAvailableException here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that the file opened successfully, I'm not sure if we should return an error or just try to read the handle we got an hope that that gives the correct content.

We don't really have enough info to determine that.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed my mind on this, probably better to err on throwing an error

@susnux susnux added the bug label Feb 24, 2026
@icewind1991 icewind1991 force-pushed the dav-open-size-not-found branch from 9d7d562 to 8fa18ac Compare February 26, 2026 16:44
Copy link
Contributor

@susnux susnux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I let this be tested, lets see if it fixes dCache

Copy link
Contributor

@susnux susnux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was tested successfully 👍

Signed-off-by: Robin Appelman <robin@icewind.nl>
@susnux susnux force-pushed the dav-open-size-not-found branch from 8fa18ac to 26ba3ca Compare March 5, 2026 10:35
@susnux susnux merged commit 5d84d79 into master Mar 5, 2026
186 of 192 checks passed
@susnux susnux deleted the dav-open-size-not-found branch March 5, 2026 12:24
@susnux
Copy link
Contributor

susnux commented Mar 5, 2026

/backport to stable33

@susnux
Copy link
Contributor

susnux commented Mar 5, 2026

/backport to stable32

@backportbot
Copy link

backportbot bot commented Mar 5, 2026

The backport to stable32 failed. Please do this backport manually.

# Switch to the target branch and update it
git checkout stable32
git pull origin stable32

# Create the new backport branch
git checkout -b backport/58550/stable32

# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts, resolve them
git cherry-pick 26ba3cac

# Push the cherry pick commit to the remote repository and open a pull request
git push origin backport/58550/stable32

Error: Failed to push branch backport/58550/stable32: remote: Invalid username or token. Password authentication is not supported for Git operations.
fatal: Authentication failed for 'https://github.com/nextcloud/server.git/'


Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.

@susnux
Copy link
Contributor

susnux commented Mar 5, 2026

/backport to stable32

@backportbot
Copy link

backportbot bot commented Mar 5, 2026

The backport to stable32 failed. Please do this backport manually.

# Switch to the target branch and update it
git checkout stable32
git pull origin stable32

# Create the new backport branch
git checkout -b backport/58550/stable32

# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts, resolve them
git cherry-pick 26ba3cac

# Push the cherry pick commit to the remote repository and open a pull request
git push origin backport/58550/stable32

Error: Failed to push branch backport/58550/stable32: remote: Invalid username or token. Password authentication is not supported for Git operations.
fatal: Authentication failed for 'https://github.com/nextcloud/server.git/'


Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.

@susnux
Copy link
Contributor

susnux commented Mar 5, 2026

/backport 26ba3ca to stable32

@backportbot
Copy link

backportbot bot commented Mar 5, 2026

The backport to stable32 failed. Please do this backport manually.

# Switch to the target branch and update it
git checkout stable32
git pull origin stable32

# Create the new backport branch
git checkout -b backport/58550/stable32

# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts, resolve them
git cherry-pick 26ba3cac

# Push the cherry pick commit to the remote repository and open a pull request
git push origin backport/58550/stable32

Error: Failed to push branch backport/58550/stable32: remote: Invalid username or token. Password authentication is not supported for Git operations.
fatal: Authentication failed for 'https://github.com/nextcloud/server.git/'


Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.

@susnux
Copy link
Contributor

susnux commented Mar 5, 2026

stable32: #58737

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants