Question

Followed serverless guide but failed to get same results

I was following the guide on creating and deploying a serverless function: https://docs.digitalocean.com/products/functions/how-to/create-functions/

  • I created a token as per https://docs.digitalocean.com/reference/api/create-personal-access-token/
  • I installed doctl by using the wget method for Linux (also tried this whole process on a Mac using brew, just to be sure)
  • $ doctl auth init with the API token was successful
  • I created a namespace: $ doctl serverless namespaces create --label "meowchik" --region ams and got the output Connected to functions namespace 'fn-0cafc14a-fc8b-4197-8b9c-ac9f6618429c' on API host 'https://faas-ams3-2a2df116.doserverless.co'
  • I initialized a test project using $ doctl serverless init --language js meowchik-project and got the output A local functions project directory 'meowchik-project' was created for you. You may deploy it by running the command shown on the next line: doctl serverless deploy meowchik-project
  • However when deploying it I get an error: $ doctl serverless deploy meowchik-project/ Error: Invalid project configuration file (project.yml): http request failed: GET https://faas-ams3-2a2df116.doserverless.co/api/v1 Learn more about the project configuration file https://docs.digitalocean.com/products/functions/reference/project-configuration/

I can further isolate this by showing this weird interaction:

  1. $ doctl serverless connect helloworldns -> Connected to functions namespace 'fn-1f1df919-32ed-45fd-97f5-82400fd6a65e' on API host 'https://faas-fra1-afec6ce7.doserverless.co' (label=helloworldns)
  2. $ doctl serverless status -> Error: serverless support is installed but not connected to a functions namespace (use 'doctl serverless connect')

I’m pretty confused and not sure what to do about this. I haven’t changed any configuration or the project.yml file, everything is pretty much default and followed step by step according to the guide.


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Bobby Iliev
Site Moderator
Site Moderator badge
April 2, 2024

Hi there,

The issue with doctl serverless connect and doctl serverless status showing a disconnect might indicate a problem with the doctl tool. What is the version that you are currently using?

doctl version

I’ve just tested this with 1.105.0-release and it seems to be working as expected. If you are not running the latest version, I could suggest trying to upgrade to the latest one.

Also, if you were to run doctl serverless namespaces list do you see the correct namespace listed there?

Best,

Bobby

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Featured on Community

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel