Skip to content
This repository was archived by the owner on Nov 12, 2026. It is now read-only.
This repository was archived by the owner on Nov 12, 2026. It is now read-only.

All file operations return HTTP 405 after a successful login (O2, Spain) #10

Closed

Description

@scarcraft1

Summary

Interactive login completes successfully, but every subsequent call to O2's
file API returns HTTP 405 Method Not Allowed. The WebDAV layer turns that into
502 Bad Gateway, so the gateway is unusable even though the session is valid.

This may be the root cause of #8 ("image file formats not uploading"), described
from the symptom rather than from the HTTP request.

Environment

Image docker.io/garanda21/o2cloud_gateway_webdav:latest
Digest sha256:da69b505b651cc7f0988ffa6dfdf9caa59de235d3a410ec4821849589e901976
Created 2026-08-24 20:38:17 UTC
image.revision fcd1aace0b2fbe3bccd3f1e2221120e1ca334dfc
image.version 0.1.0
Provider CLOUD_PROVIDER=o2 (Movistar/O2 customer, Spain)
Runtime Rootless Podman, --userns=keep-id, Fedora Silverblue 44
Client rclone 1.74.3 (webdav backend, vendor other)
Test date 2026-09-07

I can confirm the image already contains the fix from #4 ("Fix Movistar
picture listings and Windows WebDAV writes"): its image.revision label points
at the same commit as repository HEAD (fcd1aac). Rebuilding from source
changes nothing.

Steps to reproduce

  1. Start the container with CLOUD_PROVIDER=o2.
  2. Open /admin and start the assisted login.
  3. Authenticate with O2 using username, password and the 2FA code sent by SMS.
  4. Login completes successfully.
  5. Attempt any WebDAV operation, e.g. rclone lsd o2:.

Expected behaviour

Listing and uploading files should work.

Actual behaviour

Login genuinely succeeds. The same call flips from 401 to 200:

14:51:20 INFO  GET https://cloud.o2online.es/sapi/profile?action=get&validationkey=*** "HTTP/1.1 401 401"
14:51:50 INFO  GET https://cloud.o2online.es/sapi/profile?action=get&validationkey=*** "HTTP/1.1 200 200"
14:51:50 WARN  interactive login completed without renewable oauth ***

From then on, everything returns 405:

14:51:51 INFO  GET  https://cloud.o2online.es/sapi/media?action=get-storage-space&softdeleted=true&validationkey=*** "HTTP/1.1 405 405"
14:53:53 INFO  POST https://cloud.o2online.es/sapi/media/folder/root?action=get&validationkey=***                    "HTTP/1.1 405 405"
14:53:53 ERROR webdav unhandled error
14:53:53 INFO  192.168.200.45:53290 - "PROPFIND /dav/copias/_o2test.txt HTTP/1.1" 502

That 405 → webdav unhandled error → 502 sequence repeats for every request.

Client side:

$ rclone lsd o2:
ERROR : error listing: couldn't list files: 502 Bad Gateway

$ rclone copy file.txt o2:copias/
ERROR : Attempt 2/3 failed with 1 errors and: read metadata failed: 502 Bad Gateway
ERROR : Attempt 3/3 failed with 1 errors and: read metadata failed: 502 Bad Gateway

Observations that may help

  1. The 405 is not an authentication problem. Before login, the same paths
    returned 401; after login they return 405. The token is valid, as proven
    by /sapi/profile flipping to 200.

  2. 405 Method Not Allowed suggests O2 no longer accepts the HTTP method
    being used on those routes.
    Worth noting that
    /sapi/media/folder/root?action=get is sent as POST while
    /sapi/media?action=get-storage-space is sent as GET, and both fail the
    same way. O2 may have swapped or unified the methods.

  3. Timeline. The project's last push is 2026-08-24 and image file formats not uploading #8 was opened
    2026-09-02. If O2 changed the API in late August, that would explain why both
    reports appear after that date.

  4. interactive login completed without renewable oauth also appears on an
    otherwise successful login, so it is probably unrelated to this failure, but
    I'm including it for completeness.

Happy to provide more logs or test a patch. Thanks for the project.

Activity

  1. garanda21 commented on Oct 10, 2026

    @garanda21
    Owner

    I checked this report against the subsequent fixes. PR #12 documents the same combination of successful /sapi/profile authentication and HTTP 405 on root-folder/quota operations. In that investigation, O2 returned business error PRO-1158 ("The email address must be set"): the account had not completed onboarding (email address, terms, and verification). After completing onboarding in a normal browser, the same API methods returned 200 and read/write operations worked. The HTTP verbs did not need changing.

    PR #12 fixes the unwritable-HOME Chromium startup failure that prevented assisted onboarding, but it does not change 405 handling or automatically provision an O2 account. Therefore I am keeping this issue open pending confirmation rather than assuming every 405 has been fixed.

    Have you retested with the current stable release v0.1.2, which includes #12, the O2 browser device-ID capture fix (#15), and the renewal-default change (#22)? Your report was tested on v0.1.0 / revision fcd1aace.

    Please refresh the image and recreate the container while preserving the existing volumes, complete any pending O2 onboarding at https://cloud.o2online.es/, then retry the connection test and rclone lsd. If 405 still occurs, please share the actual gateway version/revision and a short redacted excerpt containing the upstream error code/message (particularly whether it is PRO-1158), without session keys, cookies, or tokens.

    The recently merged fixes #18, #20, #21 and native ARM64 publication #23 are currently in main only; they have not yet been published in a new release and should not be assumed to be present in latest.

  2. scarcraft1 commented on Oct 13, 2026

    @scarcraft1
    ContributorAuthor

    Confirmed: the 405 was not a gateway bug, so this can be closed.

    As described in #12, the account had not completed O2 Cloud onboarding. The 405 responses carried the business error PRO-1158 ("The email address must be set"), with no Allow header. Once onboarding was finished through the assisted login (possible after #12 fixed the black noVNC screen), the same API calls returned 200.

    Since then, everything has been tested on current code, built from main at the same revisions as v0.1.2 and v0.1.3, running rootless Podman with --network host (see #19):

    • Listing, upload, download and delete through WebDAV and rclone. No 405 at any point.
    • A full restic repository copied to O2 through rclone → WebDAV: about 161 GB, 8 snapshots. restic check --read-data passed on the first part and --read-data-subset=10% on the whole repository.
    • I just pulled garanda21/o2cloud_gateway_webdav:v0.1.3 (revision 55fd2db) and switched my deployment to it. It starts correctly, and x11vnc, noVNC and the app are all bound to loopback.

    For anyone who finds this issue with the same symptom: if every file operation returns 405 right after a successful login, look at the response body. PRO-1158 means the O2 Cloud account still needs onboarding (email address, terms and verification). Complete it at https://cloud.o2online.es/ in a normal browser or through the assisted login.

    Closing. Thanks for following up.

    🤖 Generated with Claude Code

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions