Nathan Atkins

    Nathan Atkins

    1 year ago
    Glad to be back doing some work with Prefect. I can see a lot has changed since I was last working with it. I'm having some problems with
    prefect
    commands against my local server. I guess it could be a installation or configuration problem, but debugging makes it look like there is an issue with initializing Client objects to talk to the local server. Specifically:
    prefect create project my_project
    and
    flow.register(project_name='tutorial')
    Both generate
    prefect.utilities.exceptions.ClientError: Malformed response received from API.
    errors. If I debug both problems I wind up in
    prefect.client.Client.___init___()
    where it looks like it sets the api_server to the cloud host because no
    api_server
    is passed in. I have the backend set to to
    server
    . In
    prefect.cli.create.project()
    Client().create_project(project_name=name, project_description=description)
    it looks like the
    api_server=localhost
    needs to be passed to
    Client.___init___()
    or Client needs to do something other than
    self.api_server = api_server or prefect.context.config.cloud.get("graphql")
    Same issue in
    prefect.core.flow.py
    I can connect to the server fine from my local browser or through cloud.prefect.io switched to the local server. (Nice feature by the way.)
    Jim Crist-Harif

    Jim Crist-Harif

    1 year ago
    Hi Nathan, what version of prefect server do you have deployed, and what version of prefect are you using to interact with it? Those commands work fine for me, I'm wondering if you have a version mismatch.
    Nathan Atkins

    Nathan Atkins

    1 year ago
    Prefect 0.14.6 Not sure where to check the server version. It is whatever came along with the installation of 14.6. I have to think it is something on my end as if this is broken there would be lots of other people having the problem. I'll see if I can carve out some time to try it on another computer this afternoon. That should at least separate out environment issues.
    Jim Crist-Harif

    Jim Crist-Harif

    1 year ago
    If you use
    prefect server start
    to startup prefect server, the server version should match that of prefect (so also 0.14.6). If you figure out any more details of this issue, please let me know. It is indeed odd that you're having this issue.
    Did you run
    prefect backend server
    ?
    Nathan Atkins

    Nathan Atkins

    1 year ago
    Yes, ~/.prefect/backend.toml
    backend = "server"
    I can see that is getting through in the configuration when I debug
    Client.___init___()
    It just goes on to set the host to the cloud.
    Jim Crist-Harif

    Jim Crist-Harif

    1 year ago
    Hmmm, that's odd. Have you changed your
    ~/.prefect/config.toml
    at all?
    Nathan Atkins

    Nathan Atkins

    1 year ago
    Just added the auth_token
    If I do a brand new install, set the backend to server, start the server and try and create a project it gets this error.
    Good news bad news. Looks like a personal problem. I fired it up on a clean Mac and everything works fine. Now to figure out what is up with my Ubuntu machine.
    All set. Thanks for asking the questions and keeping me going in the right direction. It looks like I had an old config.toml in my ~/.prefect directory that was getting overlaid on the on in the prefect installation and that was causing the problem.
    Jim Crist-Harif

    Jim Crist-Harif

    1 year ago
    Excellent, glad to hear you got things working.