Skip to content

Bad token error #176

@PythonCoderAS

Description

@PythonCoderAS

While running a very long edit session (over 125k edits), the process terminated with this error:

{ badtoken: badtoken: Invalid CSRF token.
    at requestError (/mnt/nfs/labstore-secondary-tools-home/rpi2026f1/.local/lib/node_modules/wikibase-cli/node_modules/wikibase-edit/lib/request/parse_response_body.js:18:15)
    at module.exports (/mnt/nfs/labstore-secondary-tools-home/rpi2026f1/.local/lib/node_modules/wikibase-cli/node_modules/wikibase-edit/lib/request/parse_response_body.js:11:33)
    at process._tickCallback (internal/process/next_tick.js:68:7)
url: https://www.wikidata.org/w/api.php?action=wbsetdescription&format=json
response status: 200
response body: {"error":{"code":"badtoken","info":"Invalid CSRF token.","*":"See https://www.wikidata.org/w/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/postorius/lists/m
ediawiki-api-announce.lists.wikimedia.org/> for notice of API deprecations and breaking changes."},"servedby":"mw2287"}
  name: 'badtoken',
  statusCode: 500,
  statusMessage: undefined,
  headers:
   Headers {
     [Symbol(map)]:
      [Object: null prototype] {
        date: [ 'Thu, 06 Apr 2023 14:38:20 GMT' ],
        server: [ 'mw2287.codfw.wmnet' ],
        'x-content-type-options': [ 'nosniff' ],
        'mediawiki-api-error': [ 'badtoken' ],
        'x-frame-options': [ 'DENY' ],
        'content-disposition': [ 'inline; filename=api-result.json' ],
        'cache-control': [ 'private, must-revalidate, max-age=0' ],
        vary: [ 'Accept-Encoding' ],
        'content-length': [ '343' ],
        'content-type': [ 'application/json; charset=utf-8' ],
        age: [ '2' ],
        'x-cache': [ 'cp1077 pass, cp1083 pass' ],
        'x-cache-status': [ 'pass' ],
        'server-timing': [ 'cache;desc="pass", host;desc="cp1083"' ],
        'strict-transport-security': [ 'max-age=106384710; includeSubDomains; preload' ],
        'report-to':
         [ '{ "group": "wm_nel", "max_age": 604800, "endpoints": [{ "url": "https://intake-logging.wikimedia.org/v1/events?stream=w3c.reportingapi.network_error&schema_uri=/w3c/reportingapi/network_error/1.0.0" }] }' ],
        nel:
         [ '{ "report_to": "wm_nel", "max_age": 604800, "failure_fraction": 0.05, "success_fraction": 0.0}' ],
        'set-cookie':
         [ 'WMF-Last-Access=06-Apr-2023;Path=/;HttpOnly;secure;Expires=Mon, 08 May 2023 12:00:00 GMT',
           'WMF-Last-Access-Global=06-Apr-2023;Path=/;Domain=.wikidata.org;HttpOnly;secure;Expires=Mon, 08 May 2023 12:00:00 GMT',
           'GeoIP=US:::37.75:-97.82:v4; Path=/; secure; Domain=.wikidata.org' ],
        'x-client-ip': [ '185.15.56.66' ],
        'accept-ranges': [ 'bytes' ] } },
  body:
   { error:
      { code: 'badtoken',
        info: 'Invalid CSRF token.',
        '*':
         'See https://www.wikidata.org/w/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/postorius/lists/mediawiki-api-announce.lists.wikimedia.org/> for notice of API de
precations and breaking changes.' },
     servedby: 'mw2287' },
  url:
   'https://www.wikidata.org/w/api.php?action=wbsetdescription&format=json',
context:
   { url:
      'https://www.wikidata.org/w/api.php?action=wbsetdescription&format=json',
     body:
      { error:
         { code: 'badtoken',
           info: 'Invalid CSRF token.',
           '*':
            'See https://www.wikidata.org/w/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/postorius/lists/mediawiki-api-announce.lists.wikimedia.org/> for notice of API
 deprecations and breaking changes.' },
        servedby: 'mw2287' } } }
  • wikibase-cli version: <!-- the latest version, right? :D > 16.3.1
  • OS version: Debian GNU/Linux 10 (buster)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions