Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error When Executing "Get All Status Pages" Using API #62

Open
Noschvie opened this issue Nov 18, 2023 · 2 comments
Open

Error When Executing "Get All Status Pages" Using API #62

Noschvie opened this issue Nov 18, 2023 · 2 comments

Comments

@Noschvie
Copy link

Hello
running latest Uptime-Kuma and Uptime-Kuma-Web-API Docker image under RPi4 64 bit.

Command

curl -X 'GET' \
  'http://hadersdorf.myDomain.com:3002/statuspages' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer <...>'

Result

Internal Server Error

Uptime-Kuma-Web-API Logs

[2023-11-18 10:10:12 +0100] [7] [ERROR] Exception in ASGI application
Traceback (most recent call last):
  File "/app/venv/lib/python3.9/site-packages/uvicorn/protocols/http/httptools_impl.py", line 436, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
  File "/app/venv/lib/python3.9/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in __call__
    return await self.app(scope, receive, send)
  File "/app/venv/lib/python3.9/site-packages/fastapi/applications.py", line 270, in __call__
    await super().__call__(scope, receive, send)
  File "/app/venv/lib/python3.9/site-packages/starlette/applications.py", line 124, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/app/venv/lib/python3.9/site-packages/starlette/middleware/errors.py", line 184, in __call__
    raise exc
  File "/app/venv/lib/python3.9/site-packages/starlette/middleware/errors.py", line 162, in __call__
    await self.app(scope, receive, _send)
  File "/app/venv/lib/python3.9/site-packages/starlette/middleware/exceptions.py", line 75, in __call__
    raise exc
  File "/app/venv/lib/python3.9/site-packages/starlette/middleware/exceptions.py", line 64, in __call__
    await self.app(scope, receive, sender)
  File "/app/venv/lib/python3.9/site-packages/fastapi/middleware/asyncexitstack.py", line 21, in __call__
    raise e
  File "/app/venv/lib/python3.9/site-packages/fastapi/middleware/asyncexitstack.py", line 18, in __call__
    await self.app(scope, receive, send)
  File "/app/venv/lib/python3.9/site-packages/starlette/routing.py", line 680, in __call__
    await route.handle(scope, receive, send)
  File "/app/venv/lib/python3.9/site-packages/starlette/routing.py", line 275, in handle
    await self.app(scope, receive, send)
  File "/app/venv/lib/python3.9/site-packages/starlette/routing.py", line 65, in app
    response = await func(request)
  File "/app/venv/lib/python3.9/site-packages/fastapi/routing.py", line 249, in app
    content = await serialize_response(
  File "/app/venv/lib/python3.9/site-packages/fastapi/routing.py", line 138, in serialize_response
    raise ValidationError(errors, field.type_)
pydantic.error_wrappers.ValidationError: 1 validation error for StatusPageList
response -> statuspages -> 1 -> domainNameList -> 0
  invalid or missing URL scheme (type=value_error.url.scheme)

Thanks!

@BouncySteak
Copy link

You are making your query based off of Uptime-Kuma itself not the API noted buy the port number you have used.

curl -X 'GET' \
  'http://hadersdorf.myDomain.com:3002/statuspages' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer <...>'

Make the correction as so (unless you altered your docker-compose file)

curl -X 'GET' \
  'http://hadersdorf.myDomain.com:8000/statuspages' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer <...>'

@Noschvie
Copy link
Author

Noschvie commented Mar 1, 2024

The port number is the correct one

  uptime-api:
    container_name: uptime-api
    image: medaziz11/uptimekuma_restapi
    restart: unless-stopped
    env_file:
      - db.env
    environment:
      - TZ=Europe/Vienna
    depends_on:
      - uptime-kuma
    ports:
      - 3002:8000  # <Host Port>:<Container Port>
    volumes:
      - ./dataRestApi:/db

The /monitors end point works.

curl -X 'GET' \
  'http://hadersdorf.myDomain.com:3002/monitors' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer <...>'

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

No branches or pull requests

2 participants