Topic on Talk:RESTBase/Installation

RESTBase gives "type":"https://mediawiki.org/wiki/HyperSwitch/errors/not_found#route","title":"Not found.","method":"get","uri":"/<my domain>/rest.php/v1/page/Main_Page"

2
Baplue Eric (talkcontribs)

I have a mediawiki 1.35 on RHEL 8 installation. I installed RESTBase and when I run the test command I get:

$ curl http://127.0.0.1:7231/wiki-surveyppp.app.jandenul.com/rest.php/v1/page/Main_Page

{"type":"https://mediawiki.org/wiki/HyperSwitch/errors/not_found#route","title":"Not found.","method":"get","uri":"/wiki-surveyppp.app.jandenul.com/rest.php/v1/page/Main_Page"}


On the server side I get

{"name":"restbase","hostname":"vm-mwsvdsppp01.jandenul.com","pid":2357,"level":30,"levelPath":"info/service-runner","msg":"master(2357) initializing 2 workers","time":"2021-03-24T16:55:08.128Z","v":0}

{"name":"restbase","hostname":"vm-mwsvdsppp01.jandenul.com","pid":2381,"level":50,"levelPath":"error/metrics","msg":"No such metrics client: 'undefined'","time":"2021-03-24T16:55:08.691Z","v":0}

{"name":"restbase","hostname":"vm-mwsvdsppp01.jandenul.com","pid":2381,"level":40,"levelPath":"warn/startup","msg":"listening on *:7231","time":"2021-03-24T16:55:09.634Z","v":0}

{"name":"restbase","hostname":"vm-mwsvdsppp01.jandenul.com","pid":2398,"level":50,"levelPath":"error/metrics","msg":"No such metrics client: 'undefined'","time":"2021-03-24T16:55:09.908Z","v":0}

{"name":"restbase","hostname":"vm-mwsvdsppp01.jandenul.com","pid":2398,"level":40,"levelPath":"warn/startup","msg":"listening on *:7231","time":"2021-03-24T16:55:10.376Z","v":0}

{"name":"restbase","hostname":"vm-mwsvdsppp01.jandenul.com","pid":2357,"level":40,"levelPath":"warn/service-runner","msg":"startup finished","time":"2021-03-24T16:55:10.376Z","v":0}

{

  "name": "restbase",

  "hostname": "vm-mwsvdsppp01.jandenul.com",

  "pid": 2381,

  "level": 20,

  "message": "404: not_found#route",

  "res": {

    "status": 404,

    "headers": {

      "access-control-allow-origin": "*",

      "access-control-allow-methods": "GET,HEAD",

      "access-control-allow-headers": "accept, content-type, content-length, cache-control, accept-language, api-user-agent, if-match, if-modified-since, if-none-match, dnt, accept-encoding",

      "access-control-expose-headers": "etag",

      "x-content-type-options": "nosniff",

      "x-frame-options": "SAMEORIGIN",

      "referrer-policy": "origin-when-cross-origin",

      "x-xss-protection": "1; mode=block",

      "content-security-policy": "default-src 'none'; frame-ancestors 'none'",

      "x-content-security-policy": "default-src 'none'; frame-ancestors 'none'",

      "x-webkit-csp": "default-src 'none'; frame-ancestors 'none'",

      "cache-control": "private, max-age=0, s-maxage=0, must-revalidate",

      "x-request-id": "ba598da0-8cc1-11eb-808c-d7fe3ae661f9",

      "server": "vm-mwsvdsppp01.jandenul.com"

    }

  },

  "stack": "HTTPError: 404: not_found#route

    at HyperSwitch._request (/usr/RESTBase/node_modules/hyperswitch/lib/hyperswitch.js:270:19)

    at _createFilteredHandler (/usr/RESTBase/node_modules/hyperswitch/lib/hyperswitch.js:172:26)

    at tryCatcher (/usr/RESTBase/node_modules/bluebird/js/release/util.js:16:23)

    at /usr/RESTBase/node_modules/bluebird/js/release/method.js:15:34

    at handlerWrapper (/usr/RESTBase/node_modules/hyperswitch/lib/hyperswitch.js:424:37)

    at next (/usr/RESTBase/node_modules/hyperswitch/lib/hyperswitch.js:410:42)

    at Object.normalizeHeaders [as filter] (/usr/RESTBase/lib/normalize_headers_filter.js:11:12)

    at handlerWrapper (/usr/RESTBase/node_modules/hyperswitch/lib/hyperswitch.js:422:27)

    at next (/usr/RESTBase/node_modules/hyperswitch/lib/hyperswitch.js:410:42)

    at Object.addCSPHeaders [as filter] (/usr/RESTBase/lib/security_response_header_filter.js:61:22)

    at handlerWrapper (/usr/RESTBase/node_modules/hyperswitch/lib/hyperswitch.js:422:27)

    at /usr/RESTBase/node_modules/hyperswitch/lib/hyperswitch.js:428:28

    at HyperSwitch._filteredRequest (/usr/RESTBase/node_modules/hyperswitch/lib/hyperswitch.js:173:19)

    at HyperSwitch.request (/usr/RESTBase/node_modules/hyperswitch/lib/hyperswitch.js:162:21)

    at parsePOST.catchThrow.then (/usr/RESTBase/node_modules/hyperswitch/lib/server.js:351:27)

    at tryCatcher (/usr/RESTBase/node_modules/bluebird/js/release/util.js:16:23)",

  "latency": 3,

  "root_req": {

    "method": "get",

    "uri": "/wiki-surveyppp.app.jandenul.com/rest.php/v1/page/Main_Page",

    "headers": {

      "user-agent": "curl/7.61.1",

      "x-client-ip": "::ffff:127.0.0.1",

      "x-forwarded-for": "::ffff:127.0.0.1",

      "x-request-id": "ba598da0-8cc1-11eb-808c-d7fe3ae661f9",

      "x-request-class": "internal"

    }

  },

  "request_id": "ba598da0-8cc1-11eb-808c-d7fe3ae661f9",

  "levelPath": "debug/request",

  "msg": "404: not_found#route",

  "time": "2021-03-24T16:55:24.797Z",

  "v": 0

}


But when I put http://wiki-surveyppp.app.jandenul.com/rest.php/v1/page/Main_Page in my browser I have a correct (json) reply

72.179.2.124 (talkcontribs)

I'm having the same problem. Did you ever manage to solve this?

Reply to "RESTBase gives "type":"https://mediawiki.org/wiki/HyperSwitch/errors/not_found#route","title":"Not found.","method":"get","uri":"/<my domain>/rest.php/v1/page/Main_Page""