digitalocean / doctl

The official command line interface for the DigitalOcean API.
https://docs.digitalocean.com/reference/doctl/
Apache License 2.0
3.22k stars 382 forks source link

"Unexpected end Of JSON input" error doing `doctl serverless deploy`. #1345

Open gurleensethi opened 1 year ago

gurleensethi commented 1 year ago

Describe the Issue:

Getting the following error when trying to deploy to DigitialOcean functions using doctl.

$ doctl serverless deploy do-fn-go-playground --verbose  --verbose-build
Error: unexpected end of JSON input

Environment:

Additional Details:

I asked the same question on DigitialOcean Community Questions where you can find more details.

bobbyiliev commented 1 year ago

Some additional details here from the question linked above:

Ok, so installing from source (via go install) works. I think there might be something buggy in the latest release. Tired running via the provided doctl Docker image and got the same error, whereas when I tried to set up an alpine Docker image and installed doctl from the source it worked. So there is something going on when you make the release binary.

jackofsometrade commented 1 year ago

Similar issue here, doctl provides no details so it's very difficult to debug.

gurleensethi commented 1 year ago

@jackofsometrade Try installing by go install ... it should work.

Make sure to remove the installation from brew before that.

mifraburneo commented 4 months ago

I'm having the same issue. I'm on a 22.04 ubuntu docker container inside my Mac. I've installed the ARM version and still. How come there's no answer to this after a year?

bobbyiliev commented 4 months ago

@mifraburneo what is the version that you are using?

I've tested this with the latest version on Mac and it works as expected:

doctl version     
doctl version 1.104.0-release

Also what is the exact Docker image that you are using?

mifraburneo commented 4 months ago

@bobbyiliev I used ubuntu:22.04 from Docker Hub. It did worked after installing golang and then building it with go install... though

CThaw90 commented 2 months ago

Any update here? I'm running into the same exact issue attempting to run doctl serverless deploy using the digitalocean/doctl image on Docker Hub.

bobbyiliev commented 2 months ago

@CThaw90 Can you confirm the exact OS that you are running the Docker container on?

CThaw90 commented 2 months ago

@bobbyiliev Running on both macOS Sonoma 14.4.1 and Ubuntu 22.04 yields same error result. I am actually running the ubuntu-22.04 from github actions runner.

CThaw90 commented 2 months ago

@bobbyiliev Among further investigation this seems like it's an issue solely with the docker image. I just downloaded the doctl binary directly to the actions runner and was able to use ./doctl serverless deploy with no issues, same with directly downloading on macOS. It seems running the commands with https://hub.docker.com/r/digitalocean/doctl causes the errors.