dsander / huginn.io

Community site for Huginn - share scenarios and discover Agents
GNU Lesser General Public License v3.0
2 stars 1 forks source link

Error Uploading Scenarios using public URL #17

Open JamiePhonic opened 7 years ago

JamiePhonic commented 7 years ago

So, it would appear that the issue where users recieve the We're sorry, but something went wrong. message when attempting to upload a scenario from a public URL instead of a file has returned.

I origonally ran into this issue myself back in november last year but the issue was rectified pretty swiftly. I noticed that its now popped back up again in #https://github.com/cantino/huginn/issues/1774 , so i thought that since i had to update my `UK TV Air Dates" scenario anyway, that i'd try using the Public URL and provide the same information that you asked waldens for in #https://github.com/cantino/huginn/issues/1774

Relevent entry's from Huginn's Production.log (Prior entry's timestamps are from hours earlier, so i assumed they wouldnt be relevant)

I, [2017-03-25T21:39:06.790854 #136194]  INFO -- : [9473ad40-58e4-4d5e-8ee2-2b920a2d9c5f] Started GET "/scenarios/4/export.json" for 54.145.78.140 at 2017-03-25 21:39:06 +0000
I, [2017-03-25T21:39:06.791503 #136194]  INFO -- : [9473ad40-58e4-4d5e-8ee2-2b920a2d9c5f] Processing by ScenariosController#export as JSON
I, [2017-03-25T21:39:06.791529 #136194]  INFO -- : [9473ad40-58e4-4d5e-8ee2-2b920a2d9c5f]   Parameters: {"id"=>"4"}
I, [2017-03-25T21:39:06.812902 #136194]  INFO -- : [9473ad40-58e4-4d5e-8ee2-2b920a2d9c5f] Completed 200 OK in 21ms (Views: 0.1ms | ActiveRecord: 0.0ms)

Relevent entry's from Nginx

54.145.78.140 - - [25/Mar/2017:21:39:06 +0000] "GET /scenarios/4/export.json HTTP/1.1" 200 6623 "-" "Faraday v0.9.2"

Let me know if you need any other information, and keep up the amazing work your doing on huginn and its related projects!

luboq commented 7 years ago

Same as @JamiePhonic , Nginx error log and Runit/Background Worker logs and Unicorn log are all fine, only production.log shows here:

I, [2017-03-26T14:53:23.338066 #13047]  INFO -- : [cf103f69-3a3f-4955-a875-0cac5268f585] Started GET "/scenarios/14/export.json" for 54.162.208.2 at 2017-03-26 14:53:23 +0800
I, [2017-03-26T14:53:23.339222 #13047]  INFO -- : [cf103f69-3a3f-4955-a875-0cac5268f585] Processing by ScenariosController#export as JSON
I, [2017-03-26T14:53:23.339474 #13047]  INFO -- : [cf103f69-3a3f-4955-a875-0cac5268f585]   Parameters: {"id"=>"14"}
I, [2017-03-26T14:53:23.387118 #13047]  INFO -- : [cf103f69-3a3f-4955-a875-0cac5268f585] Completed 200 OK in 47ms (Views: 0.2ms | ActiveRecord: 0.0ms)
dsander commented 7 years ago

@JamiePhonic Thanks for creating the issue, here is the backtrace I am getting with http://huginnio.herokuapp.com/scenarios/14/download

[3dc4d58b-935c-4b02-889a-25d9d7f2f1a3] ActionView::Template::Error (incompatible character encodings: ASCII-8BIT and UTF-8):
[3dc4d58b-935c-4b02-889a-25d9d7f2f1a3]     18:     <% if @scenario_import.step_one? %>
[3dc4d58b-935c-4b02-889a-25d9d7f2f1a3]     19:       <%= render 'step_one', :f => f %>
[3dc4d58b-935c-4b02-889a-25d9d7f2f1a3]     20:     <% elsif @scenario_import.step_two? %>
[3dc4d58b-935c-4b02-889a-25d9d7f2f1a3]     21:       <%= render 'step_two', :f => f %>
[3dc4d58b-935c-4b02-889a-25d9d7f2f1a3]     22:     <% end %>
[3dc4d58b-935c-4b02-889a-25d9d7f2f1a3]     23:   <% end %>
[3dc4d58b-935c-4b02-889a-25d9d7f2f1a3]     24:
JamiePhonic commented 7 years ago

Right, so i tried downloading the JSON file for the scenario first and uploading it to a stand alone web server (Running Apache2 this time), then entering that URL into hugin.io, but i still get the same error.

I'm not entirely sure how you've coded the backend and I'm not a ruby (or really any programming language) dev by any stretch, but I'm confused as to how uploading the file works, but getting the server to download it doesn't.

My database is using UTF8-MB4 if that could be related somehow, but I'm not storing any extended characters like emoji, and notepad++ recognizes the file as being encoded with UTF8.

At a guess, id say that somewhere in your code, the file is being read as ASCII, and in other places as UTF8 (Again, not a programmer)