kuma icon indicating copy to clipboard operation
kuma copied to clipboard

Editing user profile with 4-byte characters (e.g. title field) causes ISE

Open krishnadevz opened this issue 4 years ago โ€ข 12 comments

Firefox MDN Web docs after submitting edited profile it is showing internal server error What is the problem? If click on editing my MDN Web docs account then all information/data and changes it taking but when i click on submitting that information browser showing internal server error .i think i have problem with network but i did it twice still it showing me that window .i think submit button is not taking any entries or server is loaded or not taking any inputs .i linked image below please go through with that.๐Ÿ”ฝ thank you krishna kakade

Screenshot (98)

krishnadevz avatar Mar 25 '20 09:03 krishnadevz

Hi @krishnadevz thanks for logging this.

(For those with access it's this one: https://sentry.prod.mozaws.net/operations/mdn-prod/issues/7637581/)

What happened is that you typed into your Title an emojii or some other 4-byte character that our MySQL couldn't cope with.

peterbe avatar Mar 25 '20 13:03 peterbe

i haven't typed anything in title i leave it as it is blank that and after submitting that it is showing me internal server error @peterbe

krishnadevz avatar Mar 26 '20 06:03 krishnadevz

and i did this thing now it is working but i am still opened this issue and after your reply i will close it seems like issue is resolve now .

krishnadevz avatar Mar 26 '20 06:03 krishnadevz

Thanks @krishnadevz It's not your fault. We need to fix our old database. It's tech debt. But I guess it's resolved for you personally, now, right?

peterbe avatar Mar 26 '20 16:03 peterbe

Steps to reproduce:

  1. Go to http://wiki.localhost.org:8000/en-US/profiles/peterbe/edit
  2. Type in ๐Ÿ’ฉ into the "Title" field.
  3. Press "Publish."

peterbe avatar Mar 26 '20 20:03 peterbe

thanks @peterbe Can We close this issue now ?.i think we done and take care baby is cute๐Ÿ˜Š๐Ÿ•บ

krishnadevz avatar Mar 27 '20 06:03 krishnadevz

thanks @peterbe Can We close this issue now ?.i think we done and take care baby is cute๐Ÿ˜Š๐Ÿ•บ

We can't. You helped us uncover the problem deeper in our database. The immediate solution for you would be to change what you're attempting to save. However, if you don't like the noise of this GitHub issue you can unsubscribe. From now on, we'll use this issue to discuss the problem with the database. Are you OK with that?

peterbe avatar Mar 27 '20 11:03 peterbe

yes i am okay but i am able to edit now . and it is good know how things work in mdn i am not going to unsubscribe it .๐Ÿ˜Šโš™

krishnadevz avatar Mar 27 '20 12:03 krishnadevz

I was able to fix this. At least in mysql inside docker-compose. Screen Shot 2020-03-27 at 4 54 06 PM

So there's hope!

peterbe avatar Mar 27 '20 20:03 peterbe

Note to self; after a lot of experimenting and scripting I was able to make this: https://gist.github.com/peterbe/432198400e88d49da9ca68ad251ad767 After running that on my mysql inside docker-compose I was able to use 4-byte Unicode everywhere. But sadly, it doesn't work on the production database because some rows either can't handle the shrinking or they'd reduce what was unique to same values which breaks some uniqueness constraints.

Also, note-to-self; Here's how you find out the columnt types of a table:

select * from information_schema.columns where table_name= 'attachments_attachmentrevision';

and here's how you find out which of those are indexed:

SHOW INDEX FROM attachments_attachmentrevision FROM developer_mozilla_org;

And here's the hacky incomplete script I used to make those SQL statements: https://gist.github.com/peterbe/4865cec256dab5c68076c6b3a8c8fba8

peterbe avatar Mar 30 '20 13:03 peterbe

Sentry issue: MDN-PROD-13Z

tobinmori avatar Apr 30 '20 20:04 tobinmori

Sentry issue: MDN-PROD-14C

tobinmori avatar Apr 30 '20 20:04 tobinmori