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

DataError: invalid input syntax for type inet #56

Open
AlexxxH opened this issue May 6, 2021 · 0 comments
Open

DataError: invalid input syntax for type inet #56

AlexxxH opened this issue May 6, 2021 · 0 comments

Comments

@AlexxxH
Copy link
Contributor

AlexxxH commented May 6, 2021

Request headers from some services, e.g. Google Cloud, include a list of IP addresses in the REMOTE_ADDR field. When the log information is saved to the logging table an error occurs as the format of the IP field does not match type inet in the database table. This causes an error and the information is not saved.

I've made a pull request with a proposed fix: #55
#55

Traceback below, with IP addresses blanked out:

Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)

The above exception (invalid input syntax for type inet: "xx.xx.xx.xx, yyy.yyy.yyy.yy"
LINE 1: ...DataView', 'get', 'xx.xx.xx....
^
) was the direct cause of the following exception:
File "/usr/local/lib/python3.9/site-packages/rest_framework_tracking/base_mixins.py", line 83, in finalize_response
self.handle_log()
File "/usr/local/lib/python3.9/site-packages/rest_framework_tracking/mixins.py", line 12, in handle_log
APIRequestLog(**self.log).save()
File "/usr/local/lib/python3.9/site-packages/django/db/models/base.py", line 750, in save
self.save_base(using=using, force_insert=force_insert,
...

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