Plots2: Unable to publish note with large pasted-in image

Created on 20 Feb 2018  Â·  17Comments  Â·  Source: publiclab/plots2

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

JavaScript bug help wanted

All 17 comments

Finally, it got published. I tried so many times

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

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'

Yeah this is right

Oh no! Could you try to reproduce this and save the text that causes it? Do
you know what you did to get it to work?

On Feb 19, 2018 10:57 PM, "Sebastian Silva" notifications@github.com
wrote:

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:innew_note'
app/controllers/notes_controller.rb:100:in `create'

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/publiclab/plots2/issues/2370#issuecomment-366860458,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AABfJ6RQisrtqiiIrj4mkejfNjh0vd2oks5tWkKKgaJpZM4SLRnP
.

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

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

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.

ah, so is POST on the legacy form broken? Do we have a test for this? Does
it fail consistently?

On Tue, Feb 20, 2018 at 9:56 AM, Sidharth Bansal notifications@github.com
wrote:

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: image]
https://user-images.githubusercontent.com/20972099/36430857-23906b5a-167c-11e8-9c2a-a9cbea933bcb.png
But in the new legacy view, on clicking on the publish button there was no
redirect. It was just trying to publish the note.

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/publiclab/plots2/issues/2370#issuecomment-367003102,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AABfJ78ptGrQNq3RZec2RtS-yNni3ihhks5tWt0MgaJpZM4SLRnP
.

I just saved this page with the legacy form, so the error is not
consistent:
https://publiclab.org/notes/warren/11-08-2016/help-public-lab-s-software-grow-by-joining-a-supportive-team

On Tue, Feb 20, 2018 at 10:17 AM, Jeffrey Warren jeff@unterbahn.com wrote:

ah, so is POST on the legacy form broken? Do we have a test for this? Does
it fail consistently?

On Tue, Feb 20, 2018 at 9:56 AM, Sidharth Bansal <[email protected]

wrote:

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: image]
https://user-images.githubusercontent.com/20972099/36430857-23906b5a-167c-11e8-9c2a-a9cbea933bcb.png
But in the new legacy view, on clicking on the publish button there was
no redirect. It was just trying to publish the note.

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/publiclab/plots2/issues/2370#issuecomment-367003102,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AABfJ78ptGrQNq3RZec2RtS-yNni3ihhks5tWt0MgaJpZM4SLRnP
.

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

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

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.

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 !!!

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

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...

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

Was this page helpful?
0 / 5 - 0 ratings