Docker Community Forums

Share and learn in the Docker community.

Unable to docker scan: "failed to get DockerScanID"

Hello

I am new to docker and have studied “Get started”.

I did everything exactly before the vulnerability scan (Image-building best practices | Docker Documentation).

When I execute <$ sudo docker scan second-time>, I get the error <failed to get DockerScanID: bad status code “400 Bad Request”>

is my image.

OS Version: Ubuntu 20.04.

First, I did everything according to the instructions (Orientation and setup | Docker Documentation).

When I got to , I got an error.

I thought that maybe something broke during the experiments. Therefore, I completely removed the docker, deleted the account on the “Docker Hub”.

After that:

  • installed docker from repository

  • downloaded the app

  • created Dockerfile

  • executed <$ sudo docker build -t second-time . >

  • created a new docker account and public repository

  • executed <$ sudo docker login -u My_account_at_dockerhub >

  • executed <$ sudo docker tag second-time My_account_at_dockerhub/second-time>

  • executed <$ sudo docker push My_account_at_dockerhub/second-time>

  • on “Docker Hub” in the repository I see the image

  • I execute <$ sudo docker scan second-time>

and I get the error <failed to get DockerScanID: bad status code “400 Bad Request”>

  • trying <$ sudo docker scan My_account_at_dockerhub/second-time>

and getting the same error.

I could not find a solution to this problem anywhere, so I decided to write here.

Sincerely, Maris

This is just a guess but is it possible you reached the limit of the monthly free Docker scan? The limit is 10 per month.

I haven’t been able to scan even once. But, perhaps, I somehow reached my limit. Can I see how many requests were counted by Docker Hub?

I don’t know but I got the same error when I was not logged in with

docker scan --login

It opened a webbrowser to authenticate. Afther that I could run docker scan without any error.

3 Likes

Thank you very much! It really helped.

I also had the same experience. Once I authenticated, as you suggested, it worked just fine. Thank you!

The same thing
Thanks