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

Bug: Icon endpoint /apps/openbuilt/icons/{slug}.svg returns 404 #68

Description

@rubenvdlinde

Symptom

`GET /index.php/apps/openbuilt/icons/hello-world.svg` returns HTTP 404 (`text/html`) instead of 200 `image/svg+xml`. Same for the `-dark` variant.

The route IS registered in `appinfo/routes.php`:
```php
['name' => 'icon#iconLight', 'url' => '/icons/{slug}.svg', 'verb' => 'GET', 'requirements' => ['slug' => '[a-z0-9][a-z0-9-][a-z0-9]']],
['name' => 'icon#iconDark', 'url' => '/icons/{slug}-dark.svg', 'verb' => 'GET', 'requirements' => ['slug' => '[a-z0-9][a-z0-9-]
[a-z0-9]']],
```

After OPcache reload + `occ maintenance:repair`, the route still 404s.

Hypothesis

Either:

  1. The route pattern `[a-z0-9][a-z0-9-]*[a-z0-9]` requires 2+ chars (which `hello-world` satisfies) — but the controller might be unreachable due to DI / namespace issue
  2. `IconController` constructor has a hard dependency that throws on instantiation (silently 404s)
  3. A higher-precedence wildcard route is matching first

Repro

  1. Apply PRs [1/8] refactor: split Application + ApplicationVersion (ADR-002 foundation) #58[8/8] fix(tests): stabilise 11 PHPUnit failures + ProductionVersionGuardListener runtime bug #65
  2. `curl -u admin:admin http://localhost:8080/index.php/apps/openbuilt/icons/hello-world.svg -I`
  3. See HTTP/1.1 404

Investigation steps

  1. `docker exec nextcloud tail -200 /var/www/html/data/nextcloud.log` for IconController instantiation errors
  2. Check `lib/Controller/IconController.php` constructor for DI issues
  3. Verify the route conflict order in `appinfo/routes.php` — make sure no SPA wildcard precedes the icon routes
  4. Try the request with various slug shapes to test the regex

Spec ref: `openspec/changes/openbuilt-nextcloud-nav/specs/app-icon-management/spec.md` (REQ-OBICON-002, REQ-OBICON-003).

Surfaced during morning visual smoke.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions