Open Bug 1802618 Opened 2 years ago Updated 2 years ago

Local Android test runs fail with "FATAL ERROR: Non-local network connections are disabled" on a machine with a public IP address

Categories

(Testing :: General, defect, P5)

defect

Tracking

(firefox109 affected)

Tracking Status
firefox109 --- affected

People

(Reporter: botond, Unassigned)

Details

(Keywords: regression)

Steps to reproduce

  1. Do a local android device (arm) build of mozilla-central
  2. Attempt to run a test locally, for example ./mach geckoview-junit org.mozilla.geckoview.test.PanZoomControllerTest

Expected results

The test runs successfully.

Actual results

Test run fails with (I've redacted the IP address which is my computer's public IP address):

FATAL ERROR: Non-local network connections are disabled and a connection attempt to <redacted> (<redacted>) was made.
You should only access hostnames available via the test networking proxy (if running mochitests) or from a test-specific httpd.js server (if running xpcshell tests). Browser services should be disabled or redirected to a local server.

A more detailed message in adb logcat suggests the problematic connection attempt is coming from services/settings/Utils.jsm (hence I'm filing the bug in the associated component):

11-25 21:54:23.886 15911 15932 F MOZ_CRASH: Hit MOZ_CRASH(Attempting to connect to non-local address! opener is [resource://services-settings/Utils.jsm:280:14], uri is [http://<redacted>:8888/dummy-kinto/v1/buckets/monitor/collections/changes/changeset?collection=anti-tracking-url-decoration&bucket=main&_expected=0]) at /home/botond/dev/projects/mozilla/refactoring/netwerk/protocol/http/nsHttpChannel.cpp:6943

This is a somewhat recent (last few weeks) regression, this used to work before. (However, it's not easy to find a regression window because the repro steps involve a local mach environment.)

Blocks: 1519339

Android emulator (x86_64) builds are affected as well.

This bug has been marked as a regression. Setting status flag for Nightly to affected.

The error seems to be related to the fact that I was trying to run the test on a machine with a public IP address (i.e. connected directly to a modem with no router in between to create a local network). The errors go away when run in a more conventional setup.

So, there's probably nothing wrong with the Remote Settings Client code, but rather this is a more general issue running our test suites on a machine with a public IP address.

Component: Remote Settings Client → General
Product: Firefox → Testing
Summary: Local Android test runs fail with "FATAL ERROR: Non-local network connections are disabled" → Local Android test runs fail with "FATAL ERROR: Non-local network connections are disabled" on a machine with a public IP address

Setting environment variable MOZ_DISABLE_NONLOCAL_CONNECTIONS = "0" should disable the check for non-local connections.

No longer blocks: 1519339

The severity field is not set for this bug.
:ahal, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(ahal)
Severity: -- → S3
Flags: needinfo?(ahal)
Priority: -- → P3

I sorted out my network situation and so this issue is no longer affecting my ability to run Android tests locally.

While it would be nice if the test harness supported running tests without a local network, this setup is probably sufficiently uncommon that it's not worth spending time on this.

Priority: P3 → P5
You need to log in before you can comment on or make changes to this bug.