Hello, I am trying to run the tutorial for prefect...
# ask-community
d
Hello, I am trying to run the tutorial for prefect cloud
Copy code
In [1]: import prefect
   ...: from prefect import task, Flow
   ...:
   ...: @task
   ...: def say_hello():
   ...:     logger = prefect.context.get("logger")
   ...:     <http://logger.info|logger.info>("Hello, Cloud!")
   ...:
   ...: with Flow("hello-flow") as flow:
   ...:     say_hello()
   ...:
   ...: # Register the flow under the "tutorial" project
   ...: flow.register(project_name="tutorial")
but get
Copy code
ClientError: [{'path': ['user'], 'message': 'field "user" not found in type: \'query_root\'', 'extensions': {'path': '$.selectionSet.user', 'code': 'validation-failed', 'exception': {'message': 'field "user" not found in type: \'query_root\''}}}]
k
Hi @Damien Ramunno-Johnson! How did you authenticate?
d
no_url=True
does seem to make it work.
prefect agent start --name "laptop" --token *****
to start the agent, and then used the same token as
export PREFECT__CLOUD__AUTH_TOKEN=****
k
What version of Prefect are you on?
Do you have an old token by any chance?
d
prefect 0.14.17
I am using the token from the getting started page. I had done this with the free version of cloud yesterday, but just switched on a trial enterprise account. And I did see that one difference is the API is deprecated. Maybe I can try with a service account token?
k
Yes could you create one and authenticate that way?
Could you link me to the token on the getting started page?
a
@Damien Ramunno-Johnson - @George Coyne and I are open if you want to jump on a quick zoom to discuss.
d
Thanks for the offer @Anthony Head It is all working now. It looks like the token on the getting started page updated to a new token. So once I used a token I made with the service account everything worked without complaint
2
g
👍