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

Unable to publish note with large pasted-in image #2370

Open
SidharthBansal opened this issue Feb 20, 2018 · 17 comments
Open

Unable to publish note with large pasted-in image #2370

SidharthBansal opened this issue Feb 20, 2018 · 17 comments
Labels
bug the issue is regarding one of our programs which faces problems when a certain task is executed help wanted requires help by anyone willing to contribute JavaScript

Comments

@SidharthBansal
Copy link
Member

Please describe the problem (or idea)

I was trying to edit something in my GSOC proposal but was not able to. So, I deleted it and tried to publish a new research note with same content. But I am unable to publish it.
Following screen comes
image

@SidharthBansal
Copy link
Member Author

Finally, it got published. I tried so many times

@icarito
Copy link
Member

icarito commented Feb 20, 2018

That's strange! We should keep this open and I'll check logs.

@icarito icarito reopened this Feb 20, 2018
@icarito
Copy link
Member

icarito commented Feb 20, 2018

I could only find this error message to help debug, not sure if it's the right one, please check if time matches.

Started GET "/assets/dashboard-79157678e5ab138d58b9a4d64a473230.js" for 182.64.67.145 at 2018-02-20 00:27:12 +0000
Started GET "/assets/print-61d48cbc2491a7eb534ef104fb340509.css" for 182.64.67.145 at 2018-02-20 00:27:12 +0000
Started GET "/profile/Cindy_ExCites" for 68.180.228.107 at 2018-02-20 00:27:12 +0000
Processing by UsersController#profile as */*
  Parameters: {"id"=>"Cindy_ExCites"}
Started GET "/undefined" for 47.30.172.244 at 2018-02-20 00:27:13 +0000
Processing by WikiController#root as */*
  Parameters: {"id"=>"undefined"}
Redirected to https://publiclab.org/wiki/undefined
Completed 302 Found in 16ms (ActiveRecord: 13.6ms)
Started GET "/wiki/undefined" for 47.30.172.244 at 2018-02-20 00:27:13 +0000
Processing by WikiController#show as */*
  Parameters: {"id"=>"undefined"}
  Rendered notes/_notes.html.erb (720.5ms)
  Rendered notes/_coauthored_notes.html.erb (49.7ms)
  Rendered questions/_questions.html.erb (2.1ms)
  Rendered users/_answered.html.erb (0.2ms)
  Rendered tag/_tags.html.erb (1.3ms)
  Rendered tag/_location.html.erb (0.0ms)
  Rendered tag/_tagging.html.erb (2.4ms)
Mysql2::Error: Lock wait timeout exceeded; try restarting transaction: INSERT INTO `node` (`changed`, `comment`, `path`, `title`, `type`, `uid`) VALUES (1519086383, 2, '/notes/bansal_sidharth2996/02-20-2018/gsoc-proposal-oauth-authentication', 'GSOC Proposal: OAuth Authentication', 'note', 503599)
Completed 500 Internal Server Error in 51738ms (ActiveRecord: 51723.1ms)

