openaustralia / ukraine_verkhovna_rada_votes

Votes by deputies in the Ukrainian Parliament
https://morph.io/openaustralia/ukraine_verkhovna_rada_votes
1 stars 0 forks source link

Internal Server Error #15

Open beastie87 opened 8 years ago

beastie87 commented 8 years ago

Help us, please when we are using https://arcane-mountain-8284.herokuapp.com/vote_events/2016-04-19 for update We get answers Internal Server Error Thank you!

henare commented 8 years ago

The application that powers that site is https://github.com/openaustralia/morph_popolo. It's hosted on Heroku so I changed into that directory and ran heroku logs to see the error:

2016-04-21T00:11:59.670936+00:00 heroku[router]: at=info method=GET path="/vote_events/2016-04-19" host=arcane-mountain-8284.herokuapp.com request_id=3b48da00-9aa1-4f4e-ae3a-fc4fe783ce48 fwd="[IP address redacted]" dyno=web.1 connect=0ms service=2181ms status=500 bytes=398
2016-04-21T00:11:59.660980+00:00 app[web.1]:  /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/open-uri.rb:353:in `open_http'
2016-04-21T00:11:59.660976+00:00 app[web.1]: 2016-04-21 00:11:59 - OpenURI::HTTPError - 500 Internal Server Error:
2016-04-21T00:11:59.660981+00:00 app[web.1]:  /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/open-uri.rb:709:in `buffer_open'
2016-04-21T00:11:59.660982+00:00 app[web.1]:  /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/open-uri.rb:210:in `block in open_loop'
2016-04-21T00:11:59.660982+00:00 app[web.1]:  /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/open-uri.rb:208:in `catch'
2016-04-21T00:11:59.660983+00:00 app[web.1]:  /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/open-uri.rb:208:in `open_loop'
2016-04-21T00:11:59.660984+00:00 app[web.1]:  /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/open-uri.rb:149:in `open_uri'
2016-04-21T00:11:59.660984+00:00 app[web.1]:  /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/open-uri.rb:689:in `open'
2016-04-21T00:11:59.660994+00:00 app[web.1]:  /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/open-uri.rb:34:in `open'
2016-04-21T00:11:59.661006+00:00 app[web.1]:  /app/server.rb:13:in `morph_scraper_query'
2016-04-21T00:11:59.661007+00:00 app[web.1]:  /app/server.rb:37:in `block in <top (required)>'
2016-04-21T00:11:59.661014+00:00 app[web.1]:  /app/vendor/bundle/ruby/2.0.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1609:in `call'
2016-04-21T00:11:59.661020+00:00 app[web.1]:  /app/vendor/bundle/ruby/2.0.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1609:in `block in compile!'
2016-04-21T00:11:59.661021+00:00 app[web.1]:  /app/vendor/bundle/ruby/2.0.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:974:in `[]'
2016-04-21T00:11:59.661021+00:00 app[web.1]:  /app/vendor/bundle/ruby/2.0.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:974:in `block (3 levels) in route!'
2016-04-21T00:11:59.661022+00:00 app[web.1]:  /app/vendor/bundle/ruby/2.0.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:993:in `route_eval'
2016-04-21T00:11:59.661022+00:00 app[web.1]:  /app/vendor/bundle/ruby/2.0.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:974:in `block (2 levels) in route!'
2016-04-21T00:11:59.661023+00:00 app[web.1]:  /app/vendor/bundle/ruby/2.0.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1014:in `block in process_route'
2016-04-21T00:11:59.661024+00:00 app[web.1]:  /app/vendor/bundle/ruby/2.0.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1012:in `catch'
2016-04-21T00:11:59.661024+00:00 app[web.1]:  /app/vendor/bundle/ruby/2.0.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1012:in `process_route'
2016-04-21T00:11:59.661025+00:00 app[web.1]:  /app/vendor/bundle/ruby/2.0.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:972:in `block in route!'
2016-04-21T00:11:59.661025+00:00 app[web.1]:  /app/vendor/bundle/ruby/2.0.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:971:in `each'
2016-04-21T00:11:59.661026+00:00 app[web.1]:  /app/vendor/bundle/ruby/2.0.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:971:in `route!'
2016-04-21T00:11:59.661027+00:00 app[web.1]:  /app/vendor/bundle/ruby/2.0.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1084:in `block in dispatch!'
2016-04-21T00:11:59.661027+00:00 app[web.1]:  /app/vendor/bundle/ruby/2.0.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1066:in `block in invoke'
2016-04-21T00:11:59.661028+00:00 app[web.1]:  /app/vendor/bundle/ruby/2.0.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1066:in `catch'
2016-04-21T00:11:59.661029+00:00 app[web.1]:  /app/vendor/bundle/ruby/2.0.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1066:in `invoke'
2016-04-21T00:11:59.661029+00:00 app[web.1]:  /app/vendor/bundle/ruby/2.0.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1081:in `dispatch!'
2016-04-21T00:11:59.661030+00:00 app[web.1]:  /app/vendor/bundle/ruby/2.0.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:906:in `block in call!'
2016-04-21T00:11:59.661031+00:00 app[web.1]:  /app/vendor/bundle/ruby/2.0.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1066:in `block in invoke'
2016-04-21T00:11:59.661031+00:00 app[web.1]:  /app/vendor/bundle/ruby/2.0.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1066:in `catch'
2016-04-21T00:11:59.661032+00:00 app[web.1]:  /app/vendor/bundle/ruby/2.0.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1066:in `invoke'
2016-04-21T00:11:59.661032+00:00 app[web.1]:  /app/vendor/bundle/ruby/2.0.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:906:in `call!'
2016-04-21T00:11:59.661033+00:00 app[web.1]:  /app/vendor/bundle/ruby/2.0.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:894:in `call'
2016-04-21T00:11:59.661034+00:00 app[web.1]:  /app/vendor/bundle/ruby/2.0.0/gems/rack-1.6.4/lib/rack/deflater.rb:35:in `call'
2016-04-21T00:11:59.661034+00:00 app[web.1]:  /app/vendor/bundle/ruby/2.0.0/gems/rack-protection-1.5.3/lib/rack/protection/xss_header.rb:18:in `call'
2016-04-21T00:11:59.661035+00:00 app[web.1]:  /app/vendor/bundle/ruby/2.0.0/gems/rack-protection-1.5.3/lib/rack/protection/path_traversal.rb:16:in `call'
2016-04-21T00:11:59.661036+00:00 app[web.1]:  /app/vendor/bundle/ruby/2.0.0/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in `call'
2016-04-21T00:11:59.661036+00:00 app[web.1]:  /app/vendor/bundle/ruby/2.0.0/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in `call'
2016-04-21T00:11:59.661037+00:00 app[web.1]:  /app/vendor/bundle/ruby/2.0.0/gems/rack-protection-1.5.3/lib/rack/protection/frame_options.rb:31:in `call'
2016-04-21T00:11:59.661037+00:00 app[web.1]:  /app/vendor/bundle/ruby/2.0.0/gems/rack-1.6.4/lib/rack/logger.rb:15:in `call'
2016-04-21T00:11:59.661038+00:00 app[web.1]:  /app/vendor/bundle/ruby/2.0.0/gems/rack-1.6.4/lib/rack/commonlogger.rb:33:in `call'
2016-04-21T00:11:59.661039+00:00 app[web.1]:  /app/vendor/bundle/ruby/2.0.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:218:in `call'
2016-04-21T00:11:59.661039+00:00 app[web.1]:  /app/vendor/bundle/ruby/2.0.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:211:in `call'
2016-04-21T00:11:59.661040+00:00 app[web.1]:  /app/vendor/bundle/ruby/2.0.0/gems/rack-1.6.4/lib/rack/head.rb:13:in `call'
2016-04-21T00:11:59.661040+00:00 app[web.1]:  /app/vendor/bundle/ruby/2.0.0/gems/rack-1.6.4/lib/rack/methodoverride.rb:22:in `call'
2016-04-21T00:11:59.661041+00:00 app[web.1]:  /app/vendor/bundle/ruby/2.0.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:181:in `call'
2016-04-21T00:11:59.661041+00:00 app[web.1]:  /app/vendor/bundle/ruby/2.0.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:2021:in `call'
2016-04-21T00:11:59.661047+00:00 app[web.1]:  /app/vendor/bundle/ruby/2.0.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1486:in `block in call'
2016-04-21T00:11:59.661048+00:00 app[web.1]:  /app/vendor/bundle/ruby/2.0.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1795:in `synchronize'
2016-04-21T00:11:59.661048+00:00 app[web.1]:  /app/vendor/bundle/ruby/2.0.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1486:in `call'
2016-04-21T00:11:59.661049+00:00 app[web.1]:  /app/vendor/bundle/ruby/2.0.0/gems/rack-1.6.4/lib/rack/handler/webrick.rb:88:in `service'
2016-04-21T00:11:59.661050+00:00 app[web.1]:  /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
2016-04-21T00:11:59.661050+00:00 app[web.1]:  /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
2016-04-21T00:11:59.661051+00:00 app[web.1]:  /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'
2016-04-21T00:11:59.661650+00:00 app[web.1]: [IP address redacted] - - [21/Apr/2016:00:11:59 +0000] "GET /vote_events/2016-04-19 HTTP/1.1" 500 - 2.1773

The query it's trying to do on morph.io is:

SELECT * FROM 'bills' WHERE vote_event_id IN ('6769', '6770', '6771', '6772', '6773', '6774', '6775', '6776', '6777', '6778', '6779', '6780', '6781', '6782', '6783', '6784', '6785', '6786', '6787', '6789', '6790', '6791', '6792', '6793', '6794', '6795', '6796', '6797', '6798', '6799', '6800', '6801', '6802', '6803', '6804', '6805', '6806', '6807', '6808', '6809', '6810', '6811', '6812', '6813', '6814', '6815', '6816', '6817', '6818', '6819', '6820', '6821', '6822', '6823', '6824', '6825', '6826', '6827', '6828', '6829', '6830', '6831', '6832', '6833', '6834', '6835', '6836', '6837', '6838', '6839', '6840', '6841', '6842', '6843', '6844', '6845', '6846', '6847', '6848', '6849', '6850', '6851', '6852', '6853', '6854', '6855', '6856', '6857', '6858', '6859', '6860', '6861', '6862', '6863', '6864', '6865', '6866', '6867', '6868', '6869', '6870', '6871', '6872', '6873', '6874', '6875', '6876', '6877', '6878', '6879', '6880', '6881', '6882', '6883', '6884', '6885', '6886', '6887', '6888', '6889', '6890', '6891', '6892', '6893', '6894', '6895', '6896', '6897', '6898', '6899', '6900', '6901', '6902', '6903', '6904', '6905', '6906', '6907', '6908', '6909', '6910', '6911', '6912', '6913', '6914', '6915', '6916', '6917', '6918', '6919', '6920', '6921', '6922', '6923', '6924', '6925', '6926', '6927', '6928', '6929', '6930', '6931', '6932', '6933', '6934', '6935', '6936', '6937', '6938', '6939', '6940', '6941', '6942', '6943', '6944', '6945', '6946', '6947', '6948', '6949', '6950', '6951', '6952', '6953', '6954', '6955', '6956', '6957', '6958', '6959', '6960', '6961', '6962', '6963', '6964', '6965', '6966', '6967', '6968', '6969', '6970', '6971', '6972', '6973', '6974', '6975', '6976', '6977', '6978', '6979', '6980', '6981', '6982', '6983', '6984', '6985', '6986', '6987')

Maybe it's too long?

beastie87 commented 8 years ago

Thank you @henare for the explanation! Yes. April 19 was up 218 bils, it's really a lot Could you please give me an advice about some other way to get votes and bills on rada4you? Thank you!

henare commented 8 years ago

I think you'll need to modify https://github.com/openaustralia/morph_popolo so that it fetches things from morph.io in batches.