ytti / oxidized

Oxidized is a network device configuration backup tool. It's a RANCID replacement!
Apache License 2.0
2.76k stars 916 forks source link

Encoding::UndefinedConversionError at /node/version/diffs #1052

Closed bonigeek closed 6 years ago

bonigeek commented 6 years ago

image

Encoding::UndefinedConversionError at /node/version/diffs "\xC3" from ASCII-8BIT to UTF-8 file: encoder.rb location: encode line: 25 BACKTRACE (expand) JUMP TO: GET POST COOKIES ENV /usr/local/share/gems/gems/htmlentities-4.3.4/lib/htmlentities/encoder.rb in encode string.to_s.encode(Encoding::UTF_8) /usr/local/share/gems/gems/htmlentities-4.3.4/lib/htmlentities/encoder.rb in prepare string.to_s.encode(Encoding::UTF_8) /usr/local/share/gems/gems/htmlentities-4.3.4/lib/htmlentities/encoder.rb in encode prepare(source)))) /usr/local/share/gems/gems/htmlentities-4.3.4/lib/htmlentities.rb in encode Encoder.new(@flavor, instructions).encode(source) /usr/local/share/gems/gems/oxidized-web-0.9.2/lib/oxidized/web/webapp.rb in diff_view HTMLEntities.new.encode(diff).each_line do |line| /usr/local/share/gems/gems/oxidized-web-0.9.2/lib/oxidized/web/webapp.rb in block in @diff = diff_view @data /usr/local/share/gems/gems/rack-protection-1.5.3/lib/rack/protection/xss_header.rb in call status, headers, body = @app.call(env) /usr/local/share/gems/gems/rack-protection-1.5.3/lib/rack/protection/path_traversal.rb in call app.call env /usr/local/share/gems/gems/rack-protection-1.5.3/lib/rack/protection/json_csrf.rb in call status, headers, body = app.call(env) /usr/local/share/gems/gems/rack-protection-1.5.3/lib/rack/protection/base.rb in call result or app.call(env) /usr/local/share/gems/gems/rack-protection-1.5.3/lib/rack/protection/base.rb in call result or app.call(env) /usr/local/share/gems/gems/rack-protection-1.5.3/lib/rack/protection/frame_options.rb in call status, headers, body = @app.call(env) /usr/local/share/gems/gems/rack-1.6.8/lib/rack/nulllogger.rb in call @app.call(env) /usr/local/share/gems/gems/rack-1.6.8/lib/rack/head.rb in call status, headers, body = @app.call(env) /usr/local/share/gems/gems/rack-1.6.8/lib/rack/urlmap.rb in block in call return app.call(env) /usr/local/share/gems/gems/rack-1.6.8/lib/rack/urlmap.rb in each @mapping.each do |host, location, match, app| /usr/local/share/gems/gems/rack-1.6.8/lib/rack/urlmap.rb in call @mapping.each do |host, location, match, app| /usr/local/share/gems/gems/rack-1.6.8/lib/rack/builder.rb in call to_app.call(env) /usr/local/share/gems/gems/puma-3.10.0/lib/puma/configuration.rb in call @app.call(env) /usr/local/share/gems/gems/puma-3.10.0/lib/puma/server.rb in handle_request status, headers, res_body = @app.call(env) /usr/local/share/gems/gems/puma-3.10.0/lib/puma/server.rb in process_client case handle_request(client, buffer) /usr/local/share/gems/gems/puma-3.10.0/lib/puma/server.rb in block in run process_client client, buffer /usr/local/share/gems/gems/puma-3.10.0/lib/puma/thread_pool.rb in call block.call(work, extra) /usr/local/share/gems/gems/puma-3.10.0/lib/puma/thread_pool.rb in block in spawn_thread block.call(work, extra)

Variable Value
date "2017-10-02 10:45:30 - 0300"
group "SME-WIRELESS"
node "10.49.18.170"
num "36"
oid "a12ad47c6903e0cf9f5d6b955790931f2e751477"

POST No POST data. COOKIES No cookie data. Rack ENV

