Skip to content

Fix run-server debug mode crash on base_url - #142

Merged
t4k merged 1 commit into
mainfrom
run-server-debug-base-url
Nov 2, 2026
Merged

t4k merged 1 commit into
mainfrom
run-server-debug-base-url

Conversation

@t4k

@t4k t4k commented Nov 2, 2026

Copy link
Copy Markdown
Member

admin/run-server --mode debug crashes at startup:

AttributeError: Attribute base_url already defined. Plugin conflict?

start_bottle_server() set dibs.base_url and then, when the port isn’t 80 or 443, set it again with the port added. Bottle’s app object won’t let an attribute be set a second time. The default base URL is http://localhost:8080, so debug mode always crashed.

Change

Build the URL in a local variable and assign dibs.base_url once.

Testing

Python 3.12, run-server --mode debug with the default base URL, using a stand-in mod_wsgi module because mod-wsgi can’t be built on macOS without Apache headers. Debug mode doesn’t use mod-wsgi.

  • The server starts without the error.
  • / and /about return 200, and their links use http://localhost:8080.
  • /list redirects to http://localhost:8080/notallowed, so redirects get the port too.

This branch is based on main and is independent of #141; the two change different parts of admin/run-server.

🤖 Generated with Claude Code

Bottle's app object refuses to set an attribute that is already
defined, so start_bottle_server() crashed with "Attribute base_url
already defined. Plugin conflict?" whenever the port wasn't 80 or 443,
which includes the default http://localhost:8080. The URL is now built
in a local variable and assigned to dibs.base_url once.

Tested with run-server --mode debug under Python 3.12: the server
starts, / and /about return 200, and /list redirects to
http://localhost:8080/notallowed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@t4k
t4k merged commit 27b8797 into main Nov 2, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant