Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: could not convert string to float #15

Closed
glermaidt opened this issue Mar 30, 2021 · 6 comments
Closed

Error: could not convert string to float #15

glermaidt opened this issue Mar 30, 2021 · 6 comments

Comments

@glermaidt
Copy link

glermaidt commented Mar 30, 2021

Running tag 1.15. Receving this in the container logs:

HTTP Headers START
Content-Length: 2782
Content-Type: application/vnd.docker.distribution.manifest.v1+prettyjws
Docker-Content-Digest: sha256:767a3815c34823b355bed31760d5fa3daca0aec2ce15b217c9cd83229e0e2020
Docker-Distribution-Api-Version: registry/2.0
Etag: "sha256:767a3815c34823b355bed31760d5fa3daca0aec2ce15b217c9cd83229e0e2020"
Date: Tue, 30 Mar 2021 17:04:21 GMT
Strict-Transport-Security: max-age=31536000
RateLimit-Limit: ;w=21600
RateLimit-Remaining: ;w=21600
HTTP Headers END
Notice: Extracting limit from string: ;w=21600
Notice: Extracting limit from string: ;w=21600
Notice: Using Docker Hub credentials for 'idtdevops'
Notice: Response token:'{"token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsIng1YyI6WyJNSUlDK1RDQ0FwK2dBd0lCQWdJQkFEQUtCZ2dxaGtqT1BRUURBakJHTVVRd1FnWURWUVFERXp0U1RVbEdPbEZNUmpRNlEwZFFNenBSTWtWYU9sRklSRUk2VkVkRlZUcFZTRlZNT2taTVZqUTZSMGRXV2pwQk5WUkhPbFJMTkZNNlVVeElTVEFlRncweU1UQXhNalV5TXpFMU1EQmFGdzB5TWpBeE1qVXlNekUxTURCYU1FWXhSREJDQmdOVkJBTVRPMVZQU1ZJNlJFMUpWVHBZVlZKUk9rdFdRVXc2U2twTFZ6cExORkpGT2tWT1RFczZRMWRGVERwRVNrOUlPbEpYTjFjNlRrUktWRHBWV0U1WU1JSUJJakFOQmdrcWhraUc5dzBCQVFFRkF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VsaW1pdHByZXZpZXcvdGVzdCIsImFjdGlvbnMiOlsicHVsbCJdfV0sImF1ZCI6InJlZ2lzdHJ5LmRvY2tlci5pbyIsImV4cCI6MTYxNzEyNDE2OCwiaWF0IjoxNjE3MTIzODY4LCJpc3MiOiJhdXRoLmRvY2tlci5pbyIsImp0aSI6IjV5NDhEcVExWVRoLXpETkZ6Z2l2IiwibmJmIjoxNjE3MTIzNTY4LCJzdWIiOiI3MDEzZWVjZi1iMTMyLTQzNDAtYTc5Mi02ODM0ZWQzOWQ4YzAifQ.Wars9Mzhj1Kkmhv5EydfF8o6IrhStQHNgLs7McVnjNxZaJsm2w-rs1DZgUoav7FnBcd9pQPKC2aQJRtKmko3MyfIkdGa59o5_sU2Q3hPDxCtGFg9wzwCKHeBUDt6Ziq5ZuVbnwb-QnuVuCj36_9mdBf2up8pGGc1MqSnO2u6L8xZd2JboUHYQH29oCtoumBo9hKtejS0l5--kYe2z2CZ_Yi1IHf54TAUwvL6U59J2wzu-uAk2iV-s8C9XVH5t0s_INOEPvW7Ev5meQrjsdDd-K-4sKyqpFUei07-cntwUtF7-aYEeJ-_t1-vUtqKSWZ5bJVeVFMg77MHbzIp2TBi9g", "expires_in": 300, "issued_at": "2021-03-30T17:04:28.84025098Z"}'
HTTP Headers START
Content-Length: 2782
Content-Type: application/vnd.docker.distribution.manifest.v1+prettyjws
Docker-Content-Digest: sha256:767a3815c34823b355bed31760d5fa3daca0aec2ce15b217c9cd83229e0e2020
Docker-Distribution-Api-Version: registry/2.0
Etag: "sha256:767a3815c34823b355bed31760d5fa3daca0aec2ce15b217c9cd83229e0e2020"
Date: Tue, 30 Mar 2021 17:04:28 GMT
Strict-Transport-Security: max-age=31536000
RateLimit-Limit: ;w=21600
RateLimit-Remaining: ;w=21600
HTTP Headers END
Notice: Extracting limit from string: ;w=21600
Notice: Extracting limit from string: ;w=21600
Notice: Using Docker Hub credentials for 'idtdevops'
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/wsgiref/handlers.py", line 137, in run
    self.result = application(self.environ, self.start_response)
  File "/usr/local/lib/python3.9/site-packages/prometheus_client/exposition.py", line 53, in prometheus_app
    status, header, output = _bake_output(registry, accept_header, params)
  File "/usr/local/lib/python3.9/site-packages/prometheus_client/exposition.py", line 41, in _bake_output
    output = encoder(registry)
  File "/usr/local/lib/python3.9/site-packages/prometheus_client/exposition.py", line 138, in generate_latest
    output.append(sample_line(s))
  File "/usr/local/lib/python3.9/site-packages/prometheus_client/exposition.py", line 104, in sample_line
    line.name, labelstr, floatToGoString(line.value), timestamp)
  File "/usr/local/lib/python3.9/site-packages/prometheus_client/utils.py", line 9, in floatToGoString
    d = float(d)
