Pedro Machado

    Pedro Machado

    2 years ago
    Hi there. I am trying to register a flow for the second time and I am getting this error message:
    Traceback (most recent call last):
      File "/home/pedro/prefect/my_flow.py", line 187, in <module>
        flow.register(project_name="myproject", labels=["aws"])
      File "/home/pedro/.venvs/prefect/lib/python3.7/site-packages/prefect/core/flow.py", line 1581, in register
        no_url=no_url,
      File "/home/pedro/.venvs/prefect/lib/python3.7/site-packages/prefect/client/client.py", line 668, in register
        project = self.graphql(query_project).data.project  # type: ignore
      File "/home/pedro/.venvs/prefect/lib/python3.7/site-packages/prefect/client/client.py", line 238, in graphql
        raise ClientError(result["errors"])
    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\''}}}]
    Any ideas?
    I am using vs code. I reloaded the window and when I tried to re-run the script, it worked fine.
    nicholas

    nicholas

    2 years ago
    Hi @Pedro Machado - it looks like you're running this against Server, which doesn't have projects
    Pedro Machado

    Pedro Machado

    2 years ago
    It's running against cloud.
    nicholas

    nicholas

    2 years ago
    @Pedro Machado sorry for the slow reply - can you confirm your Prefect config by running
    prefect diagnostics
    ?
    Pedro Machado

    Pedro Machado

    2 years ago
    Hi Nicholas. Here is the output:
    {
      "config_overrides": {},
      "env_vars": [],
      "system_information": {
        "platform": "Linux-4.19.121-microsoft-standard-x86_64-with-debian-buster-sid",
        "prefect_version": "0.12.6",
        "python_version": "3.7.6"
      }
    }
    Keep in mind that the subsequent registration worked fine when I reloaded VS Code so I no longer have the issue, but I could not tell why I was getting the error. I tried to run the same graphql query and got a response back. I can't tell what was happening during the time the registration was failing.
    nicholas

    nicholas

    2 years ago
    Ah ok, my thought is that VSCode was either pulling in Prefect from a different location (one that was defaulting to Server) or it was bungling authentication somehow. If you see that again, feel free to give me a shout and we'll see if we can get to the bottom of it