https://prefect.io logo
m

Maura Drabik

10/28/2020, 6:22 PM
Hello, I'm trying to register an updated flow to the cloud using Prefect version 0.12.3
Copy code
scm_validation.register(
    project_name="SCM Validation",
    build=True
)
it failed with this error message:
prefect.utilities.exceptions.ClientError: [{'path': ['project'], 'message': 'field "project" not found in type: \'query_root\'', 'extensions': {'path': '$.selectionSet.project', 'code': 'validation-failed', 'exception': {'message': 'field "project" not found in type: \'query_root\''}}}]
j

josh

10/28/2020, 6:32 PM
Hi @Maura Drabik just for clarification are you registering your flow against Prefect Cloud or Prefect Server?
m

Maura Drabik

10/28/2020, 6:44 PM
Hi @josh - Prefect Cloud
j

josh

10/28/2020, 6:54 PM
It looks like this could be cause by an improperly used token. How exactly are you authenticating with Prefect Cloud? If you generated a Personal Access Token (
USER
) then you should use that with the command
prefect auth login
before attempting to register a flow. If you are setting the token manually either through a Client or a config variable then you will need to make sure the token is scoped to a tenant. More info on token types here 🙂
m

Maura Drabik

10/30/2020, 4:45 PM
Hi @josh I'm using a Personal Access Token and I tried to run
prefect auth login
and it said
Auth token already present in config. Aborted!
I see on the UI that my token was last used when I tried to register the flow, but still received the error above.
j

josh

10/30/2020, 4:45 PM
Could you run
prefect diagnostics
and send the output?
m

Maura Drabik

10/30/2020, 4:50 PM
Copy code
{
  "config_overrides": {
    "cloud": {
      "auth_token": true,
      "use_local_secrets": true
    },
    "context": {
      "secrets": false
    }
  },
  "env_vars": [],
  "system_information": {
    "platform": "Windows-10-10.0.18362-SP0",
    "prefect_version": "0.12.3",
    "python_version": "3.6.6"
  }
}
j

josh

10/30/2020, 4:50 PM
According to that output you have a token manually set in your
~/.prefect/config.toml
which will override other tokens. Remove that token then attempt to login again
m

Maura Drabik

10/30/2020, 4:56 PM
working now! thanks so much