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

Hydra -sqlite image should be used when dsn is set to memory #367

Closed
6 tasks done
mrtndwrd opened this issue Nov 12, 2021 · 3 comments · Fixed by #372
Closed
6 tasks done

Hydra -sqlite image should be used when dsn is set to memory #367

mrtndwrd opened this issue Nov 12, 2021 · 3 comments · Fixed by #372
Labels
bug Something is not working. good first issue A good issue to tackle when being a novice to the project.

Comments

@mrtndwrd
Copy link

Preflight checklist

Describe the bug

When I run helm install with hydra.config.dsn set to memory, I expect this to work. But the container crashloops with the following message in the log:

time=2021-11-12T11:11:49Z level=fatal msg=Unable to create service registry. audience=application error=map[message:the DSN connection string looks like a SQLite connection, but SQLite support was not built into the binary. Please check if you have downloaded the correct binary or are using the correct Docker Image. Binary archives and Docker Images indicate SQLite support by appending the -sqlite suffix] service_name=ORY Hydra service_version=v1.10.5

It appears that the in-memory database is based on SQLite, but that is not included in this chart's default image. I think the solution would be to optionally add -sqlite to the image tag in this chart.

Reproducing the bug

  1. helm repo add ory https://k8s.ory.sh/helm/charts
  2. helm repo update
  3. As suggested in the docs:
    helm install \
     --set 'hydra.config.secrets.system={'$(LC_ALL=C tr -dc 'A-Za-z0-9' < /dev/urandom | base64 | head -c 32)'}' \
     --set 'hydra.config.dsn=memory' \
     --set 'hydra.config.urls.self.issuer=https://my-hydra/' \
     --set 'hydra.config.urls.login=https://my-idp/login' \
     --set 'hydra.config.urls.consent=https://my-idp/consent' \
     hydra-test \
     ory/hydra
    

Relevant log output

kubectl logs hydra-test-6548bc5bc8-4rwc9
time=2021-11-12T13:09:46Z level=fatal msg=Unable to create service registry. audience=application error=map[message:the DSN connection string looks like a SQLite connection, but SQLite support was not built into the binary. Please check if you have downloaded the correct binary or are using the correct Docker Image. Binary archives and Docker Images indicate SQLite support by appending the -sqlite suffix] service_name=ORY Hydra service_version=v1.10.5


### Relevant configuration

```yml
hydra:
  config:
    dsn: memory

Version

Hydra Chart 0.20.2

On which operating system are you observing this issue?

Linux

In which environment are you deploying?

Kubernetes with Helm

Additional Context

No response

@mrtndwrd mrtndwrd added the bug Something is not working. label Nov 12, 2021
@aeneasr
Copy link
Member

aeneasr commented Nov 12, 2021

dsn: memory is really only for local testing. It won't work well in Kubernetes, so we don't want to encourage it. Just scaling hydra to two nodes with dsn: memory and you will end up with two databases! So I think this a nofix because it encourages behavior which is not suitable for a Kubernetes environment :/

@mrtndwrd
Copy link
Author

mrtndwrd commented Nov 12, 2021

Thanks for the quick reply!

I see your reasoning. We're currently running super small Kubernetes environments. At what point (how many users?) is an admin expected to scale up to two Hydra pods? I have the feeling that this would be pretty helpful for my use case...

If it's a nofix: at least the documentation should be updated. The issue description includes a copy-paste of the installation instructions which I would expect to work.

@aeneasr
Copy link
Member

aeneasr commented Nov 12, 2021

That makes sense, would be awesome if you could contribute that to the docs :)

Production should always use at least two pods to ensure rolling restarts and other kubernetes/cloud-native deployment methodologies are working.

@Demonsthere Demonsthere added docs good first issue A good issue to tackle when being a novice to the project. labels Nov 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working. good first issue A good issue to tackle when being a novice to the project.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants