https://prefect.io logo
Title
j

Josh Greenhalgh

03/12/2021, 6:16 PM
Hi Again; I am running into the following error when registering flows on CI (works perfectly from my local machine);
prefect.utilities.exceptions.ClientError: 400 Client Error: Bad Request for url: http://<REDACTED>:4200/graphql

The following error messages were provided by the GraphQL server:

    GRAPHQL_VALIDATION_FAILED: Cannot query field "user" on type "Query".

The GraphQL query was:

    query {
            user {
                default_membership {
                    tenant {
                        slug
                }
            }
        }
    }

The passed variables were:

    null
The flow is registered - new version becomes available but the exception obvs fails my CI
There is a gh issue thats similar - but was supposed to have been fixed (but also it doesn't happen locally...) https://github.com/PrefectHQ/prefect/issues/4179
n

nicholas

03/12/2021, 6:31 PM
My guess here would be that the CI process running the Prefect commands needs to know it's pointed at a Server instance and not Cloud
Locally you likely have the config all sorted but it's possible that the CI process doesn't have the correct config
As part of that CI, are you running
prefect backend server
?
j

Josh Greenhalgh

03/12/2021, 6:40 PM
Yep! Thats it! Thanks!
n

nicholas

03/12/2021, 6:41 PM
Great! 😄
j

Josh Greenhalgh

03/12/2021, 6:41 PM
So why didn't it completely error out?
Seems like a bad idea to register it and then throw the error?
n

nicholas

03/12/2021, 6:42 PM
Hm that part I'm not certain of; it's possible the other parts of the config are fine but this was a downstream fetching of the user (which doesn't exist in Server)
j

Josh Greenhalgh

03/12/2021, 6:42 PM
Thanks anyway!
n

nicholas

03/12/2021, 6:42 PM
In other words: the error didn't impact registration but rather a different query the client was trying to make