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

KPI Report fails with error: ValueError: invalid literal for int() with base 10: 'None' #242

Closed
green3g opened this issue Apr 10, 2021 · 3 comments

Comments

@green3g
Copy link

green3g commented Apr 10, 2021

Hi, I'm running into an issue with Kobo when accessing the endpoint for the report. When I navigate to the KPI UI for "Reports" I see a request to the URL that times out with error 504

/reports/<Form ID>/?names=

I got into the docker container for KPI and I'm seeing the following logs:

ValueError: invalid literal for int() with base 10: 'None'
WARNING:root:invalid literal for int() with base 10: 'None'
Traceback (most recent call last):
  File "/opt/venv/src/formpack/src/formpack/reporting/autoreport.py", line 76, in _calculate_stats
    values = list(field.parse_values(raw_value))
  File "/opt/venv/src/formpack/src/formpack/schema/fields.py", line 504, in parse_values
    yield int(raw_values)
ValueError: invalid literal for int() with base 10: 'None'
WARNING:root:invalid literal for int() with base 10: 'None'
Traceback (most recent call last):
  File "/opt/venv/src/formpack/src/formpack/reporting/autoreport.py", line 76, in _calculate_stats
    values = list(field.parse_values(raw_value))
  File "/opt/venv/src/formpack/src/formpack/schema/fields.py", line 504, in parse_values
    yield int(raw_values)
ValueError: invalid literal for int() with base 10: 'None'

Let me know if I can provide more information to help troubleshoot this.

@green3g
Copy link
Author

green3g commented Apr 10, 2021

Upon further investigation - it appears that this error is not actually causing a crash. But it does result in a 504 gateway timeout for some reason. While watching the logs I get that same error printed dozens of times. The request eventually fails, and eventually I see the logs output:

DAMN ! worker 1 (pid: 123) died, killed by signal 9 :( trying respawn ...
Respawned uWSGI worker 1 (new pid: 130)
worker 2 killed successfully (pid: 128)
uWSGI worker 2 cheaped.

@green3g
Copy link
Author

green3g commented Apr 11, 2021

Okay - I narrowed this down a little further after investigating the docker containers.

It looks like we have two cases that are causing issues:

  1. literal text of None values in the form fields that are set to int
  2. Decimal values in the form fields that are set to int

After discovering this - I think its actually quite related to the issue: #151

@green3g
Copy link
Author

green3g commented May 10, 2021

One final comment - to wrap this up -

Turns out the issue does not crash the server - but the python server does eventually kill the thread due to the request timing out. The large number of errors being logged apparently slows down the request and makes the server kill the thread.

Closing as a duplicate of 151

@green3g green3g closed this as completed May 10, 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

1 participant