Hi, I couldn't create a tenant, and got this error...
# ask-community
e
Hi, I couldn't create a tenant, and got this error when running 'prefect server create-tenant -n default'. raise ClientError(result["errors"]) prefect.exceptions.ClientError: [{'message': "[{'extensions': {'path': '$', 'code': 'validation-failed'}, 'message': 'no mutations exist'}]", 'locations': [{'line': 2, 'column': 5}], 'path': ['create_tenant'], 'extensions': {'code': 'INTERNAL_SERVER_ERROR', 'exception': {'message': "[{'extensions': {'path': '$', 'code': 'validation-failed'}, 'message': 'no mutations exist'}]"}}}]
k
What is the output when you do
prefect diagnostics
?
e
{  "config_overrides": {    "server": {      "host": true,      "ui": {        "apollo_url": true      }    }  },  "env_vars": [],  "system_information": {    "platform": "Linux-3.10.0-1160.45.1.el7.x86_64-x86_64-with-glibc2.10",    "prefect_backend": "server",    "prefect_version": "0.15.9",    "python_version": "3.8.5"{  "config_overrides": {    "server": {      "host": true,      "ui": {        "apollo_url": true      }    }  },  "env_vars": [],  "system_information": {    "platform": "Linux-3.10.0-1160.45.1.el7.x86_64-x86_64-with-glibc2.10",    "prefect_backend": "server",    "prefect_version": "0.15.9",    "python_version": "3.8.5"
k
How did you start your server?
prefect server start
?
e
i use docker stack deploy to start all the services, but got this error when do server start: raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '['docker-compose', 'down']' returned non-zero exit status 1.
k
I see, I think your API might still be down, which is why the tenant creation fails?
e
you mean graphql?
k
Yes. I think a good way to test is spinning up an agent?
e
wouldn't that require a tenant? i got this when do prefect agent start local: The following error messages were provided by the GraphQL server:      GRAPHQL_VALIDATION_FAILED: Cannot query field "tenant" on type "Query".   The GraphQL query was:      query {            tenant {                id        }    }   The passed variables were:      nullThe following error messages were provided by the GraphQL server:      GRAPHQL_VALIDATION_FAILED: Cannot query field "tenant" on type "Query".   The GraphQL query was:      query {            tenant {                id        }    }   The passed variables were:      null
k
Ah I see. Will task the team about this
e
ok, thank you, do you need my server config?
k
I dont think so for now
e
ok, please keep posted, appreciate it
keep me posted*
k
Can you try upgrading your database like this?
e
so you suggest stopping all my services now and follow the steps here?
k
Yes because we need to run the database migrations and apply the Hasura metadata
e
ok, i have multiple versions for these images, do i need to specify versions when do prefect-server dev services -i apollo,graphql?
k
I don’t think so. You need to run this on the GraphQL container that you are using
e
so prefect-server dev infrastructure ran into the same error: raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '['docker-compose', 'down']' returned non-zero exit status 1.
k
Ok I’ll need to find someone who can help better than me
e
thank you
z
Hi, the error on docker-compose down isn’t relevant. That just means there were no containers to tear down on exit.
How are you starting your server?
prefect-server dev infrastructure
is just for development.
e
hi, i use docker swarm to start service, and when they are all up and running, i tried to do prefect server start
z
prefect server start
generates docker-compose yaml then starts all the services with
docker-compose
You’d be attempting to run all the services twice if you do as described.
Running the server in docker swarm is not supported.
You can generate the
docker-compose
yaml by using
prefect server config
but this is an advanced use-case.
e
ok so i don't need to do prefect server start. i already created docker-compose.yml, so i really need to do is docker-compose -f <path-to-yml>/docker-compose.yml up -d?
z
Yes, but from the errors you described above it seems likely that your docker-compose is missing some steps. Notably, the graphql container runs database migrations e.g.
Copy code
graphql:
    command: bash -c "prefect-server database upgrade -y && python src/prefect_server/services/graphql/server.py"
and
prefect server start
creates the default tenant for you which you’d need to do with
prefect server create-tenant --name default --slug default
e
i don't have prefect-server database upgrade -y in my yml file, that could have caused problem
another associated question, i was working on different versions of prefect (e.g., 0.15.10, 0.15.5) and hasura (e.g., 2.0.10, 1.3.3). my intention was to use the most recent ones, but with 0.15.10 + 2.0.10, i am able to see my registered flows on UI dashboard even i can find them by searching in search box
k
I think we only support 1.3.3
z
Yes, Hasura 2.0 has breaking changes and we do not support it.
e
i meant to say "i am not able to", but ok i think you answered my question