Skip to main content
Seasoned ⭐️⭐️⭐️
September 11, 2025
Solved

Deploying function to CDF

Hello,

I am going through the Hands-On exercise of Cognite Functions and trying to run the code as per Notebook 2 (Deploying a Cognite Function via the SDK). I was able to create the handler function but deploying the function to CDF is throwing a Runtime Error ‘Could not retrieve the file from files API’ as shown below:

Can you please help me with this? As you can see below the handle function is created successfully so I’m not sure what’s going wrong.

 

VarunairAnswer
Seasoned ⭐️⭐️⭐️
September 12, 2025

Hello Sofie,

I found the issue, I had to change the runtime from py39 to py311.

2 replies

Sofie Haug
Expert ⭐️⭐️⭐️⭐️
Cognite Academy Instructor
September 11, 2025

Hi ​@Varunair 

Since it mentions this as a RunTimeError, have you tried to re-run the command? 

Sofie | Cognite Academy
VarunairAuthorAnswer
Seasoned ⭐️⭐️⭐️
September 12, 2025

Hello Sofie,

I found the issue, I had to change the runtime from py39 to py311.