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

Track binary files #12

Open
FelixSFD opened this issue Jun 4, 2017 · 16 comments
Open

Track binary files #12

FelixSFD opened this issue Jun 4, 2017 · 16 comments
Assignees
Milestone

Comments

@FelixSFD
Copy link
Member

FelixSFD commented Jun 4, 2017

In some cases, it might be useful to track a binary file. (SOBotics/Guttenberg#100)

The current methods only send strings

@FelixSFD FelixSFD added this to the 1.1 milestone Jun 4, 2017
@NobodyNada
Copy link
Member

You can upload binary files to Redunda; just be sure to set the Content-Type to application/octet-stream.

@FelixSFD
Copy link
Member Author

FelixSFD commented Jun 4, 2017

Great! :-) Thanks. I didn't know that

@FelixSFD
Copy link
Member Author

FelixSFD commented Aug 29, 2017

@NobodyNada I'm trying to send a file with this method, but the server returns status 500.

file.getData() returns byte[]

@NobodyNada
Copy link
Member

@FelixSFD Hmm, what's the response body?

@NobodyNada
Copy link
Member

Also, what's the size of the file you're sending? IIRC there's a size limit, but I don't remember what it is :/

@FelixSFD
Copy link
Member Author

I don't receive the response body, because con.getInputStream() throws the IOExcpetion before I can read the body. :-/

java.io.IOException: Server returned HTTP response code: 500 for URL: https://redunda.sobotics.org/bots/data/._slash_target_slash_guttenberg_dash_0.8.0.jar?key=aa6...87e7
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1840)
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1441)
	at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254)
	at org.sobotics.redunda.DataService.pushFile(DataService.java:194)
	at org.sobotics.guttenberg.clients.Client.main(Client.java:116)

The size is 10.3 MB

@NobodyNada
Copy link
Member

NobodyNada commented Aug 29, 2017

@FelixSFD Hmm, [status-norepro]. Can you try to figure out a way to get the response body, as that should contain the error message? Does this SO answer help?

@FelixSFD
Copy link
Member Author

Mysql2::Error: MySQL server has gone away: ROLLBACK

That's the full response:
response.txt

@NobodyNada
Copy link
Member

@FelixSFD ...That's a weird error. I'll take a closer look later, but I'll probably end up having to ask Undo or Art. FYI that error page includes your instance key, so you'll need to revoke it and generate a new one. Just click on the "Revoke" button on the instance key dialog.

@ArtOfCode-
Copy link
Member

@FelixSFD Try again - it may have been related to the disk space problem we had earlier on today.

@FelixSFD
Copy link
Member Author

@ArtOfCode- no. :-/ Still the same error

@Bhargav-Rao
Copy link
Member

Any update on this?

@FelixSFD
Copy link
Member Author

FelixSFD commented Jul 15, 2018 via email

@FelixSFD
Copy link
Member Author

This happens when I post the JAR-file:

Started POST "/bots/data/target_slash_guttenberg_dash_1.2.2.jar?key=9e8b9907a47f84375e14d03ea746ef8f68869c03e5ee73147e6df2c9e33835c2" for 127.0.0.1 at 2018-07-16 20:39:27 +0200
  
Rack::QueryParser::InvalidParameterError (invalid byte sequence in UTF-8):
  
