-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
cli: running cli migrations image as non root user will not have cli-ext installed #4651
Comments
Hey, @jchonde thanks for reporting this!
Was able to reproduce this! I was not setting the |
Hey @jchonde, this was caused because a plugin, This happened because,
The catch here is that It's installed in Heroku, however, runs the container as a non root user, so the CLI when trying to find the plugin will not find it under The CLI is intelligent enough to download plugins which are not present, But this is not enabled in As a workaround, what you can do is set the following environment variable.
This will enable downloading plugins which are not present and everything should work just fine 😄 As a side note, the contents of
|
Thanks @scriptonist really appreciated! |
The workaround sorted me out as well! Many thanks indeed :) |
Is this related?:
|
I'm also running into a similar issue after trying the workaround from above:
|
I'm having the error in openshift. By default container in openshift are also not permitted to run as root but get assigned a random user (id). |
Got it @hoeggi, this is very helpful. Will look into it. |
I also had issues with the old v1 migrations in openshift but i managed to work around them by updaing the entrypoint script. In case this helps, see: #3824 |
@scriptonist Yes, it was on Heroku for me. The following cli-ext error seems not to be an issue now though. Once I had double checked all the settings and restarted the dyno a couple times, it seemed to correct itself. |
Thanks for the input @adav, this will really help. |
@hoeggi we have some pointers regarding this in the following comment #4105 (comment) |
Not sure if it is directly related. In #4105 (comment) it seems to be the missing Further down it is mentioned that it might be some missing glibc stuff, but if that was the case it would also fail if run as root. |
This is interesting, |
Anyone manage to make migrations work with Heroku? I have my server set to HASURA_GRAPHQL_CLI_ENVIRONMENT=default and it copied the migrations and metadata folder properly but when I go to the server, that was freshly made, there are no tables imported from the migration. Edit: Managed to make it work with this repo that I forked from OP's test repo: https://github.com/joshuarobs/obscure-hamlet-63320 |
Hello @scriptonist . Is it normal? |
Hi guys, is this something that's currently being worked on or should I try to make it work by forking the repo mentioned above? Although, my error is slightly different:
Looks like the |
Hey @surges, this is currently being worked on, will update here once a fix lands. |
In case someone needs this, here is how I got it working in openshift without running as root: Dockerfile: https://gist.github.com/hoeggi/9c771249fd9d22f1421c0ddaa473d7c0#file-dockerfile Since openshift by default assigns a random user/uid when creating the container |
Hey, this was a similar issue #4953, can you folks see if this is related? @surges @loiclegoff |
@scriptonist that error certainly looks the same but the command there works fine for me and I don't have any |
@hoeggi I had the same issue.
The Dockerfile you pointed to is in the |
The workaround works fine. |
@scriptonist I understand an official solution is being worked on, but I have no idea how to use the workaround in the meantime. I'm trying to add hasura-cli to an all-purpose docker image which I use in gitlab for build/test scripts. As you can see, I download the cli directly from gitlab, then try to install the plugin. Seems like it works at that point.
output of
but then when I try to run hasura-cli inside the image:
|
But then this will require an internet connection, right? It's common to see airgapped OpenShift installations, in which case the |
…age as a non root user (close hasura#4651 close hasura#5333) (hasura#5306) hasura#5306
…age as a non root user (close hasura#4651 close hasura#5333) (hasura#5306) hasura#5306
The custom Docker image based on ubuntu:focal which was introduced as a workaround for the user bug hasura/graphql-engine#4651 can be removed because it has been fixed (hasura/graphql-engine@4e4e3f3).
Hello Hasura team,
This is what happen on a fresh dockerized Heroku application with
image hasura/graphql-engine:latest.cli-migrations-v2
Here is what I am trying to deploy:
repo
https://github.com/jchonde/obscure-hamlet-63320
env vars:
logs
...
Thanks guys. Keep up the awesome work.
The text was updated successfully, but these errors were encountered: