d0m3n1
d0m3n1

Reputation: 1

Always 404 on kfp 2.0.1

I was using kfp==2.0.0b12 and everything was working great. But as soon as i got into 2.0.1 I am always getting 404 when trying to use methods from client, like this:

kfp_server_api.exceptions.ApiException: (404)
Reason: Not Found
HTTP response headers: HTTPHeaderDict({'x-powered-by': 'Express', 'content-security-policy': "default-src 'none'", 'x-content-type-options': 'nosniff', 'content-type': 'text/html; charset=utf-8', 'content-length': '170', 'date': 'Mon, 28 Aug 2023 23:52:33 GMT', 'x-envoy-upstream-service-time': '2', 'server': 'istio-envoy'})
HTTP response body: <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<pre>Cannot GET /pipeline/apis/v2beta1/pipelines</pre>
</body>
</html>

I am using: kfp==2.0.1 kfp-pipeline-spec==0.2.2 kfp-server-api==2.0.1

I am creating the client this way:

session = requests.Session()
    response = session.get(HOST)

    headers = {
        "Content-Type": "application/x-www-form-urlencoded",
    }

    data = {"login": USERNAME, "password": PASSWORD}
    session.post(response.url, headers=headers, data=data)
    return session.cookies.get_dict()["authservice_session"]
client = Client(host=f"{HOST}/pipeline",
                    cookies=f"authservice_session={session_cookie}",
                    namespace=NAMESPACE)
return client

If i try something simple like this: client.list_pipelines()

I am always getting the 404 error msg. What am I doing wrong here? I have not changed anything from 2.0.0b12 to this one, except from the libs version.

Upvotes: 0

Views: 381

Answers (1)

khituras
khituras

Reputation: 1091

As you said in you comment that the Kfp backend version 2.0.0-alpha.7, recommend you update the backend to 2.0.0 release version and then use Kfp SDK >= 2.0.0. we had the very same error (404 when trying to connect to the Kfp backend via SDK 2.0.1 and 2.1.3) and this went away by updating all the Kfp images in our Kubeflow manifests to version 2.0.0. Then, Kfp SDK v1.8.22 and >= 2.0.0 work perfectly with the client.

Since we use Kfp from within our Kubeflow cluster, we didn’t need to specify the host when creating the client, by the way. If you use a Kfp stand-alone installation, you will have to, of course.

Upvotes: 0

Related Questions