Daniil Ponizov

    Daniil Ponizov

    11 months ago
    hello! Am I able to attach cloud hook to all flows in project? or group flows to one cloud hook somehow
    Anna Geller

    Anna Geller

    11 months ago
    @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
    Daniil Ponizov

    Daniil Ponizov

    11 months ago
    @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?
    Anna Geller

    Anna Geller

    11 months ago
    Are you using Prefect Cloud or Prefect Server? Automations is a Cloud-only feature.
    Daniil Ponizov

    Daniil Ponizov

    11 months ago
    because last time, when i need to restart prefect server all flows have been detached
    I'm using Prefect server
    Anna Geller

    Anna Geller

    11 months ago
    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.
    Daniil Ponizov

    Daniil Ponizov

    11 months ago
    Where is this metadata store and how to migrate it to new server?
    Anna Geller

    Anna Geller

    11 months ago
    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
    Daniil Ponizov

    Daniil Ponizov

    11 months ago
    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
    Anna Geller

    Anna Geller

    11 months ago
    maybe you can create a tenant?
    prefect server create-tenant --name default --slug default
    Daniil Ponizov

    Daniil Ponizov

    11 months ago
    @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.'}}}]
    Anna Geller

    Anna Geller

    11 months ago
    can it be that you have multiple agents doing the same work?
    Daniil Ponizov

    Daniil Ponizov

    11 months ago
    No, now I have only one agent
    Anna Geller

    Anna Geller

    11 months ago
    you could have a look at this thread, the error message looks similar https://prefect-community.slack.com/archives/CL09KU1K7/p1634730215153300
    Daniil Ponizov

    Daniil Ponizov

    11 months ago
    @Anna Geller error from this thread is about multiple agents run, but I have only one active agent
    Anna Geller

    Anna Geller

    11 months ago
    are you still at the uniqueness violation error? Perhaps you can choose a different tenant name or slug?
    Daniil Ponizov

    Daniil Ponizov

    11 months ago
    Different name fix the problem, but still get the same problem when trying to add cloud hook
    Kevin Kho

    Kevin Kho

    11 months ago
    Hey Daniil, what Prefect version are you on and have you been able to run flows successfully on server?
    Anna Geller

    Anna Geller

    11 months ago
    @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?
    Daniil Ponizov

    Daniil Ponizov

    11 months ago
    @Anna Geller I'm creating it from the UI
    Jenny

    Jenny

    11 months ago
    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?
    Daniil Ponizov

    Daniil Ponizov

    11 months ago
    @Jenny I was trying to create web cloud hook with Failed state
    Jenny

    Jenny

    11 months ago
    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?
    Daniil Ponizov

    Daniil Ponizov

    11 months ago
    All flows works correctly and now the problem fixed by itself