rack (2.0.1) lib/rack/query_parser.rb:72:in `rescue in parse_nested_query'
rack (2.0.1) lib/rack/query_parser.rb:60:in `parse_nested_query'
rack (2.0.1) lib/rack/request.rb:468:in `parse_query'
rack (2.0.1) lib/rack/request.rb:343:in `POST'
actionpack (5.1.0.beta1) lib/action_dispatch/http/request.rb:359:in `block (2 levels) in POST'
actionpack (5.1.0.beta1) lib/action_dispatch/http/parameters.rb:99:in `block in parse_formatted_parameters'
actionpack (5.1.0.beta1) lib/action_dispatch/http/parameters.rb:99:in `fetch'
actionpack (5.1.0.beta1) lib/action_dispatch/http/parameters.rb:99:in `parse_formatted_parameters'
actionpack (5.1.0.beta1) lib/action_dispatch/http/request.rb:358:in `block in POST'
rack (2.0.1) lib/rack/request.rb:57:in `fetch'
rack (2.0.1) lib/rack/request.rb:57:in `fetch_header'
actionpack (5.1.0.beta1) lib/action_dispatch/http/request.rb:357:in `POST'
actionpack (5.1.0.beta1) lib/action_dispatch/http/parameters.rb:53:in `parameters'
actionpack (5.1.0.beta1) lib/action_dispatch/http/filter_parameters.rb:41:in `filtered_parameters'
actionpack (5.1.0.beta1) lib/action_controller/metal/instrumentation.rb:21:in `process_action'
actionpack (5.1.0.beta1) lib/action_controller/metal/params_wrapper.rb:248:in `process_action'
activerecord (5.1.0.beta1) lib/active_record/railties/controller_runtime.rb:22:in `process_action'
actionpack (5.1.0.beta1) lib/abstract_controller/base.rb:124:in `process'
actionview (5.1.0.beta1) lib/action_view/rendering.rb:30:in `process'
actionpack (5.1.0.beta1) lib/action_controller/metal.rb:189:in `dispatch'
actionpack (5.1.0.beta1) lib/action_controller/metal.rb:253:in `dispatch'
actionpack (5.1.0.beta1) lib/action_dispatch/routing/route_set.rb:49:in `dispatch'
actionpack (5.1.0.beta1) lib/action_dispatch/routing/route_set.rb:31:in `serve'
actionpack (5.1.0.beta1) lib/action_dispatch/journey/router.rb:46:in `block in serve'
actionpack (5.1.0.beta1) lib/action_dispatch/journey/router.rb:33:in `each'
actionpack (5.1.0.beta1) lib/action_dispatch/journey/router.rb:33:in `serve'
actionpack (5.1.0.beta1) lib/action_dispatch/routing/route_set.rb:840:in `call'
warden (1.2.7) lib/warden/manager.rb:36:in `block in call'
warden (1.2.7) lib/warden/manager.rb:35:in `catch'
warden (1.2.7) lib/warden/manager.rb:35:in `call'
rack (2.0.1) lib/rack/etag.rb:25:in `call'
rack (2.0.1) lib/rack/conditional_get.rb:38:in `call'
rack (2.0.1) lib/rack/head.rb:12:in `call'
rack (2.0.1) lib/rack/session/abstract/id.rb:222:in `context'
rack (2.0.1) lib/rack/session/abstract/id.rb:216:in `call'
actionpack (5.1.0.beta1) lib/action_dispatch/middleware/cookies.rb:613:in `call'
activerecord (5.1.0.beta1) lib/active_record/migration.rb:558:in `call'
actionpack (5.1.0.beta1) lib/action_dispatch/middleware/callbacks.rb:26:in `block in call'
activesupport (5.1.0.beta1) lib/active_support/callbacks.rb:97:in `run_callbacks'
actionpack (5.1.0.beta1) lib/action_dispatch/middleware/callbacks.rb:24:in `call'
actionpack (5.1.0.beta1) lib/action_dispatch/middleware/executor.rb:12:in `call'
actionpack (5.1.0.beta1) lib/action_dispatch/middleware/debug_exceptions.rb:59:in `call'
web-console (3.4.0) lib/web_console/middleware.rb:135:in `call_app'
web-console (3.4.0) lib/web_console/middleware.rb:28:in `block in call'
web-console (3.4.0) lib/web_console/middleware.rb:18:in `catch'
web-console (3.4.0) lib/web_console/middleware.rb:18:in `call'
actionpack (5.1.0.beta1) lib/action_dispatch/middleware/show_exceptions.rb:31:in `call'
railties (5.1.0.beta1) lib/rails/rack/logger.rb:36:in `call_app'
railties (5.1.0.beta1) lib/rails/rack/logger.rb:24:in `block in call'
activesupport (5.1.0.beta1) lib/active_support/tagged_logging.rb:69:in `block in tagged'
activesupport (5.1.0.beta1) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (5.1.0.beta1) lib/active_support/tagged_logging.rb:69:in `tagged'
railties (5.1.0.beta1) lib/rails/rack/logger.rb:24:in `call'
sprockets-rails (3.2.0) lib/sprockets/rails/quiet_assets.rb:13:in `call'
actionpack (5.1.0.beta1) lib/action_dispatch/middleware/remote_ip.rb:79:in `call'
actionpack (5.1.0.beta1) lib/action_dispatch/middleware/request_id.rb:25:in `call'
rack (2.0.1) lib/rack/method_override.rb:22:in `call'
rack (2.0.1) lib/rack/runtime.rb:22:in `call'
activesupport (5.1.0.beta1) lib/active_support/cache/strategy/local_cache_middleware.rb:27:in `call'
actionpack (5.1.0.beta1) lib/action_dispatch/middleware/executor.rb:12:in `call'
actionpack (5.1.0.beta1) lib/action_dispatch/middleware/static.rb:125:in `call'
rack (2.0.1) lib/rack/sendfile.rb:111:in `call'
rack-cors (0.4.1) lib/rack/cors.rb:81:in `call'
railties (5.1.0.beta1) lib/rails/engine.rb:522:in `call'
puma (3.7.1) lib/puma/configuration.rb:232:in `call'
puma (3.7.1) lib/puma/server.rb:578:in `handle_request'
puma (3.7.1) lib/puma/server.rb:415:in `process_client'
puma (3.7.1) lib/puma/server.rb:275:in `block in run'
puma (3.7.1) lib/puma/thread_pool.rb:120:in `block in spawn_thread'

(don't worry, the key is for my local copy of Redunda)

@NobodyNada
Copy link
Member

Are you sure the Content-Type is application/octet-stream?

@FelixSFD
Copy link
Member Author

I was sure, but I was wrong :-D It works!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants