Skip to content

Conversation

mohammed90
Copy link
Member

Follow up for #6032. Only validate config is proper JSON if config slice has data.

Without this fix, running caddy run or caddy start without any config (not even Caddyfile around) results in the error:

Error: config is not valid JSON: unexpected end of JSON input; did you mean to use a config adapter (the --adapter flag)?
Error: caddy process exited with error: exit status 1

@mohammed90 mohammed90 added the bug 🐞 Something isn't working label Apr 18, 2024
@mohammed90 mohammed90 added this to the v2.8.0 milestone Apr 18, 2024
@mohammed90 mohammed90 changed the title cmd: fix error when running without config cmd: Only validate config is proper JSON if config slice has data Apr 18, 2024
Copy link
Member

@mholt mholt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, thanks!

@mholt mholt merged commit 8f87c5d into master Apr 18, 2024
@mholt mholt deleted the fix-run-no-config branch April 18, 2024 21:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐞 Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants