Page MenuHomePhabricator

Push notification service should make deletion requests to MediaWiki for invalid or expired subscriptions
Closed, ResolvedPublic

Description

Follow up from T259148.

When a push notification provider API provides a response indicating that a token or subscription is invalid or expired, the service should make a request to the MediaWiki API to delete that push subscription.

See the API docs at api.php?action=help&modules=echopushsubscriptions%2Bdelete as updated once https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Echo/+/619570 lands. (That module should probably also be updated to accept batched deletion requests.)

AC

  • The bot secrets are added to production environment

Event Timeline

Change 620770 had a related patch set uploaded (by Mholloway; owner: Michael Holloway):
[mediawiki/services/push-notifications@master] Restore MW API request support code

https://gerrit.wikimedia.org/r/620770

Change 620800 had a related patch set uploaded (by Mholloway; owner: Michael Holloway):
[mediawiki/services/push-notifications@master] Add MW API login support

https://gerrit.wikimedia.org/r/620800

Mholloway lowered the priority of this task from High to Medium.Aug 20 2020, 4:14 PM

Lowering the priority since we're not considering this a release blocker.

Change 620770 merged by jenkins-bot:
[mediawiki/services/push-notifications@master] Restore MW API request support code

https://gerrit.wikimedia.org/r/620770

Change 620800 merged by jenkins-bot:
[mediawiki/services/push-notifications@master] Add MW API login support

https://gerrit.wikimedia.org/r/620800

Change 622376 had a related patch set uploaded (by Mholloway; owner: Michael Holloway):
[mediawiki/services/push-notifications@master] WIP: Clean up invalid subscriptions

https://gerrit.wikimedia.org/r/622376

Change 622376 merged by jenkins-bot:
[mediawiki/services/push-notifications@master] Clean up invalid subscriptions

https://gerrit.wikimedia.org/r/622376

Change 624043 had a related patch set uploaded (by MSantos; owner: MSantos):
[operations/deployment-charts@master] WIP: push-notif: add stanzas for requests to MWAPI

https://gerrit.wikimedia.org/r/624043

@Mholloway what should be done here to move this forward to production?

I'm seeing the following error when the service tries to connect to the MediaWiki API. It looks like a (cluster-internal) TLS configuration issue.

{
  "headers": {
    "content-type": "application/problem+json"
  },
  "stack": "HTTPError: unable to verify the first certificate\n    at request.then (/srv/service/node_modules/preq/index.js:246:19)\n    at tryCatcher (/srv/service/node_modules/bluebird/js/release/util.js:16:23)\n    at Promise._settlePromiseFromHandler (/srv/service/node_modules/bluebird/js/release/promise.js:547:31)\n    at Promise._settlePromise (/srv/service/node_modules/bluebird/js/release/promise.js:604:18)\n    at Promise._settlePromise0 (/srv/service/node_modules/bluebird/js/release/promise.js:649:10)\n    at Promise._settlePromises (/srv/service/node_modules/bluebird/js/release/promise.js:725:18)\n    at _drainQueueStep (/srv/service/node_modules/bluebird/js/release/async.js:93:12)\n    at _drainQueue (/srv/service/node_modules/bluebird/js/release/async.js:86:9)\n    at Async._drainQueues (/srv/service/node_modules/bluebird/js/release/async.js:102:5)\n    at Immediate.Async.drainQueues [as _onImmediate] (/srv/service/node_modules/bluebird/js/release/async.js:15:14)\n    at runCallback (timers.js:705:18)\n    at tryOnImmediate (timers.js:676:5)\n    at processImmediate (timers.js:658:5)",
  "name": "push-notifications",
  "message": "unable to verify the first certificate",
  "body": {
    "internalErr": "unable to verify the first certificate",
    "internalURI": "https://api-rw.discovery.wmnet/w/api.php",
    "internalMethod": "post",
    "detail": "unable to verify the first certificate",
    "type": "internal_http_error",
    "internalStack": "Error: unable to verify the first certificate\n    at TLSSocket.onConnectSecure (_tls_wrap.js:1055:34)\n    at TLSSocket.emit (events.js:189:13)\n    at TLSSocket._finishInit (_tls_wrap.js:633:8)"
  },
  "status": 504,
  "levelPath": "debug"
}

https://logstash.wikimedia.org/goto/50e805f06bdb1ac27ca8eedc732df8ab

Looks like we didn't tell nodejs to use the puppet CA.

Or even better: it should use the service proxy directly (which automagically sets up https for you)

Change 629656 had a related patch set uploaded (by Effie Mouzeli; owner: Effie Mouzeli):
[operations/deployment-charts@master] push-notifications: enable service proxy

https://gerrit.wikimedia.org/r/629656

Change 629656 merged by jenkins-bot:
[operations/deployment-charts@master] push-notifications: enable service proxy

https://gerrit.wikimedia.org/r/629656

Mholloway renamed this task from Push notification service should make deletion requests to the MW API for invalid or expired subscriptions to Push notification service should make deletion requests to MediaWiki for invalid or expired subscriptions.Sep 29 2020, 5:28 PM

The TLS issue should be gone with the introduction of the service proxy for wikifeeds. @Mholloway can you confirm that's the case?

The TLS issue should be gone with the introduction of the service proxy for wikifeeds. @Mholloway can you confirm that's the case?

Yes, confirmed.

Change 624043 abandoned by JMeybohm:
[operations/deployment-charts@master] WIP: push-notif: add stanzas for requests to MWAPI

Reason:
Already mergen as part of I66a31dbf0767eaff779358d5e37c9ff93091edda

https://gerrit.wikimedia.org/r/624043

Jgiannelos claimed this task.