Skip to content

[Bug]: create_app returns 500 Internal Server Error #16

Closed
@makmac213

Description

@makmac213

What happened?

We are building a multi-tenant application and we want to create a Onesignal app via api. The create_app function returns 500 error status.

image

`
def create_onesignal_app(tenant):
configuration = onesignal.Configuration(
user_key=settings.ONE_SIGNAL_USER_AUTH_KEY
)
with onesignal.ApiClient(configuration) as api_client:
hostname = get_hostname(tenant)
default_url = f"https://{hostname}"

    api_instance = default_api.DefaultApi(api_client)
    app = App(
        name=tenant.subdomain,
        chrome_web_origin=default_url,
        chrome_web_default_notification_icon='./static/notification/odzi-onesignal.png',
        site_name=tenant.subdomain,
        apns_p8=''
    )
    try:
        api_response = api_instance.create_app(app)
    except onesignal.ApiException as e:
        # notify_exception_to_admin('@create_onesignal_app')
        print(e)

`

Steps to reproduce?

1. Try to create an app using create_app

What did you expect to happen?

I expected the API to create an app or provide error messages so that I can fix what the errors that I may have caused.

Relevant log output

Status Code: 500
Reason: Internal Server Error
HTTP response headers: HTTPHeaderDict({'Date': 'Mon, 27 Mar 2023 02:15:57 GMT', 'Content-Type': 'application/json; charset=UTF-8', 'Content-Length': '46', 'Connection': 'keep-alive', 'vary': 'Origin', 'x-request-id': 'f5aae66b-5f6d-4fd3-8c43-d83a1ad72793', 'x-runtime': '0.566735', 'Via': '1.1 google', 'Alt-Svc': 'h3=":443"; ma=86400, h3-29=":443"; ma=86400', 'CF-Cache-Status': 'DYNAMIC', 'Set-Cookie': '__cf_bm=SlqzXoBa8mMnIbGjHADK41NqkpN4E0tIxCY1_C2JaYo-1679883357-0-AZ0xw4NBT3NNt0X9Zl7nb6ODh3XqQpdw2+Eyf7z1Q58kNeHIdZPSaDd1tXQjAAMwLBQBtCDmVayLftoU63GfoAM=; path=/; expires=Mon, 27-Mar-23 02:45:57 GMT; domain=.onesignal.com; HttpOnly; Secure; SameSite=None', 'Strict-Transport-Security': 'max-age=15552000; includeSubDomains', 'Server': 'cloudflare', 'CF-RAY': '7ae420e3aeac4553-CGY'})
HTTP response body: {"status":500,"error":"Internal Server Error"}

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions