mozilla-services / channelserver

🍐 A tool to associate instances of firefox.
Mozilla Public License 2.0
3 stars 6 forks source link

Seeing "No X-Forwarded-For found for proxied connection" while running locally #68

Closed vladikoff closed 5 years ago

vladikoff commented 5 years ago
20|pairing | 927894f30d\n  20:     0x55a3838b06af - futures::task_impl::std::set::hb5801d541935b423\n  21:     0x55a3838a9b29 - tokio_current_thread::CurrentRunner::set_spawn::hcb2934b2b0a3c24f\n  22:     0x55a3838b797e - <tokio_current_thread::scheduler::Scheduler<U>>::tick::h00cca6abae011421\n  23:     0x55a3838ad949 - <tokio_current_thread::Entered<'a, P>>::block_on::h9f6461cfc5dc384a\n  24:     0x55a3838bbe90 - <std::thread::local::LocalKey<T>>::with::h302c370f7de579bc\n  25:     0x55a3838bfd58 - <std::thread::local::LocalKey<T>>::with::hfed3f1f0dcf7383a\n  26:     0x55a3838bfaa8 - <std::thread::local::LocalKey<T>>::with::hf0e7356a5e560634\n  27:     0x55a3838bbb46 - <std::thread::local::LocalKey<T>>::with::h20b3bea8930ca4d0\n  28:     0x55a3838ac6fe - tokio::runtime::current_thread::runtime::Runtime::block_on::h6193524c13d74369\n  29:     0x55a3838c571d - std::sys_common::backtrace::__rust_begin_short_backtrace::h8b5e2700f8dc1f5b\n  30:     0x55a3838aedc7 - std::panicking::try::do_call::ha91da4a2bfb28e1d\n  31:     0x55a383a3fa39 - __rust_maybe_catch_panic\n                        at libpanic_unwind/lib.rs:103\n  32:     0x55a3838ab700 - <F as alloc::boxed::FnBox<A>>::call_box::h6e08fc3e43be7593\n  33:     0x55a383a3199a - <alloc::boxed::Box<(dyn alloc::boxed::FnBox<A, Output=R> + 'a)> as core::ops::function::FnOnce<A>>::call_once::hfedf8d10954bca7a\n                        at liballoc/boxed.rs:656\n                         - std::sys_common::thread::start_thread::h75d887c7d2cc4479\n                        at libstd/sys_common/thread.rs:24\n  34:     0x55a383a1e9c5 - std::sys::unix::thread::Thread::new::thread_start::h8414caee632bf9ed\n                        at libstd/sys/unix/thread.rs:90\n  35:     0x7f0c03389493 - start_thread\n  36:     0x7f0c02eb4ace - __clone\n  37:                0x0 - <unknown>\n\nBad remote address: \"No X-Forwarded-For found for proxied connection\" }","remote_ip":null}}
20|pairing | {"Logger":"channelserver-0.9.0","Type":"channelserver:log","Pid":1,"Severity":6,"Timestamp":1545177541982748100,"Fields":{"msg":"Creating session for candiate channel: \"qfVRFHyoUghRxhpV6JCeCg\"","remote_ip":null}}
20|pairing | {"Logger":"channelserver-0.9.0","Type":"channelserver:log","Pid":1,"Severity":7,"Timestamp":1545177541982841800,"Fields":{"msg":"New connection","remote_ip":null,"session":12963126933899610032,"channel":"qfVRFHyoUghRxhpV6JCeCg"}}
20|pairing | {"Logger":"channelserver-0.9.0","Type":"channelserver:log","Pid":1,"Severity":7,"Timestamp":1545177541982850700,"Fields":{"msg":"Killing session","remote_ip":null,"session":0}}
20|pairing | {"Logger":"channelserver-0.9.0","Type":"channelserver:log","Pid":1,"Severity":4,"Timestamp":1545177541982866900,"Fields":{"msg":"Attempt to connect to unknown channel","remote_ip":"Unknown","channel":"qfVRFHyoUghRxhpV6JCeCg"}}
20|pairing | {"Logger":"channelserver-0.9.0","Type":"channelserver:log","Pid":1,"Severity":7,"Timestamp":1545177541982904100,"Fields":{"msg":"Connection dropped","reason":"Client Disconnect","session":0,"channel":"qfVRFHyoUghRxhpV6JCeCg"}}
jrconlin commented 5 years ago

I think you're seeing two errors here. They're merged because rust threading can do that.

We're doing GeoIP lookups, we check the reported Peer address to see if it's a known proxy (currently in 10.0.0.0/8, 172.16.0.0/12, & 192.168.0.0/16, with more addresses available via config).

If it is, we skip it and look at the header candidates for proxy (X-Forwarded-For, etc.) if all that fails, then we have no idea and consider there to be no remote IP address. That's what the {"Logger":"channelserver-0.9.0","Type":"channelserver:log","Pid":...,"Severity":3,"Timestamp":...,"Fields":{"msg":"HandlerError { inner: \n\nBad remote address: \"No X-Forwarded-For found for proxied connection\" }","remote_ip":null}} message is.

What's more concerning is the injected thread crash in the first line. I'm not quite sure I know what triggered that since it looks like a failed clone inside a thread. I'm unable to reproduce that particular example, and I've got a few test cases for the "No X-Forwarded-For found..." error.

vladikoff commented 5 years ago

not relevant for now , closing