API v1-2 compat PUT routes return 405 pre-auth on NC 35 (route matches via occ, fails via web)
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 45/100
Piste de recherche
Start by tracing how OC\AppFramework\Routing\CachingRouter builds and matches the compiled route collection for the default collection; the issue points to the serialized cache key host#/index.php#rootCollection and OC.php's MethodNotAllowedException fallback. Compare the v1-2 PUT compatibility routes with their v1-3 POST twins and inspect the postfix handling. Done means identifying why live web PUT requests return 405 despite occ router:match succeeding, with a regression test covering the route match.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
API v1-2 compat PUT routes (news app) return 405 pre-auth on NC 35 — route matches via CLI, fails via web
On Nextcloud 35.0.2.2 (News app 29.0.0, which registers API v1-2 compatibility routes) every PUT to an /apps/news/api/v1-2/... compat route returns 405 before authentication, while GETs to the same route family return 401 as expected. Routing is fine per occ but the live web request still 405s — reproduced on IPv4+IPv6, with/without auth, and after full php-fpm restarts.
Steps to reproduce
- With the News app enabled on NC 35.x:
curl -X PUT "https://<server>/index.php/apps/news/api/v1-2/items/read/multiple"
# → 405 (expected: 401 — auth middleware never reached)
curl "https://<server>/index.php/apps/news/api/v1-2/feeds"
# → 401 (route family OK for GET)
- Note the contradiction with the router itself:
occ router:match --method=PUT /apps/news/api/v1-2/items/read/multiple
# → matches news.item_api.read_multiple (ItemApiController::readMultiple)
- Control:
PUT /ocs/v2.php/apps/user_status/api/v1/heartbeatworks (OCS collection is fine); only the default collection PUTs fail. Real-world impact: News Android sync aborts (PUT /items/read/multipleis its mark-as-read call).
What we ruled out / suspect
occ router:list newsshows the PUT routes with correct paths/methods;occ router:matchmatches.- An isolated sandbox using NC's own
OC\AppFramework\Routing\RouteParser+ symfonyCompiledUrlMatcher(bundled 3rdparty symfony, php 8.3 and 8.5 — the FPM runtime) parses and matches the same route perfectly. - The live 405 comes from
OC.php's silent fallback (catch (MethodNotAllowedException) → http_response_code(405)). - Clearing
CachingRouter's serialized compiled-route cache (php-fpm restart, clearing opcache+APCu) does not change the behavior — a fresh rebuild still 405s the PUTs. - Converting the v1-2 entries to dual-verb (
'verb' => ['PUT','POST']in the app's routes.php) has no effect; reverted. - Suspect: the compiled route collection (
CachingRouterserialization, keyhost#/index.php#rootCollection, TTL 3600s) mishandles thepostfix-renamed v1-2 PUT compat entries that coexist with their v1-3 POST twins on the same paths.x-githubref: nextcloud/news PR #3984 removed one such "unreachable PUT" instead of root-causing it.
Environment
- Nextcloud 35.0.2.2 (News 29.0.0), Ubuntu 22.04, php 8.5-fpm (also reproduced in php 8.3 CLI sandbox), MariaDB.
- Original filing with the News app: nextcloud/news#4011 (the News maintainers redirected here since the failure is in server-side routing).
Happy to provide raw traces, a compiled-route-table dump from inside the FPM process, or debug output from a maintenance window.
- Langage dominant
- PHP
- Étoiles
- 37.6k
- Forks
- 5.4k
- Merge moyen
- 1 j 13 h
- PR mergées (30 j)
- 623
Préparer son environnement
Lance le conteneur de développement du projet dans votre navigateur, avec votre propre compte GitHub.
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de nextcloud/server
-
[Bug]: Axios Update NeededOuverte0. Needs triage 35-feedback bug
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
Les mainteneurs répondent en général sous 1 jour
-
34-feedback
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
Les mainteneurs répondent en général sous 1 jour
-
[Bug]: GET /js/../<anything> returns 500 (NotPermittedException from JsController::getJs) instead of 404Peut-être pris @lazerg l’a pris il y a 7 jours. Ouverte35-feedback
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
Les mainteneurs répondent en général sous 1 jour
-
[Bug]: Dashboard widgets registered via OCA.Dashboard.register() sometimes never mount (spinner forever) – Vue 3 non-deep `callbacks` watcher racePeut-être pris @lazerg l’a pris il y a 7 jours. Ouverte35-feedback
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de nextcloud/server
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
sonata-project/SonataAdminBundle#8426 ·
Les mainteneurs répondent en général sous 1 jour
-
good first issue help wanted
Difficulté 2/5 1-3 heures Accessibilité débutants 90/100
erkamyaman/rust-anything#942 ·
Les mainteneurs répondent en général sous 1 jour
-
CPU core labels missing for Low-Power E-cores on hybrid Intel CPUs (Arrow Lake-H) — get_intel_core_types() ignores /sys/devices/cpu_lowpowerPeut-être pris @dgongut l’a pris aujourd’hui. Ouverte
Difficulté 1/5 Moins d'une heure Accessibilité débutants 90/100
Les mainteneurs répondent en général sous 1 jour