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

Issues with Basic Auth #360

Closed
bsundsrud opened this issue May 25, 2020 · 20 comments
Closed

Issues with Basic Auth #360

bsundsrud opened this issue May 25, 2020 · 20 comments
Labels
bug Something isn't working

Comments

@bsundsrud
Copy link
Contributor

I'm trying to get basic auth set up and I have a few issues. I'm not using the dispatch-docker project as I'm trying to deploy to kubernetes.

  1. I've set DISPATCH_AUTHENTICATION_PROVIDER_SLUG=dispatch-auth-provider-basic, I was running into issues with the Vue app not redirecting to /login until I realized I had to set VUE_APP_DISPATCH_AUTHENTICATION_PROVIDER_SLUG at container build time, as well. Even with this, /incidents/report fails to get Type and Priority because the JWT token is not sent to the API, even though it is present in local storage. It seems the Authorization header isn't being set correctly or in all places?

When visiting /incidents/report with a valid token in local storage:

INFO:     172.16.7.67:58766 - "GET /api/v1/incident_priorities/?sortBy[]=view_order&descending[]=false HTTP/1.1" 500 Internal Server Error
ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/uvicorn/protocols/http/httptools_impl.py", line 385, in run_asgi
    result = await app(self.scope, self.receive, self.send)
  File "/usr/local/lib/python3.8/site-packages/uvicorn/middleware/proxy_headers.py", line 45, in __call__
    return await self.app(scope, receive, send)
  File "/usr/local/lib/python3.8/site-packages/starlette/applications.py", line 102, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 181, in __call__
    raise exc from None
  File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 159, in __call__
    await self.app(scope, receive, _send)
  File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 26, in __call__
    await response(scope, receive, send)
  File "/usr/local/lib/python3.8/site-packages/starlette/responses.py", line 197, in __call__
    async for chunk in self.body_iterator:
  File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 56, in body_stream
    task.result()
  File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 38, in coro
    await self.app(scope, receive, send)
  File "/usr/local/lib/python3.8/site-packages/sentry_asgi/middleware.py", line 22, in __call__
    raise exc from None
  File "/usr/local/lib/python3.8/site-packages/sentry_asgi/middleware.py", line 19, in __call__
    await self.app(scope, receive, send)
  File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 26, in __call__
    await response(scope, receive, send)
  File "/usr/local/lib/python3.8/site-packages/starlette/responses.py", line 197, in __call__
    async for chunk in self.body_iterator:
  File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 56, in body_stream
    task.result()
  File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 38, in coro
    await self.app(scope, receive, send)
  File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 26, in __call__
    await response(scope, receive, send)
  File "/usr/local/lib/python3.8/site-packages/starlette/responses.py", line 197, in __call__
    async for chunk in self.body_iterator:
  File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 56, in body_stream
    task.result()
  File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 38, in coro
    await self.app(scope, receive, send)
  File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 82, in __call__
    raise exc from None
  File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 71, in __call__
    await self.app(scope, receive, sender)
  File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 550, in __call__
    await route.handle(scope, receive, send)
  File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 376, in handle
    await self.app(scope, receive, send)
  File "/usr/local/lib/python3.8/site-packages/fastapi/applications.py", line 146, in __call__
    await super().__call__(scope, receive, send)
  File "/usr/local/lib/python3.8/site-packages/starlette/applications.py", line 102, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 181, in __call__
    raise exc from None
  File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 159, in __call__
    await self.app(scope, receive, _send)
  File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 82, in __call__
    raise exc from None
  File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 71, in __call__
    await self.app(scope, receive, sender)
  File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 550, in __call__
    await route.handle(scope, receive, send)
  File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 227, in handle
    await self.app(scope, receive, send)
  File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 41, in app
    response = await func(request)
  File "/usr/local/lib/python3.8/site-packages/fastapi/routing.py", line 186, in app
    solved_result = await solve_dependencies(
  File "/usr/local/lib/python3.8/site-packages/fastapi/dependencies/utils.py", line 520, in solve_dependencies
    solved = await run_in_threadpool(call, **sub_values)
  File "/usr/local/lib/python3.8/site-packages/starlette/concurrency.py", line 34, in run_in_threadpool
    return await loop.run_in_executor(None, func, *args)
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.8/site-packages/dispatch/auth/service.py", line 82, in get_current_user
    return get_or_create(db_session=db_session, user_in=UserRegister(email=user_email))
  File "pydantic/main.py", line 338, in pydantic.main.BaseModel.__init__
pydantic.error_wrappers.ValidationError: 1 validation error for UserRegister
email
  none is not an allowed value (type=type_error.none.not_allowed)
  1. visiting /incidents/report for the first time always redirects to /login

  2. /login redirects to the dashboard on successful login instead of back to the report page, which would confuse users who are just there to report issues.

  3. Is there a way to separate users who are able to access the dashboard vs users who are able to report incidents?

@kevgliss
Copy link
Contributor

kevgliss commented May 28, 2020

I've set DISPATCH_AUTHENTICATION_PROVIDER_SLUG=dispatch-auth-provider-basic, I was running into issues with the Vue app not redirecting to /login until I realized I had to set VUE_APP_DISPATCH_AUTHENTICATION_PROVIDER_SLUG at container build time, as well. Even with this, /incidents/report fails to get Type and Priority because the JWT token is not sent to the API, even though it is present in local storage. It seems the Authorization header isn't being set correctly or in all places?

I've haven't been able to reproduce locally but will take a look.

visiting /incidents/report for the first time always redirects to /login

I have been able to reproduce this and will work on a fix.

/login redirects to the dashboard on successful login instead of back to the report page, which would confuse users who are just there to report issues.

We used to have the default route be /incidents/report but at the end of the day we don't really know why a user is hitting the UI (if they don't specify a route). Internally we use a URL shortener to help with guide users (something like go/securityincident so folks don't even have to know the dispatch URL. If you'd like to make the default configurable we'd be willing to merge that PR.

Is there a way to separate users who are able to access the dashboard vs users who are able to report incidents?

Not today, Dispatch has a limited RBAC facilities that could be expanded but right now we allow folks mostly free-range (except when it comes to restricted incidents).

@kevgliss kevgliss added the bug Something isn't working label May 28, 2020
@bsundsrud
Copy link
Contributor Author

I added a console.log to the interceptor in api.js that looks like it should intercept fetch requests and add the auth header, but it never fired on the /incidents/report page (first load, get types, get priorities seem like they should all have it?). Dashboard routes did trigger the logging/interceptor.

@kevgliss
Copy link
Contributor

Can you see if #371 fixes your redirect issue?

@nitzango
Copy link

nitzango commented Jun 10, 2020

Same problem here. Using basic authentication and getting these errors:

My .env looks like that:

# General
COMPOSE_PROJECT_NAME=dispatch
DISPATCH_HELP_EMAIL=some@user.c0m
DISPATCH_HELP_SLACK_CHANNEL=#general
DISPATCH_UI_URL=http://public_ip

# Authentication
DISPATCH_AUTHENTICATION_PROVIDER_SLUG=dispatch-auth-provider-basic
DISPATCH_JWT_SECRET=SOME_PASSWORD
SECRET_KEY="<AUTO_GENERATED_KEY"

Log:

web_1        | ERROR:    Exception in ASGI application
web_1        | Traceback (most recent call last):
web_1        |   File "/usr/local/lib/python3.8/site-packages/uvicorn/protocols/http/httptools_impl.py", line 385, in run_asgi
web_1        |     result = await app(self.scope, self.receive, self.send)
web_1        |   File "/usr/local/lib/python3.8/site-packages/uvicorn/middleware/proxy_headers.py", line 45, in __call__
web_1        |     return await self.app(scope, receive, send)
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/applications.py", line 102, in __call__
web_1        |     await self.middleware_stack(scope, receive, send)
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 181, in __call__
web_1        |     raise exc from None
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 159, in __call__
web_1        |     await self.app(scope, receive, _send)
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 26, in __call__
web_1        |     await response(scope, receive, send)
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/responses.py", line 197, in __call__
web_1        |     async for chunk in self.body_iterator:
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 56, in body_stream
web_1        |     task.result()
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 38, in coro
web_1        |     await self.app(scope, receive, send)
web_1        |   File "/usr/local/lib/python3.8/site-packages/sentry_asgi/middleware.py", line 22, in __call__
web_1        |     raise exc from None
web_1        |   File "/usr/local/lib/python3.8/site-packages/sentry_asgi/middleware.py", line 19, in __call__
web_1        |     await self.app(scope, receive, send)
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 26, in __call__
web_1        |     await response(scope, receive, send)
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/responses.py", line 197, in __call__
web_1        |     async for chunk in self.body_iterator:
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 56, in body_stream
web_1        |     task.result()
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 38, in coro
web_1        |     await self.app(scope, receive, send)
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 26, in __call__
web_1        |     await response(scope, receive, send)
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/responses.py", line 197, in __call__
web_1        |     async for chunk in self.body_iterator:
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 56, in body_stream
web_1        |     task.result()
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 38, in coro
web_1        |     await self.app(scope, receive, send)
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 82, in __call__
web_1        |     raise exc from None
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 71, in __call__
web_1        |     await self.app(scope, receive, sender)
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 550, in __call__
web_1        |     await route.handle(scope, receive, send)
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 376, in handle
web_1        |     await self.app(scope, receive, send)
web_1        |   File "/usr/local/lib/python3.8/site-packages/fastapi/applications.py", line 146, in __call__
web_1        |     await super().__call__(scope, receive, send)
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/applications.py", line 102, in __call__
web_1        |     await self.middleware_stack(scope, receive, send)
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 181, in __call__
web_1        |     raise exc from None
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 159, in __call__
web_1        |     await self.app(scope, receive, _send)
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 82, in __call__
web_1        |     raise exc from None
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 71, in __call__
web_1        |     await self.app(scope, receive, sender)
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 550, in __call__
web_1        |     await route.handle(scope, receive, send)
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 227, in handle
web_1        |     await self.app(scope, receive, send)
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 41, in app
web_1        |     response = await func(request)
web_1        |   File "/usr/local/lib/python3.8/site-packages/fastapi/routing.py", line 186, in app
web_1        |     solved_result = await solve_dependencies(
web_1        |   File "/usr/local/lib/python3.8/site-packages/fastapi/dependencies/utils.py", line 520, in solve_dependencies
web_1        |     solved = await run_in_threadpool(call, **sub_values)
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/concurrency.py", line 34, in run_in_threadpool
web_1        |     return await loop.run_in_executor(None, func, *args)
web_1        |   File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
web_1        |     result = self.fn(*self.args, **self.kwargs)
web_1        |   File "/usr/local/lib/python3.8/site-packages/dispatch/auth/service.py", line 76, in get_current_user
web_1        |     auth_plugin = plugins.get(DISPATCH_AUTHENTICATION_PROVIDER_SLUG)
web_1        |   File "/usr/local/lib/python3.8/site-packages/dispatch/plugins/base/manager.py", line 43, in get
web_1        |     raise KeyError(slug)
web_1        | KeyError: 'dispatch-auth-provider-basic'

@onekiloparsec
Copy link

Same here (not very useful, I agree). In my case I don't have any data at all (it's a fresh install). And I just can't create any.

@mvilanova
Copy link
Contributor

@nitzango @onekiloparsec I'm not able to repro locally. Is your database on the latest version? Run dispatch database upgrade and try again.

@nitzango
Copy link

Hi @mvilanova,
Just did the docker-compose run web database upgrade and same result. It's important to say that I just did git clone to the docker repo and ran ./install and finished by using the docker-compose up -d. Am I missing anything?

Not sure if it's related, but now I get the following errors:

ERROR:dispatch.common.utils.cli:Failed to load plugin dispatch_basic_auth:Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/dispatch/common/utils/cli.py", line 34, in install_plugins
    plugin = ep.load()
  File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2452, in load
    self.require(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2475, in require
    items = working_set.resolve(reqs, env, installer, extras=self.extras)
  File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 792, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (rsa 4.1 (/usr/local/lib/python3.8/site-packages), Requirement.parse('rsa<4.1,>=3.1.4'), {'google-auth'})

ERROR:dispatch.common.utils.cli:Failed to load plugin dispatch_contact:Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/dispatch/common/utils/cli.py", line 34, in install_plugins
    plugin = ep.load()
  File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2452, in load
    self.require(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2475, in require
    items = working_set.resolve(reqs, env, installer, extras=self.extras)
  File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 792, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (rsa 4.1 (/usr/local/lib/python3.8/site-packages), Requirement.parse('rsa<4.1,>=3.1.4'), {'google-auth'})

ERROR:dispatch.common.utils.cli:Failed to load plugin dispatch_document_resolver:Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/dispatch/common/utils/cli.py", line 34, in install_plugins
    plugin = ep.load()
  File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2452, in load
    self.require(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2475, in require
    items = working_set.resolve(reqs, env, installer, extras=self.extras)
  File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 792, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (rsa 4.1 (/usr/local/lib/python3.8/site-packages), Requirement.parse('rsa<4.1,>=3.1.4'), {'google-auth'})

ERROR:dispatch.common.utils.cli:Failed to load plugin dispatch_participant_resolver:Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/dispatch/common/utils/cli.py", line 34, in install_plugins
    plugin = ep.load()
  File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2452, in load
    self.require(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2475, in require
    items = working_set.resolve(reqs, env, installer, extras=self.extras)
  File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 792, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (rsa 4.1 (/usr/local/lib/python3.8/site-packages), Requirement.parse('rsa<4.1,>=3.1.4'), {'google-auth'})

ERROR:dispatch.common.utils.cli:Failed to load plugin dispatch_pkce_auth:Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/dispatch/common/utils/cli.py", line 34, in install_plugins
    plugin = ep.load()
  File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2452, in load
    self.require(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2475, in require
    items = working_set.resolve(reqs, env, installer, extras=self.extras)
  File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 792, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (rsa 4.1 (/usr/local/lib/python3.8/site-packages), Requirement.parse('rsa<4.1,>=3.1.4'), {'google-auth'})

ERROR:dispatch.common.utils.cli:Failed to load plugin dispatch_ticket:Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/dispatch/common/utils/cli.py", line 34, in install_plugins
    plugin = ep.load()
  File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2452, in load
    self.require(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2475, in require
    items = working_set.resolve(reqs, env, installer, extras=self.extras)
  File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 792, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (rsa 4.1 (/usr/local/lib/python3.8/site-packages), Requirement.parse('rsa<4.1,>=3.1.4'), {'google-auth'})

ERROR:dispatch.common.utils.cli:Failed to load plugin google_calendar_conference:Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/dispatch/common/utils/cli.py", line 34, in install_plugins
    plugin = ep.load()
  File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2452, in load
    self.require(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2475, in require
    items = working_set.resolve(reqs, env, installer, extras=self.extras)
  File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 792, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (rsa 4.1 (/usr/local/lib/python3.8/site-packages), Requirement.parse('rsa<4.1,>=3.1.4'), {'google-auth'})

ERROR:dispatch.common.utils.cli:Failed to load plugin google_docs_document:Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/dispatch/common/utils/cli.py", line 34, in install_plugins
    plugin = ep.load()
  File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2452, in load
    self.require(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2475, in require
    items = working_set.resolve(reqs, env, installer, extras=self.extras)
  File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 792, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (rsa 4.1 (/usr/local/lib/python3.8/site-packages), Requirement.parse('rsa<4.1,>=3.1.4'), {'google-auth'})

ERROR:dispatch.common.utils.cli:Failed to load plugin google_drive_storage:Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/dispatch/common/utils/cli.py", line 34, in install_plugins
    plugin = ep.load()
  File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2452, in load
    self.require(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2475, in require
    items = working_set.resolve(reqs, env, installer, extras=self.extras)
  File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 792, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (rsa 4.1 (/usr/local/lib/python3.8/site-packages), Requirement.parse('rsa<4.1,>=3.1.4'), {'google-auth'})

ERROR:dispatch.common.utils.cli:Failed to load plugin google_drive_task:Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/dispatch/common/utils/cli.py", line 34, in install_plugins
    plugin = ep.load()
  File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2452, in load
    self.require(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2475, in require
    items = working_set.resolve(reqs, env, installer, extras=self.extras)
  File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 792, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (rsa 4.1 (/usr/local/lib/python3.8/site-packages), Requirement.parse('rsa<4.1,>=3.1.4'), {'google-auth'})

ERROR:dispatch.common.utils.cli:Failed to load plugin google_gmail_conversation:Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/dispatch/common/utils/cli.py", line 34, in install_plugins
    plugin = ep.load()
  File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2452, in load
    self.require(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2475, in require
    items = working_set.resolve(reqs, env, installer, extras=self.extras)
  File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 792, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (rsa 4.1 (/usr/local/lib/python3.8/site-packages), Requirement.parse('rsa<4.1,>=3.1.4'), {'google-auth'})

ERROR:dispatch.common.utils.cli:Failed to load plugin google_groups_participants:Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/dispatch/common/utils/cli.py", line 34, in install_plugins
    plugin = ep.load()
  File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2452, in load
    self.require(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2475, in require
    items = working_set.resolve(reqs, env, installer, extras=self.extras)
  File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 792, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (rsa 4.1 (/usr/local/lib/python3.8/site-packages), Requirement.parse('rsa<4.1,>=3.1.4'), {'google-auth'})

ERROR:dispatch.common.utils.cli:Failed to load plugin jira_ticket:Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/dispatch/common/utils/cli.py", line 34, in install_plugins
    plugin = ep.load()
  File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2452, in load
    self.require(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2475, in require
    items = working_set.resolve(reqs, env, installer, extras=self.extras)
  File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 792, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (rsa 4.1 (/usr/local/lib/python3.8/site-packages), Requirement.parse('rsa<4.1,>=3.1.4'), {'google-auth'})

ERROR:dispatch.common.utils.cli:Failed to load plugin opsgenie_oncall:Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/dispatch/common/utils/cli.py", line 34, in install_plugins
    plugin = ep.load()
  File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2452, in load
    self.require(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2475, in require
    items = working_set.resolve(reqs, env, installer, extras=self.extras)
  File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 792, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (rsa 4.1 (/usr/local/lib/python3.8/site-packages), Requirement.parse('rsa<4.1,>=3.1.4'), {'google-auth'})

ERROR:dispatch.common.utils.cli:Failed to load plugin pagerduty_oncall:Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/dispatch/common/utils/cli.py", line 34, in install_plugins
    plugin = ep.load()
  File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2452, in load
    self.require(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2475, in require
    items = working_set.resolve(reqs, env, installer, extras=self.extras)
  File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 792, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (rsa 4.1 (/usr/local/lib/python3.8/site-packages), Requirement.parse('rsa<4.1,>=3.1.4'), {'google-auth'})

ERROR:dispatch.common.utils.cli:Failed to load plugin slack_contact:Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/dispatch/common/utils/cli.py", line 34, in install_plugins
    plugin = ep.load()
  File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2452, in load
    self.require(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2475, in require
    items = working_set.resolve(reqs, env, installer, extras=self.extras)
  File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 792, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (rsa 4.1 (/usr/local/lib/python3.8/site-packages), Requirement.parse('rsa<4.1,>=3.1.4'), {'google-auth'})

ERROR:dispatch.common.utils.cli:Failed to load plugin slack_conversation:Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/dispatch/common/utils/cli.py", line 34, in install_plugins
    plugin = ep.load()
  File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2452, in load
    self.require(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2475, in require
    items = working_set.resolve(reqs, env, installer, extras=self.extras)
  File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 792, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (rsa 4.1 (/usr/local/lib/python3.8/site-packages), Requirement.parse('rsa<4.1,>=3.1.4'), {'google-auth'})

ERROR:dispatch.common.utils.cli:Failed to load plugin zoom_conference:Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/dispatch/common/utils/cli.py", line 34, in install_plugins
    plugin = ep.load()
  File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2452, in load
    self.require(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2475, in require
    items = working_set.resolve(reqs, env, installer, extras=self.extras)
  File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 792, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (rsa 4.1 (/usr/local/lib/python3.8/site-packages), Requirement.parse('rsa<4.1,>=3.1.4'), {'google-auth'})

Thanks for your support!

@nitzango
Copy link

nitzango commented Jun 10, 2020

@nitzango @onekiloparsec I'm not able to repro locally. Is your database on the latest version? Run dispatch database upgrade and try again.

Just to make sure, once I run the ./install.sh it creates the .env (from .env.exaple I assume) - Do I need to change anything in order to do the fresh install? Any pre-configuration on .env are mandatory?

FYI - Just saw this error on the docker image build phase:

ERROR: google-auth 1.16.1 has requirement rsa<4.1,>=3.1.4, but you'll have rsa 4.1 which is incompatible.

@mvilanova
Copy link
Contributor

@nitzango yes, please check the configuration docs. Let us know if there are any missing env vars.

Re: google-auth package error, another user reported the same issue. I'm going to pin rsa to 4.0.

@mvilanova
Copy link
Contributor

@nitzango #435

@nitzango
Copy link

@nitzango yes, please check the configuration docs. Let us know if there are any missing env vars.

Re: google-auth package error, another user reported the same issue. I'm going to pin rsa to 4.0.

Thanks @mvilanova - I went over this doc several times, I can't able to understand what is mandatory. I've added DISPATCH_JWT_SECRET var.

In order to get basic auth and before integrating the other plugin (Slack, Gsuite, Jira, etc) - Is it possible to have a running instance?

Thanks

@kevgliss
Copy link
Contributor

In order to get basic auth and before integrating the other plugin (Slack, Gsuite, Jira, etc) - Is it possible to have a running instance?

It is possible, yes, but you won't be able to create incidents as we don't have internal substitutes for all plugins yet. See #55

Some of the variables are interdependent, e.g. basic auth requires DISPATCH_JWT_SECRET but the other auth flows don't. If it helps we can try to break those up to make them clear. But server log will typically at least emit a warning stating if some interdependent configuration value is not set.

@nitzango
Copy link

nitzango commented Jun 30, 2020

In order to get basic auth and before integrating the other plugin (Slack, Gsuite, Jira, etc) - Is it possible to have a running instance?

It is possible, yes, but you won't be able to create incidents as we don't have internal substitutes for all plugins yet. See #55

Some of the variables are interdependent, e.g. basic auth requires DISPATCH_JWT_SECRET but the other auth flows don't. If it helps we can try to break those up to make them clear. But server log will typically at least emit a warning stating if some interdependent configuration value is not set.

@mvilanova @kevgliss - I got to a point that no matter what I do, even when starting from a fresh install I get this errors. Steps I did:

  1. Clone the repo
  2. Created .env and filled in all necessary details (GSuite, Slack and Jira)
  3. Added DISPATCH_JWT_SECRET and VUE_APP_DISPATCH_AUTHENTICATION_PROVIDER_SLUG=dispatch-auth-provider-basic based on what the guys wrote
  4. Did ./install and after it finished it I did docker-compose up -d
  5. Accessed <DISPATCH_ADDRESS/login and logged in successfully
  6. Browse to <DISPATCH_ADDRESS/incidents/report and then got these errors.
web_1        | INFO:     DEDACTED:63373 - "GET /api/v1/plugins/?q=&page=1&itemsPerPage=10&sortBy[]=slug&descending[]=true HTTP/1.1" 500 Internal Server Error
web_1        | ERROR:    Exception in ASGI application
web_1        | Traceback (most recent call last):
web_1        |   File "/usr/local/lib/python3.8/site-packages/uvicorn/protocols/http/httptools_impl.py", line 385, in run_asgi
web_1        |     result = await app(self.scope, self.receive, self.send)
web_1        |   File "/usr/local/lib/python3.8/site-packages/uvicorn/middleware/proxy_headers.py", line 45, in __call__
web_1        |     return await self.app(scope, receive, send)
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/applications.py", line 102, in __call__
web_1        |     await self.middleware_stack(scope, receive, send)
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 181, in __call__
web_1        |     raise exc from None
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 159, in __call__
web_1        |     await self.app(scope, receive, _send)
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 26, in __call__
web_1        |     await response(scope, receive, send)
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/responses.py", line 222, in __call__
web_1        |     await run_until_first_complete(
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/concurrency.py", line 18, in run_until_first_complete
web_1        |     [task.result() for task in done]
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/concurrency.py", line 18, in <listcomp>
web_1        |     [task.result() for task in done]
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/responses.py", line 214, in stream_response
web_1        |     async for chunk in self.body_iterator:
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 56, in body_stream
web_1        |     task.result()
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 38, in coro
web_1        |     await self.app(scope, receive, send)
web_1        |   File "/usr/local/lib/python3.8/site-packages/sentry_asgi/middleware.py", line 22, in __call__
web_1        |     raise exc from None
web_1        |   File "/usr/local/lib/python3.8/site-packages/sentry_asgi/middleware.py", line 19, in __call__
web_1        |     await self.app(scope, receive, send)
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 26, in __call__
web_1        |     await response(scope, receive, send)
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/responses.py", line 222, in __call__
web_1        |     await run_until_first_complete(
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/concurrency.py", line 18, in run_until_first_complete
web_1        |     [task.result() for task in done]
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/concurrency.py", line 18, in <listcomp>
web_1        |     [task.result() for task in done]
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/responses.py", line 214, in stream_response
web_1        |     async for chunk in self.body_iterator:
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 56, in body_stream
web_1        |     task.result()
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 38, in coro
web_1        |     await self.app(scope, receive, send)
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 26, in __call__
web_1        |     await response(scope, receive, send)
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/responses.py", line 222, in __call__
web_1        |     await run_until_first_complete(
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/concurrency.py", line 18, in run_until_first_complete
web_1        |     [task.result() for task in done]
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/concurrency.py", line 18, in <listcomp>
web_1        |     [task.result() for task in done]
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/responses.py", line 214, in stream_response
web_1        |     async for chunk in self.body_iterator:
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 56, in body_stream
web_1        |     task.result()
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 38, in coro
web_1        |     await self.app(scope, receive, send)
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 82, in __call__
web_1        |     raise exc from None
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 71, in __call__
web_1        |     await self.app(scope, receive, sender)
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 550, in __call__
web_1        |     await route.handle(scope, receive, send)
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 376, in handle
web_1        |     await self.app(scope, receive, send)
web_1        |   File "/usr/local/lib/python3.8/site-packages/fastapi/applications.py", line 171, in __call__
web_1        |     await super().__call__(scope, receive, send)
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/applications.py", line 102, in __call__
web_1        |     await self.middleware_stack(scope, receive, send)
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 181, in __call__
web_1        |     raise exc from None
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 159, in __call__
web_1        |     await self.app(scope, receive, _send)
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 82, in __call__
web_1        |     raise exc from None
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 71, in __call__
web_1        |     await self.app(scope, receive, sender)
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 550, in __call__
web_1        |     await route.handle(scope, receive, send)
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 227, in handle
web_1        |     await self.app(scope, receive, send)
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 41, in app
web_1        |     response = await func(request)
web_1        |   File "/usr/local/lib/python3.8/site-packages/fastapi/routing.py", line 186, in app
web_1        |     solved_result = await solve_dependencies(
web_1        |   File "/usr/local/lib/python3.8/site-packages/fastapi/dependencies/utils.py", line 539, in solve_dependencies
web_1        |     solved = await run_in_threadpool(call, **sub_values)
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/concurrency.py", line 34, in run_in_threadpool
web_1        |     return await loop.run_in_executor(None, func, *args)
web_1        |   File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
web_1        |     result = self.fn(*self.args, **self.kwargs)
web_1        |   File "/usr/local/lib/python3.8/site-packages/dispatch/auth/service.py", line 82, in get_current_user
web_1        |     return get_or_create(db_session=db_session, user_in=UserRegister(email=user_email))
web_1        |   File "pydantic/main.py", line 338, in pydantic.main.BaseModel.__init__
web_1        | pydantic.error_wrappers.ValidationError: 1 validation error for UserRegister
web_1        | email
web_1        |   none is not an allowed value (type=type_error.none.not_allowed)
web_1        | INFO:     82.81.195.5:63378 - "POST /api/v1/auth/login HTTP/1.1" 200 OK
web_1        | INFO:     82.81.195.5:63377 - "GET /api/v1/incident_priorities/ HTTP/1.1" 200 OK
web_1        | INFO:     82.81.195.5:63382 - "GET /api/v1/incidents/metric/forecast/all HTTP/1.1" 200 OK
web_1        | INFO:     82.81.195.5:63378 - "GET /api/v1/incident_types/?itemsPerPage=-1 HTTP/1.1" 200 OK
web_1        | INFO:     82.81.195.5:63383 - "GET /api/v1/incidents/?itemsPerPage=-1&sortBy[]=reported_at&descending[]=false&fields[]=reported_at&fields[]=reported_at&ops[]=%3E%3D&ops[]=%3C%3D&values[]=2019-12-28T22:00:00.000Z&values[]=2020-06-28T21:00:00.000Z HTTP/1.1" 200 OK
web_1        | INFO:     82.81.195.5:63383 - "GET /api/v1/plugins/?q=&page=1&itemsPerPage=10&sortBy[]=slug&descending[]=true HTTP/1.1" 200 OK
web_1        | INFO:     82.81.195.5:63383 - "GET /plugins HTTP/1.1" 200 OK
web_1        | INFO:     82.81.195.5:63383 - "GET /static/m.png HTTP/1.1" 200 OK
web_1        | INFO:     82.81.195.5:63386 - "GET /api/v1/plugins/?q=&page=1&itemsPerPage=10&sortBy[]=slug&descending[]=true HTTP/1.1" 500 Internal Server Error
web_1        | ERROR:    Exception in ASGI application
web_1        | Traceback (most recent call last):
web_1        |   File "/usr/local/lib/python3.8/site-packages/uvicorn/protocols/http/httptools_impl.py", line 385, in run_asgi
web_1        |     result = await app(self.scope, self.receive, self.send)
web_1        |   File "/usr/local/lib/python3.8/site-packages/uvicorn/middleware/proxy_headers.py", line 45, in __call__
web_1        |     return await self.app(scope, receive, send)
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/applications.py", line 102, in __call__
web_1        |     await self.middleware_stack(scope, receive, send)
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 181, in __call__
web_1        |     raise exc from None
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 159, in __call__
web_1        |     await self.app(scope, receive, _send)
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 26, in __call__
web_1        |     await response(scope, receive, send)
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/responses.py", line 222, in __call__
web_1        |     await run_until_first_complete(
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/concurrency.py", line 18, in run_until_first_complete
web_1        |     [task.result() for task in done]
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/concurrency.py", line 18, in <listcomp>
web_1        |     [task.result() for task in done]
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/responses.py", line 214, in stream_response
web_1        |     async for chunk in self.body_iterator:
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 56, in body_stream
web_1        |     task.result()
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 38, in coro
web_1        |     await self.app(scope, receive, send)
web_1        |   File "/usr/local/lib/python3.8/site-packages/sentry_asgi/middleware.py", line 22, in __call__
web_1        |     raise exc from None
web_1        |   File "/usr/local/lib/python3.8/site-packages/sentry_asgi/middleware.py", line 19, in __call__
web_1        |     await self.app(scope, receive, send)
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 26, in __call__
web_1        |     await response(scope, receive, send)
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/responses.py", line 222, in __call__
web_1        |     await run_until_first_complete(
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/concurrency.py", line 18, in run_until_first_complete
web_1        |     [task.result() for task in done]
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/concurrency.py", line 18, in <listcomp>
web_1        |     [task.result() for task in done]
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/responses.py", line 214, in stream_response
web_1        |     async for chunk in self.body_iterator:
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 56, in body_stream
web_1        |     task.result()
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 38, in coro
web_1        |     await self.app(scope, receive, send)
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 26, in __call__
web_1        |     await response(scope, receive, send)
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/responses.py", line 222, in __call__
web_1        |     await run_until_first_complete(
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/concurrency.py", line 18, in run_until_first_complete
web_1        |     [task.result() for task in done]
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/concurrency.py", line 18, in <listcomp>
web_1        |     [task.result() for task in done]
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/responses.py", line 214, in stream_response
web_1        |     async for chunk in self.body_iterator:
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 56, in body_stream
web_1        |     task.result()
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 38, in coro
web_1        |     await self.app(scope, receive, send)
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 82, in __call__
web_1        |     raise exc from None
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 71, in __call__
web_1        |     await self.app(scope, receive, sender)
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 550, in __call__
web_1        |     await route.handle(scope, receive, send)
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 376, in handle
web_1        |     await self.app(scope, receive, send)
web_1        |   File "/usr/local/lib/python3.8/site-packages/fastapi/applications.py", line 171, in __call__
web_1        |     await super().__call__(scope, receive, send)
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/applications.py", line 102, in __call__
web_1        |     await self.middleware_stack(scope, receive, send)
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 181, in __call__
web_1        |     raise exc from None
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 159, in __call__
web_1        |     await self.app(scope, receive, _send)
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 82, in __call__
web_1        |     raise exc from None
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 71, in __call__
web_1        |     await self.app(scope, receive, sender)
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 550, in __call__
web_1        |     await route.handle(scope, receive, send)
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 227, in handle
web_1        |     await self.app(scope, receive, send)
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 41, in app
web_1        |     response = await func(request)
web_1        |   File "/usr/local/lib/python3.8/site-packages/fastapi/routing.py", line 186, in app
web_1        |     solved_result = await solve_dependencies(
web_1        |   File "/usr/local/lib/python3.8/site-packages/fastapi/dependencies/utils.py", line 539, in solve_dependencies
web_1        |     solved = await run_in_threadpool(call, **sub_values)
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/concurrency.py", line 34, in run_in_threadpool
web_1        |     return await loop.run_in_executor(None, func, *args)
web_1        |   File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
web_1        |     result = self.fn(*self.args, **self.kwargs)
web_1        |   File "/usr/local/lib/python3.8/site-packages/dispatch/auth/service.py", line 82, in get_current_user
web_1        |     return get_or_create(db_session=db_session, user_in=UserRegister(email=user_email))
web_1        |   File "pydantic/main.py", line 338, in pydantic.main.BaseModel.__init__
web_1        | pydantic.error_wrappers.ValidationError: 1 validation error for UserRegister
web_1        | email
web_1        |   none is not an allowed value (type=type_error.none.not_allowed)

web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 26, in __call__

@kevgliss
Copy link
Contributor

Try setting:
DISPATCH_AUTHENTICATION_PROVIDER_SLUG=dispatch-auth-provider-basic

instead of:
VUE_APP_DISPATCH_AUTHENTICATION_PROVIDER_SLUG=dispatch-auth-provider-basic.

You don't actually need to set the VUE_APP_ as they just need to match:
https://github.com/Netflix/dispatch/blob/develop/src/dispatch/config.py#L79

Was there some documentation that made you think it needed to be set? If so, we should make that clearer.

@nitzango
Copy link

nitzango commented Jul 2, 2020

Try setting:
DISPATCH_AUTHENTICATION_PROVIDER_SLUG=dispatch-auth-provider-basic

instead of:
VUE_APP_DISPATCH_AUTHENTICATION_PROVIDER_SLUG=dispatch-auth-provider-basic.

You don't actually need to set the VUE_APP_ as they just need to match:
https://github.com/Netflix/dispatch/blob/develop/src/dispatch/config.py#L79

Was there some documentation that made you think it needed to be set? If so, we should make that clearer.

Thanks @kevgliss. I tried it and result is the same.
When I'm logging in, I can see the dashboards filled with data (on homepage), but then after refresh it seems empty (like I was logged out) and then I get this error.

@kevgliss
Copy link
Contributor

kevgliss commented Jul 2, 2020

Okay, that helps, let me see if I can repo locally.

@kylie-sre
Copy link

@nitzango check that you're correctly sending the CORS headers to the Vue app. I encountered the same error as you and determined that the server wasn't sending the CORS headers I had configured with the CORSMiddleware. This was because the frontend code wasn't sending an Origin header with it's requests. By running the Vue app in one process with npm run serve and dispatch in another and accessing the Vue app in the browser solved the issue.

@kevgliss kevgliss closed this as completed Aug 5, 2020
@santhoshparepu
Copy link

@kevgliss I see this issue is closed. I am also encountering the same issue as @nitzango. What is the resolution ?

@kevgliss
Copy link
Contributor

@santhoshparepu a few things have changed since this was first reported, please open a new issue and we can debug there.

@santhoshparepu
Copy link

Thanks @kevgliss, I have opened #584.

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

No branches or pull requests

7 participants