Skip to content

Updater disregards HTTP response code provided by update server #664

@itkfm

Description

@itkfm

How to use GitHub

  • Please use the 👍 reaction to show that you are affected by the same issue.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

Steps to reproduce

  1. Break the update server so it always returns status 500 and no message.
  2. Run the updater: php ./updater/updater.phar

Expected behaviour

The error returned by the update server is logged and raises an exception.

It performs a check similar to this one:

$responseCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
if ($responseCode !== 200) {
    throw new \Exception('Unexpected server response with status code: ' . $responseCode);
}

Actual behaviour

The updater claims there is no update available.
The code currently only checks whether curl_exec() has returned false which is insufficient to diagnose errors reported by the server through HTTP response codes.

updater/lib/Updater.php

Lines 509 to 511 in 55d647a

if ($response === false) {
throw new \Exception('Could not do request to updater server: ' . curl_error($curl));
}

Server configuration

Web server: irrelevant

Database: irrelevant

PHP version: 8.3

Nextcloud version: 31.0.7

Browser

irrelevant

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions