Title
d

Daniil Ponizov

10/21/2021, 1:39 PM
hello! Am I able to attach cloud hook to all flows in project? or group flows to one cloud hook somehow
a

Anna Geller

10/21/2021, 1:50 PM
@Daniil Ponizov yes, I think you can do that using Automations in the in the UI Automations page. In the example below, I’m selecting all flows from the project called “community” and choosing to send me an email any time any FlowRun in this project fails
d

Daniil Ponizov

10/21/2021, 1:53 PM
@Anna Geller Is that a some new feature? I've installed prefect recently and dont see this option in UI
Also I want to ask, is there any option to bind all flows to prefect server after restart?
a

Anna Geller

10/21/2021, 1:54 PM
Are you using Prefect Cloud or Prefect Server? Automations is a Cloud-only feature.
d

Daniil Ponizov

10/21/2021, 1:54 PM
because last time, when i need to restart prefect server all flows have been detached
I'm using Prefect server
a

Anna Geller

10/21/2021, 1:56 PM
hmm what do you mean by binding flows to the server? when you register your flow, this triggers a GraphQL API call which stores the flow’s metadata in the backend. If you want to later migrate to a new Server instance, you have to make sure to persist and migrate your data as well.
d

Daniil Ponizov

10/21/2021, 1:57 PM
Where is this metadata store and how to migrate it to new server?
a

Anna Geller

10/21/2021, 2:02 PM
it’s stored in your Postgres database. If you use the default configuration (prefect server start), then it gets deployed as a docker container. Usually, you would have to perform migration of your database and upgrade:
prefect-server database upgrade
I think this guide written by Laura Lorenz can be helpful: https://coda.io/@lauralorenz-at-prefect/devops-guide-to-a-perfect-prefect-server Especially this part: https://coda.io/@lauralorenz-at-prefect/devops-guide-to-a-perfect-prefect-server/how-do-i-upgrade-prefect-server-13
d

Daniil Ponizov

10/21/2021, 2:11 PM
thanks a lot!
@Anna Geller I'm trying to add new cloud hook and get this error
Variable "$input" got invalid value null at "input.tenant_id"; Expected non-nullable type UUID! not to be null
a

Anna Geller

10/21/2021, 2:20 PM
maybe you can create a tenant?
prefect server create-tenant --name default --slug default
d

Daniil Ponizov

10/21/2021, 2:23 PM
@Anna Geller now I get this error
prefect.exceptions.ClientError: [{'message': 'Uniqueness violation.', 'locations': [{'line': 2, 'column': 5}], 'path': ['create_tenant'], 'extensions': {'code': 'INTERNAL_SERVER_ERROR', 'exception': {'message': 'Uniqueness violation.'}}}]
a

Anna Geller

10/21/2021, 2:24 PM
can it be that you have multiple agents doing the same work?
d

Daniil Ponizov

10/21/2021, 2:24 PM
No, now I have only one agent
a

Anna Geller

10/21/2021, 2:25 PM
you could have a look at this thread, the error message looks similar https://prefect-community.slack.com/archives/CL09KU1K7/p1634730215153300
d

Daniil Ponizov

10/21/2021, 2:46 PM
@Anna Geller error from this thread is about multiple agents run, but I have only one active agent
a

Anna Geller

10/21/2021, 2:51 PM
are you still at the uniqueness violation error? Perhaps you can choose a different tenant name or slug?
d

Daniil Ponizov

10/21/2021, 2:55 PM
Different name fix the problem, but still get the same problem when trying to add cloud hook
k

Kevin Kho

10/21/2021, 3:06 PM
Hey Daniil, what Prefect version are you on and have you been able to run flows successfully on server?
a

Anna Geller

10/21/2021, 3:22 PM
@Daniil Ponizov I reached out to the team and this error indicates that you did not provide the tenant id when creating the Cloud Hook, and this is a required input argument to the
create_cloud_hook
mutation. Are you creating this hook from the UI or via API?
d

Daniil Ponizov

10/22/2021, 6:33 PM
@Anna Geller I'm creating it from the UI
j

Jenny

10/22/2021, 6:36 PM
Hi @Daniil Ponizov - I'm from the UI team so let me see if I can help here. As a summary, you are trying to create a cloud_hook from the UI in server but you're getting an error saying
Variable "$input" got invalid value null at "input.tenant_id"; Expected non-nullable type UUID! not to be null
- is that correct?
Can you give some more info about the type of cloud hook you are trying to create? And what steps you have taken before you get that error?
d

Daniil Ponizov

10/24/2021, 5:18 PM
@Jenny I was trying to create web cloud hook with Failed state
j

Jenny

10/24/2021, 5:23 PM
Ok. And did you create that with the UI from server? Are you flows showing correctly in the server UI? And all your flow runs?
Were you using the flow settings page?
d

Daniil Ponizov

10/25/2021, 9:49 AM
All flows works correctly and now the problem fixed by itself
👍 2