Josh Greenhalgh

    Josh Greenhalgh

    1 year ago
    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
    nicholas

    nicholas

    1 year ago
    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
    ?
    Josh Greenhalgh

    Josh Greenhalgh

    1 year ago
    Yep! Thats it! Thanks!
    nicholas

    nicholas

    1 year ago
    Great! 😄
    Josh Greenhalgh

    Josh Greenhalgh

    1 year ago
    So why didn't it completely error out?
    Seems like a bad idea to register it and then throw the error?
    nicholas

    nicholas

    1 year ago
    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)
    Josh Greenhalgh

    Josh Greenhalgh

    1 year ago
    Thanks anyway!
    nicholas

    nicholas

    1 year ago
    In other words: the error didn't impact registration but rather a different query the client was trying to make