ActiveRecord::StatementInvalid (Mysql2::Error: Lock wait timeout exceeded; try restarting transaction: INSERT INTO `node` (`changed`, `comment`, `path`, `title`, `type`, `uid`) VALUES (1519086383, 2, '/notes/bansal_sidharth2996/02-20-2018/gsoc-proposal-oauth-authentication', 'GSOC Proposal: OAuth Authentication', 'note', 503599)):
  app/models/node.rb:556:in `block in new_note'
  app/models/node.rb:555:in `new_note'
  app/controllers/notes_controller.rb:100:in `create'

@SidharthBansal
Copy link
Member Author

Yeah this is right

@jywarren
Copy link
Member

jywarren commented Feb 20, 2018 via email

@icarito
Copy link
Member

icarito commented Feb 20, 2018

Possibly we're hitting a database limit of some kind, i'll run an analysis of mysql-slow.log

@SidharthBansal
Copy link
Member Author

SidharthBansal commented Feb 20, 2018

Yes sure , I will try to reproduce in the evening as I am currently in college
I don't know how it got publish

@SidharthBansal SidharthBansal changed the title Unable to public research note on /posts Unable to publish research note on /posts Feb 20, 2018
@SidharthBansal
Copy link
Member Author

I tried to reproduce in the development mode but was unable to.
The server log in the development mode are

Started GET "/assets/notes.js" for 127.0.0.1 at 2018-02-20 20:21:07 +0530

Started GET "/assets/dragdrop.js?body=1" for 127.0.0.1 at 2018-02-20 20:21:07 +0530

Started GET "/assets/sidebar.js?body=1" for 127.0.0.1 at 2018-02-20 20:21:07 +0530

Started GET "/likes/node/80/count?_=1519138267371" for 127.0.0.1 at 2018-02-20 20:21:08 +0530
Processing by LikeController#show as JSON
  Parameters: {"_"=>"1519138267371", "id"=>"80"}
  Node Load (0.2ms)  SELECT  "node".* FROM "node"  WHERE "node"."nid" = ? LIMIT 1  [["nid", 80]]
Completed 200 OK in 5ms (Views: 0.3ms | ActiveRecord: 0.7ms)

I just submit it for around 10 times. When I tried to submit it throught the old legacy view, I was redirected to
image
But in the new legacy view, on clicking on the publish button there was no redirect. It was just trying to publish the note.

@jywarren
Copy link
Member

jywarren commented Feb 20, 2018 via email

@jywarren
Copy link
Member

jywarren commented Feb 20, 2018 via email

@SidharthBansal
Copy link
Member Author

SidharthBansal commented Feb 20, 2018

Also, I have noticed delayed the opening of thehttps://publiclab.org/notes/bansal_sidharth2996/02-20-2018/gsoc-proposal-oauth-authentication?_=1519141316 note proposed by me over the other notes. I don't know why. Is the behaviour same on your computer too?
Tests are present at https://github.com/publiclab/plots2/blob/master/test/unit/node_test.rb

@SidharthBansal
Copy link
Member Author

I have checked the delayed opening of https://publiclab.org/notes/bansal_sidharth2996/02-20-2018/gsoc-proposal-oauth-authentication?_=1519141316 on my Android mobile phone also. It is taking 2-3 minutes while the other notes are not

@SidharthBansal
Copy link
Member Author

I also faced the problem with the new rich wiki editor. On clicking on the publish button, the button fade away but didn't redirect to the newly created page.

@jywarren
Copy link
Member

That's totally true -- goodness, what could possibly be causing that slowness?

OHHHHHH i wonder if it's that you had an image that was DATAURL encoded in there -- i think i saw that in my email inbox. So perhaps it's taking that long to load it... i think perhaps we have to eliminate that image... i think it was pasted in? This is a good bug to try to fix too -- could you open a separate issue for it please? Thanks, @SidharthBansal !!!

@jywarren
Copy link
Member

Actually maybe this is the same issue for both loading and publishing!

@jywarren
Copy link
Member

So -- if you paste in an image, i believe it saves it as an inline data url. This is a behavior in https://github.com/publiclab/PublicLab.Editor and upstream in https://github.com/bevacqua/woofmark -- maybe we should reject this if the image is too big?

But perhaps we just need to prevent this in the plots2 application, because /some/ web applications could possibly handle this, but it's just our back-end database that's having trouble with it?

I imagine it's in part because the document is just too big...

@jywarren jywarren changed the title Unable to publish research note on /posts Unable to publish or quickly open note with large pasted-in image via rich editor Feb 20, 2018
@icarito
Copy link
Member

icarito commented Feb 21, 2018

Yeah I don't think it's a great idea to store images as inline data :-)

@SidharthBansal SidharthBansal changed the title Unable to publish or quickly open note with large pasted-in image via rich editor Unable to publish Feb 22, 2018
@jywarren jywarren changed the title Unable to publish Unable to publish note with large pasted-in image Mar 1, 2018
@jywarren jywarren added bug the issue is regarding one of our programs which faces problems when a certain task is executed help wanted requires help by anyone willing to contribute JavaScript labels Mar 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug the issue is regarding one of our programs which faces problems when a certain task is executed help wanted requires help by anyone willing to contribute JavaScript
Projects
None yet
Development

No branches or pull requests

3 participants