# Fails to start when invalid port is set

! exec karma --pid-file=karma.pid --alertmanager.uri=http://foo:bar@127.0.0.1 --listen.address=127.0.0.1 --listen.port=9999999
! stdout .
cmp stderr stderr.txt

-- stderr.txt --
level=INFO msg="Version: dev"
level=INFO msg="Configured Alertmanager source" name=default cluster=default uri=http://foo:xxx@127.0.0.1 proxy=false readonly=false
level=INFO msg="Writing PID file" path=karma.pid
level=INFO msg="Initial Alertmanager collection"
level=INFO msg="Pulling latest alerts and silences from Alertmanager"
level=INFO msg="Collecting alerts and silences" alertmanager=default
level=INFO msg="GET request" uri=http://foo:xxx@127.0.0.1/metrics timeout=40s
level=ERROR msg="Request failed" error="Get \"http://foo:***@127.0.0.1/metrics\": dial tcp 127.0.0.1:80: connect: connection refused" alertmanager=default uri=http://foo:xxx@127.0.0.1
level=ERROR msg="Collection failed" error="Get \"http://127.0.0.1/api/v2/silences\": dial tcp 127.0.0.1:80: connect: connection refused" alertmanager=default try=1/2
level=INFO msg="GET request" uri=http://foo:xxx@127.0.0.1/metrics timeout=40s
level=ERROR msg="Request failed" error="Get \"http://foo:***@127.0.0.1/metrics\": dial tcp 127.0.0.1:80: connect: connection refused" alertmanager=default uri=http://foo:xxx@127.0.0.1
level=ERROR msg="Collection failed" error="Get \"http://127.0.0.1/api/v2/silences\": dial tcp 127.0.0.1:80: connect: connection refused" alertmanager=default try=2/2
level=INFO msg="Collection completed"
level=INFO msg="Done, starting HTTP server"
level=ERROR msg="Execution failed" error="listen tcp: address 9999999: invalid port"