Variable Value
GATEWAY_INTERFACE CGI/1.2
HTTP_ACCEPT text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8
HTTP_ACCEPT_ENCODING gzip, deflate
HTTP_ACCEPT_LANGUAGE pt-BR,pt;q=0.8,en-US;q=0.6,en;q=0.4
HTTP_CONNECTION keep-alive
HTTP_HOST 10.10.74.21:8888
HTTP_REFERER http://10.10.74.21:8888/node/version?node_full=SME-WIRELESS/10.49.18.170
HTTP_UPGRADE_INSECURE_REQUESTS 1
HTTP_USER_AGENT Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.105 Safari/537.36 Vivaldi/1.92.917.43
HTTP_VERSION HTTP/1.1
PATH_INFO /node/version/diffs
QUERY_STRING node=10.49.18.170&group=SME-WIRELESS&oid=a12ad47c6903e0cf9f5d6b955790931f2e751477&date=2017-10-02%2010:45:30%20-+0300&num=36
REMOTE_ADDR 10.10.143.15
REQUEST_METHOD GET
REQUEST_PATH /node/version/diffs
REQUEST_URI /node/version/diffs?node=10.49.18.170&group=SME-WIRELESS&oid=a12ad47c6903e0cf9f5d6b955790931f2e751477&date=2017-10-02%2010:45:30%20-+0300&num=36
SCRIPT_NAME  
SERVER_NAME 10.10.74.21
SERVER_PORT 8888
SERVER_PROTOCOL HTTP/1.1
SERVER_SOFTWARE puma 3.10.0 Russell's Teapot
puma.config #<Puma::Configuration:0x00000002cc6378 @options=#<Puma::UserFileDefaultOptions:0x0000000198e530 @user_options={:Host=>"0.0.0.0", :Port=>"8888", :log_requests=>false, :binds=>["tcp://0.0.0.0:8888"], :app=>#<Rack::Builder:0x00000001d50560 @warmup=nil, @run=nil, @map={"/"=>#Proc:0x00000001db49e8@/usr/local/share/gems/gems/oxidized-web-0.9.2/lib/oxidized/web.rb:21}, @use=[]>, :environment=>"development"}, @file_options={}, @default_options={:min_threads=>0, :max_threads=>16, :log_requests=>false, :debug=>false, :binds=>["tcp://0.0.0.0:9292"], :workers=>0, :daemon=>false, :mode=>:http, :worker_timeout=>60, :worker_boot_timeout=>60, :worker_shutdown_timeout=>30, :remote_address=>:socket, :tag=>"/", :environment=>"development", :rackup=>"config.ru", :logger=>#<IO:>, :persistent_timeout=>20, :first_data_timeout=>30, :Verbose=>false, :Silent=>false}>, @plugins=#<Puma::PluginLoader:0x00000001993f08 @instances=[]>, @user_dsl=#<Puma::DSL:0x00000001992658 @config=#<Puma::Configuration:0x00000002cc6378 ...>, @options={:Host=>"0.0.0.0", :Port=>"8888", :log_requests=>false, :binds=>["tcp://0.0.0.0:8888"], :app=>#<Rack::Builder:0x00000001d50560 @warmup=nil, @run=nil, @map={"/"=>#Proc:0x00000001db49e8@/usr/local/share/gems/gems/oxidized-web-0.9.2/lib/oxidized/web.rb:21}, @use=[]>, :environment=>"development"}, @plugins=[]>, @file_dsl=#<Puma::DSL:0x00000001992040 @config=#<Puma::Configuration:0x00000002cc6378 ...>, @options={}, @plugins=[]>, @default_dsl=#<Puma::DSL:0x00000001991ca8 @config=#<Puma::Configuration:0x00000002cc6378 ...>, @options={:min_threads=>0, :max_threads=>16, :log_requests=>false, :debug=>false, :binds=>["tcp://0.0.0.0:9292"], :workers=>0, :daemon=>false, :mode=>:http, :worker_timeout=>60, :worker_boot_timeout=>60, :worker_shutdown_timeout=>30, :remote_address=>:socket, :tag=>"/", :environment=>"development", :rackup=>"config.ru", :logger=>#<IO:>, :persistent_timeout=>20, :first_data_timeout=>30, :Verbose=>false, :Silent=>false}, @plugins=[]>>
puma.socket #<TCPSocket:fd 18>
rack.after_reply []
rack.errors #
rack.hijack #<Puma::Client:0x1909de4 @ready=true>
rack.hijack? true
rack.input #
rack.logger #<Rack::NullLogger:0x00000002a71118 @app=#<Rack::Protection::FrameOptions:0x00000002a71230 @app=#<Rack::Protection::HttpOrigin:0x00000002a71320 @app=#<Rack::Protection::IPSpoofing:0x00000002a713e8 @app=#<Rack::Protection::JsonCsrf:0x00000002a714b0 @app=#<Rack::Protection::PathTraversal:0x00000002a715c8 @app=#<Rack::Protection::XSSHeader:0x00000002a716e0 @app=#<Oxidized::API::WebApp:0x0000000209d6c8 @default_layout=:layout, @preferred_extension=nil, @app=nil, @template_cache=#<Tilt::Cache:0x0000000209d6a0 @cache={}>>, @options={:reaction=>:drop_session, :logging=>true, :message=>"Forbidden", :encryptor=>Digest::SHA1, :session_key=>"rack.session", :status=>403, :allow_empty_referrer=>true, :report_key=>"protection.failed", :html_types=>["text/html", "application/xhtml"], :xss_mode=>:block, :nosniff=>true, :except=>[:session_hijacking, :remote_token]}>, @options={:reaction=>:drop_session, :logging=>true, :message=>"Forbidden", :encryptor=>Digest::SHA1, :session_key=>"rack.session", :status=>403, :allow_empty_referrer=>true, :report_key=>"protection.failed", :html_types=>["text/html", "application/xhtml"], :except=>[:session_hijacking, :remote_token]}>, @options={:reaction=>:drop_session, :logging=>true, :message=>"Forbidden", :encryptor=>Digest::SHA1, :session_key=>"rack.session", :status=>403, :allow_empty_referrer=>true, :report_key=>"protection.failed", :html_types=>["text/html", "application/xhtml"], :except=>[:session_hijacking, :remote_token]}>, @options={:reaction=>:drop_session, :logging=>true, :message=>"Forbidden", :encryptor=>Digest::SHA1, :session_key=>"rack.session", :status=>403, :allow_empty_referrer=>true, :report_key=>"protection.failed", :html_types=>["text/html", "application/xhtml"], :except=>[:session_hijacking, :remote_token]}>, @options={:reaction=>:drop_session, :logging=>true, :message=>"Forbidden", :encryptor=>Digest::SHA1, :session_key=>"rack.session", :status=>403, :allow_empty_referrer=>true, :report_key=>"protection.failed", :html_types=>["text/html", "application/xhtml"], :except=>[:session_hijacking, :remote_token]}>, @options={:reaction=>:drop_session, :logging=>true, :message=>"Forbidden", :encryptor=>Digest::SHA1, :session_key=>"rack.session", :status=>403, :allow_empty_referrer=>true, :report_key=>"protection.failed", :html_types=>["text/html", "application/xhtml"], :frame_options=>:sameorigin, :except=>[:session_hijacking, :remote_token]}, @frame_options="SAMEORIGIN">>
rack.multiprocess false
rack.multithread true
rack.request.cookie_hash {}
rack.request.query_hash {"node"=>"10.49.18.170", "group"=>"SME-WIRELESS", "oid"=>"a12ad47c6903e0cf9f5d6b955790931f2e751477", "date"=>"2017-10-02 10:45:30 - 0300", "num"=>"36"}
rack.request.query_string node=10.49.18.170&group=SME-WIRELESS&oid=a12ad47c6903e0cf9f5d6b955790931f2e751477&date=2017-10-02%2010:45:30%20-+0300&num=36
rack.run_once false
rack.url_scheme http
rack.version [1, 3]
sinatra.accept [#<Sinatra::Request::AcceptEntry:0x00000001e47338 @entry="text/html", @type="text/html", @params={}, @q=1.0>, #<Sinatra::Request::AcceptEntry:0x00000001e46be0 @entry="application/xhtml+xml", @type="application/xhtml+xml", @params={}, @q=1.0>, #<Sinatra::Request::AcceptEntry:0x00000001e45060 @entry="image/apng", @type="image/apng", @params={}, @q=1.0>, #<Sinatra::Request::AcceptEntry:0x00000001e45560 @entry="image/webp", @type="image/webp", @params={}, @q=1.0>, #<Sinatra::Request::AcceptEntry:0x00000001e461e0 @entry="application/xml;q=0.9", @type="application/xml", @params={}, @q=0.9>, #<Sinatra::Request::AcceptEntry:0x00000001e44db8 @entry="/;q=0.8", @type="/", @params={}, @q=0.8>]
sinatra.error #<Encoding::UndefinedConversionError: "\xC3" from ASCII-8BIT to UTF-8>
sinatra.route GET /node/version/diffs

In some devices if I will check the differences it appears

laf commented 6 years ago

This appears to be a duplicate of #966.

If it's not please reply why and we can re-open