mozilla / fxa-content-server

DEPRECATED - Migrated to https://github.com/mozilla/fxa
Mozilla Public License 2.0
163 stars 120 forks source link

server test latest: errors on unexpected region Geneva #5817

Closed jrgm closed 6 years ago

jrgm commented 6 years ago
$ ./node_modules/.bin/intern-client config=tests/intern_server 
fxaAuthRoot=https://latest.dev.lcip.org/auth/v1 fxaContentRoot=https://latest.dev.lcip.org/ 
fxaOAuthRoot=https://oauth-latest.dev.lcip.org fxaProfileRoot=https://latest.dev.lcip.org/profile 
fxaTokenRoot=https://latest.dev.lcip.org/syncserver/token fxaProduction=true fxaDevBox=true 
asyncTimeout=10000

Creating Firefox profile...

...

√ó amplitude - complete-reset-password.verification.success
AssertionError: expected { Object (op, time, ...) } to deeply equal { Object (app_version, country, ...) }

    },
    "event_type": "fxa_email - click",
    "language": "f",
    "op": "amplitudeEvent",
E   "region": "Geneva",
    "session_id": "d",
    "time": "a",
    "user_id": "h",
    "user_properties": {

  at amplitude.then  <tests/server/amplitude.js:787:16>
  at runCallback  <timers.js:672:20>
  at tryOnImmediate  <timers.js:645:5>
  at processImmediate [as _immediateCallback]  <timers.js:617:5>
√ó amplitude - screen.sms
AssertionError: expected { Object (op, time, ...) } to deeply equal { Object (app_version, country, ...) }

    },
    "event_type": "fxa_sms - view",
    "language": "f",
    "op": "amplitudeEvent",
E   "region": "Geneva",
    "session_id": "d",
    "time": "a",
    "user_id": "h",
    "user_properties": {

  at amplitude.then  <tests/server/amplitude.js:666:16>
  at runCallback  <timers.js:672:20>
  at tryOnImmediate  <timers.js:645:5>
  at processImmediate [as _immediateCallback]  <timers.js:617:5>
√ó amplitude - flow.signup.engage
AssertionError: expected { Object (op, time, ...) } to deeply equal { Object (app_version, country, ...) }

    },
    "event_type": "fxa_reg - engage",
    "language": "f",
    "op": "amplitudeEvent",
E   "region": "Geneva",
    "session_id": "d",
    "time": "a",
    "user_id": "h",
    "user_properties": {

  at amplitude.then  <tests/server/amplitude.js:360:16>
  at runCallback  <timers.js:672:20>
  at tryOnImmediate  <timers.js:645:5>
  at processImmediate [as _immediateCallback]  <timers.js:617:5>
√ó amplitude - flow.reset-password.submit
AssertionError: expected { Object (op, time, ...) } to deeply equal { Object (app_version, country, ...) }

    "language": "blee",
    "op": "amplitudeEvent",
    "os_name": "Mac OS X",
    "os_version": "10.11",
E   "region": "Geneva",
    "session_id": "qux",
    "time": "foo",
    "user_id": "soop",
    "user_properties": {

  at amplitude.then  <tests/server/amplitude.js:95:16>
  at runCallback  <timers.js:672:20>
  at tryOnImmediate  <timers.js:645:5>
  at processImmediate [as _immediateCallback]  <timers.js:617:5>

tests/intern_server
Total:  723/723
Passed: 719  Failed: 4    Skipped: 0
jrgm commented 6 years ago

Is something not configured as expected on latest.dev.lcip.org?

jrgm commented 6 years ago

Should SMS_STATUS_GEO_ENABLED be true on latest.dev.lcip.org?

jrgm commented 6 years ago

(for auth-server config)

philbooth commented 6 years ago

@jrgm: in the content server config, GEODB_ENABLED / config.geodb.enabled needs to be true. If I set that to false locally, I reproduce the same errors you posted here. Does that fix it on latest?

jrgm commented 6 years ago

... {"Timestamp":1515031854882000000,"Logger":"fxa-auth-server","Type":"geodb.start","Severity":6,"Pid":5, "EnvVersion":"2.0","Fields":{"op":"geodb.start","enabled":true,"dbPath":"/app/node_modules/fxa-geodb/db/cities-db.mmdb"}} {"Timestamp":1515031854890000000,"Logger":"fxa-auth-server","Type":"","Severity":6,"Pid":5, "EnvVersion":"2.0","Fields":{"msg":"{\"env\":\"stage\",\"geodb\":{\"dbPath\":\".....cities-db.mmdb\",\"enabled\":true},...

philbooth commented 6 years ago

Hmmm, okay still looking into it then...

philbooth commented 6 years ago

Although I just noticed that is the auth server config you posted. Is it enabled in the content server too?

jrgm commented 6 years ago

So, content-server doesn't dump the resolved config the same way auth does, but the default for GEODB_ENABLED is true, and no override is set in the environment: https://github.com/mozilla/fxa-dev/blob/docker/roles/content/tasks/main.yml#L37-L51

jrgm commented 6 years ago

I checked the metadata for the cities-db.mmdb in the fxa-geodb module in the fxa-content container, and buildEpoch: 2018-01-05T14:59:16.000Z

jrgm commented 6 years ago
$ md5sum ./node_modules/fxa-geodb/db/cities-db.mmdb
f448112445c122b65726516a74b32db8  ./node_modules/fxa-geodb/db/cities-db.mmdb
jrgm commented 6 years ago

Do you get the same as above? ^^

rfk commented 6 years ago

FWIW I'm seeing Geneva-related errors in auth-server CI as well, see e.g. https://travis-ci.org/mozilla/fxa-auth-server/jobs/326197279

philbooth commented 6 years ago

Oh, thanks @jrgm, my local db was out of date. It appears that my clever, never-going-to-change IP address changed. I'll update the tests and just stick to the Mozilla IP address from now on.

PR imminent...

philbooth commented 6 years ago

PR imminent...

(and for the auth server too, sorry @rfk)