ValueError: ("could not convert string to float: ''", Metric(dockerhub_limit_remaining_requests_total, Docker Hub Rate Limit Remaining Requests, gauge, , [Sample(name='dockerhub_limit_remaining_requests_total', labels={'limit': 'remaining_requests_total'}, value='', timestamp=None, exemplar=None)]))

It seems there is no numeric value being retrieved using my authenticated user.

Notice: Extracting limit from string: ;w=21600
Notice: Extracting limit from string: ;w=21600

Let me know if you need further info.

@TJM
Copy link
Contributor

TJM commented Mar 30, 2021

I am seeing the same thing with anonymous...
running chart version 0.2.6, or container viadee/docker-hub-rate-limit-exporter:version-1.5

HTTP Headers START
Content-Length: 2782
Content-Type: application/vnd.docker.distribution.manifest.v1+prettyjws
Docker-Content-Digest: sha256:767a3815c34823b355bed31760d5fa3daca0aec2ce15b217c9cd83229e0e2020
Docker-Distribution-Api-Version: registry/2.0
Etag: "sha256:767a3815c34823b355bed31760d5fa3daca0aec2ce15b217c9cd83229e0e2020"
Date: Tue, 30 Mar 2021 23:17:12 GMT
Strict-Transport-Security: max-age=31536000
RateLimit-Limit: ;w=21600
RateLimit-Remaining: ;w=21600
HTTP Headers END
Notice: Extracting limit from string: ;w=21600
Notice: Extracting limit from string: ;w=21600
Notice: Using anonymous Docker Hub token
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/wsgiref/handlers.py", line 137, in run
    self.result = application(self.environ, self.start_response)
  File "/usr/local/lib/python3.9/site-packages/prometheus_client/exposition.py", line 53, in prometheus_app
    status, header, output = _bake_output(registry, accept_header, params)
  File "/usr/local/lib/python3.9/site-packages/prometheus_client/exposition.py", line 41, in _bake_output
    output = encoder(registry)
  File "/usr/local/lib/python3.9/site-packages/prometheus_client/exposition.py", line 138, in generate_latest
    output.append(sample_line(s))
  File "/usr/local/lib/python3.9/site-packages/prometheus_client/exposition.py", line 104, in sample_line
    line.name, labelstr, floatToGoString(line.value), timestamp)
  File "/usr/local/lib/python3.9/site-packages/prometheus_client/utils.py", line 9, in floatToGoString
    d = float(d)
