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: value too long for type character varying(190) #179

Closed
tripliks opened this issue Jun 9, 2017 · 11 comments
Closed

DataError: value too long for type character varying(190) #179

tripliks opened this issue Jun 9, 2017 · 11 comments

Comments

@tripliks
Copy link

tripliks commented Jun 9, 2017

Hello,

I'm getting this exception for long urls ie. /resource/<jwt_token>. Looks like the limit is 190 chars.
Is there a way to have long urls logged?

@avelis
Copy link
Collaborator

avelis commented Jun 13, 2017

@tripliks Sorry for the delay. The short answer is no and not for the foreseeable future.

URL fields are indexed values in the library. However, to be MySQL ut8mb4 compliant the indexed column can't support values longer than 190 characters. You can see more details on the conversation about this issue here: #38

Ultimately, v1.0.0 went forward with 190 char limit.

@avelis
Copy link
Collaborator

avelis commented Jun 13, 2017

@tripliks You could tail strip out values longer than 190 via a pre_save signal I believe. Not the best solution but a workaround of sorts.

@avelis
Copy link
Collaborator

avelis commented Jun 22, 2017

@tripliks Unless there is more of an action to take I am looking at closing this issue.

@marcoaurelioneto
Copy link

We had been the same problem with it:

image

@gdelnegro
Copy link

To expand on @marcoaurelioneto report, we are using Django v1.11.2, django-silk v1.0.0, PostgreSQL 9.4.12 and psycopg2 v2.7.1

@avelis
Copy link
Collaborator

avelis commented Nov 4, 2017

@marcoaurelioneto You could tail strip out values longer than 190 via a pre_save signal I believe. Not the best solution but a workaround of sorts.

@avelis
Copy link
Collaborator

avelis commented Nov 4, 2017

@gdelnegro The 190 character limit is an intended limit due to MySQL support. The best I can suggest is to tail strip out url values over the 190 character limit via a pre_save signal.

@pmontu
Copy link

pmontu commented Feb 13, 2018

I face the same issue with a different long url having a few uuid4s.

@smaccona
Copy link
Collaborator

Silk should make a sane path that fits in the 190 character limit to avoid breaking users' applications. I will open a PR.

@marcoaurelioneto
Copy link

In our case we were able to solve the problem by requesting the POST method.

@smaccona
Copy link
Collaborator

smaccona commented Oct 23, 2018

@avelis apologies for delay, rebased PR is #314 when you get a chance, tests are passing now. Thanks!

smaccona added a commit to smaccona/django-silk that referenced this issue Oct 26, 2018
MySQL index restrictions prevent us from having path or view_name be longer than 190 characters (see jazzband#38), but there is no logic in the Request object to enforce this limit when saving, so long URLs cause a 500 error.

Closes jazzband#179.
avelis pushed a commit that referenced this issue Oct 28, 2018
MySQL index restrictions prevent us from having path or view_name be longer than 190 characters (see #38), but there is no logic in the Request object to enforce this limit when saving, so long URLs cause a 500 error.

Closes #179.
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

6 participants