malinkinsa/graylog2thehive4

Application does not start, TypeError: an integer is required (got type str)

Closed this issue · 1 comments

Hello,

when starting the application I get the following error:

/opt/graylog2thehive4-main # /usr/bin/python3 main.py --url=https://thehive.domain.tld --api_key=stuff --ip=0.0.0.0 --port='5000'
Traceback (most recent call last):
File "main.py", line 18, in
uvicorn.run("app.webhook:webhook", host=ip, port=port, reload=True)
File "/usr/lib/python3.6/site-packages/uvicorn/main.py", line 441, in run
sock = config.bind_socket()
File "/usr/lib/python3.6/site-packages/uvicorn/config.py", line 541, in bind_socket
sock.bind((self.host, self.port))
TypeError: an integer is required (got type str)

I could fix the Error with the following change to the code:

in main.py:
arg.add_argument('--port', type=int, default=8000)

The Application then starts.

Hello, @Noatun.
Many thanks for your feedback.
Fixed this.