ValueError: ("could not convert string to float: ''", Metric(dockerhub_limit_remaining_requests_total, Docker Hub Rate Limit Remaining Requests, gauge, , [Sample(name='dockerhub_limit_remaining_requests_total', labels={'limit': 'remaining_requests_total'}, value='', timestamp=None, exemplar=None)]))
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/wsgiref/handlers.py", line 137, in run
    self.result = application(self.environ, self.start_response)
  File "/usr/local/lib/python3.9/site-packages/prometheus_client/exposition.py", line 53, in prometheus_app
    status, header, output = _bake_output(registry, accept_header, params)
  File "/usr/local/lib/python3.9/site-packages/prometheus_client/exposition.py", line 41, in _bake_output
    output = encoder(registry)
  File "/usr/local/lib/python3.9/site-packages/prometheus_client/exposition.py", line 138, in generate_latest
    output.append(sample_line(s))
  File "/usr/local/lib/python3.9/site-packages/prometheus_client/exposition.py", line 104, in sample_line
    line.name, labelstr, floatToGoString(line.value), timestamp)
  File "/usr/local/lib/python3.9/site-packages/prometheus_client/utils.py", line 9, in floatToGoString
    d = float(d)
ValueError: ("could not convert string to float: ''", Metric(dockerhub_limit_remaining_requests_total, Docker Hub Rate Limit Remaining Requests, gauge, , [Sample(name='dockerhub_limit_remaining_requests_total', labels={'limit': 'remaining_requests_total'}, value='', timestamp=None, exemplar=None)]))

The headers do not contain a rate limit... did they turn that off?

[tmcneely@local admin-tools] $ TOKEN=$(curl -Ss "https://auth.docker.io/token?service=registry.docker.io&scope=repository:ratelimitpreview/test:pull" | jq -r .token)
[tmcneely@local admin-tools] $ curl --head -H "Authorization: Bearer $TOKEN" https://registry-1.docker.io/v2/ratelimitpreview/test/manifests/latest
HTTP/1.1 200 OK
Content-Length: 2782
Content-Type: application/vnd.docker.distribution.manifest.v1+prettyjws
Docker-Content-Digest: sha256:767a3815c34823b355bed31760d5fa3daca0aec2ce15b217c9cd83229e0e2020
Docker-Distribution-Api-Version: registry/2.0
Etag: "sha256:767a3815c34823b355bed31760d5fa3daca0aec2ce15b217c9cd83229e0e2020"
Date: Tue, 30 Mar 2021 23:30:06 GMT
Strict-Transport-Security: max-age=31536000
RateLimit-Limit: ;w=21600
RateLimit-Remaining: ;w=21600

@prostohant
Copy link

prostohant commented Mar 31, 2021

Looks like it works time to time
test@test ~ $ curl --head -H "Authorization: Bearer $TOKEN" https://registry-1.docker.io/v2/ratelimitpreview/test/manifests/latest 2>&1 | grep RateLimi
RateLimit-Limit: ;w=21600
RateLimit-Limit: ;w=21600
test@test ~ $ curl --head -H "Authorization: Bearer $TOKEN" https://registry-1.docker.io/v2/ratelimitpreview/test/manifests/latest 2>&1 | grep RateLimit
RateLimit-Limit: ;w=21600
RateLimit-Remaining: ;w=21600
test@test ~ $ curl --head -H "Authorization: Bearer $TOKEN" https://registry-1.docker.io/v2/ratelimitpreview/test/manifests/latest 2>&1 | grep RateLimit
RateLimit-Limit: 100;w=21600
RateLimit-Remaining: 100;w=21600
test@test ~ $ curl --head -H "Authorization: Bearer $TOKEN" https://registry-1.docker.io/v2/ratelimitpreview/test/manifests/latest 2>&1 | grep RateLimit
RateLimit-Limit: ;w=21600
RateLimit-Remaining: ;w=21600

@mstein11
Copy link
Contributor

Sorry for the late reply, I have been quite busy recently.

It seems the error has disappeared? Can somebody confirm that it's working again for them?

@mstein11
Copy link
Contributor

Wait, it seems the behavior described here is the same as in #6, right? I think what happened here is that docker hub had an issue with their api, which resulted in the problem described in #6 to occur permanently for some time?

Can somebody confirm this guess?

@immanuelfodor
Copy link

Yes, the API seems to be fixed now, it's always returning results. For details, see this comment: #6 (comment)

@mstein11
Copy link
Contributor

Duplicate of #6

@mstein11 mstein11 marked this as a duplicate of #6 Apr 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants