Stf: login for LDAP return ReqlDriverCompileError: Argument 1 to get may not be `undefined`.

Created on 26 Jul 2019  路  2Comments  路  Source: openstf/stf

What is the issue or idea you have?
when i login with ldap, app return an error.
image

ReqlDriverCompileError: Argument 1 to get may not be `undefined`.
    at ReqlDriverCompileError.ReqlError [as constructor] (/app/node_modules/rethinkdb/errors.js:23:13)
    at ReqlDriverCompileError.ReqlCompileError [as constructor] (/app/node_modules/rethinkdb/errors.js:35:51)
    at new ReqlDriverCompileError (/app/node_modules/rethinkdb/errors.js:46:57)
    at Get.<anonymous> (/app/node_modules/rethinkdb/ast.js:1462:17)
    at Get.RDBOp [as constructor] (/app/node_modules/rethinkdb/ast.js:1466:8)
    at new Get (/app/node_modules/rethinkdb/ast.js:1846:38)
    at /app/node_modules/rethinkdb/ast.js:1068:43
    at Table.RDBVal.get (/app/node_modules/rethinkdb/ast.js:1070:7)
    at dbapi.saveUserAfterLogin (/app/lib/db/api.js:22:34)
    at /app/lib/units/app/middleware/auth.js:14:15
    at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/app/node_modules/express/lib/router/index.js:317:13)
    at /app/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/app/node_modules/express/lib/router/index.js:335:12)
    at next (/app/node_modules/express/lib/router/index.js:275:10)
    at _cookieSession (/app/node_modules/cookie-session/index.js:129:5)
    at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/app/node_modules/express/lib/router/index.js:317:13)
    at /app/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/app/node_modules/express/lib/router/index.js:335:12)
    at next (/app/node_modules/express/lib/router/index.js:275:10)
    at favicon (/app/node_modules/serve-favicon/index.js:68:7)

Does it only happen on a specific device? Please run adb devices -l and paste the corresponding row.

Please provide the steps to reproduce the issue.

What is the expected behavior?
When i change ldap to mock, everything is OK. For ldap, verification passed, but return an error.
Im use docker-compose to deploy, some of them are here.
I dont have rethinkdb-proxy-28015.service in my server. Im not sure it can work successfully. Does it work?

  rethinkdb:
    image: rethinkdb:2.3
    network_mode: "host"
    volumes:
      - ${RETHINK_DB_PATH}:/data
    command: rethinkdb --bind all --cache-size 8192 --http-port 8090

  stf-app-3100:
    image: openstf/stf:${STF_VERSION}
    dns: ${DNS}
    deploy:
      restart_policy:
        condition: on-failure
    depends_on:
      - rethinkdb
    environment:
      - SECRET=${STF_SECRET}
    network_mode: "host"
    command: stf app --port 3100 --auth-url http://${STF_DOMAIN}/auth/ldap/ --websocket-url http://${STF_DOMAIN}/

  stf-auth-ldap-3200:
    image: openstf/stf:${STF_VERSION}
    dns: ${DNS}
    deploy:
      restart_policy:
        condition: on-failure
    environment:
      - SECRET=${STF_SECRET}
    ports:
      - "3200:3000"
    command:  stf auth-ldap --port 3000  --ldap-search-dn ${LDAP_SEARCH_DN}  --ldap-url ldap://${LDAP_URL}  --ldap-bind-dn ${LDAP_BIND_DN}  --ldap-bind-credentials ${LDAP_BIND_CREDENTIALS} --ldap-search-field ${LDAP_SEARCH_FIELD}  --app-url http://${STF_DOMAIN}/

Do you see errors or warnings in the stf local output? If so, please paste them or the full log here.
This is docker inspect 6c3b7a64267c | grep LogPath and cat XXXX.log.

{"log":"    at Get.\u003canonymous\u003e (/app/node_modules/rethinkdb/ast.js:1462:17)\n","stream":"stderr","time":"2019-07-29T01:40:39.408693386Z"}
{"log":"    at Get.RDBOp [as constructor] (/app/node_modules/rethinkdb/ast.js:1466:8)\n","stream":"stderr","time":"2019-07-29T01:40:39.408705916Z"}
{"log":"    at new Get (/app/node_modules/rethinkdb/ast.js:1846:38)\n","stream":"stderr","time":"2019-07-29T01:40:39.408716033Z"}
{"log":"    at /app/node_modules/rethinkdb/ast.js:1068:43\n","stream":"stderr","time":"2019-07-29T01:40:39.408737907Z"}
{"log":"    at Table.RDBVal.get (/app/node_modules/rethinkdb/ast.js:1070:7)\n","stream":"stderr","time":"2019-07-29T01:40:39.408749118Z"}
{"log":"    at dbapi.saveUserAfterLogin (/app/lib/db/api.js:22:34)\n","stream":"stderr","time":"2019-07-29T01:40:39.408759034Z"}
{"log":"    at /app/lib/units/app/middleware/auth.js:14:15\n","stream":"stderr","time":"2019-07-29T01:40:39.408769198Z"}
{"log":"    at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)\n","stream":"stderr","time":"2019-07-29T01:40:39.408778934Z"}
{"log":"    at trim_prefix (/app/node_modules/express/lib/router/index.js:317:13)\n","stream":"stderr","time":"2019-07-29T01:40:39.408788532Z"}
{"log":"    at /app/node_modules/express/lib/router/index.js:284:7\n","stream":"stderr","time":"2019-07-29T01:40:39.408797915Z"}
{"log":"    at Function.process_params (/app/node_modules/express/lib/router/index.js:335:12)\n","stream":"stderr","time":"2019-07-29T01:40:39.408807249Z"}
{"log":"    at next (/app/node_modules/express/lib/router/index.js:275:10)\n","stream":"stderr","time":"2019-07-29T01:40:39.40881674Z"}
{"log":"    at _cookieSession (/app/node_modules/cookie-session/index.js:129:5)\n","stream":"stderr","time":"2019-07-29T01:40:39.408826386Z"}
{"log":"    at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)\n","stream":"stderr","time":"2019-07-29T01:40:39.408835596Z"}
{"log":"    at trim_prefix (/app/node_modules/express/lib/router/index.js:317:13)\n","stream":"stderr","time":"2019-07-29T01:40:39.408845366Z"}
{"log":"    at /app/node_modules/express/lib/router/index.js:284:7\n","stream":"stderr","time":"2019-07-29T01:40:39.408854821Z"}
{"log":"    at Function.process_params (/app/node_modules/express/lib/router/index.js:335:12)\n","stream":"stderr","time":"2019-07-29T01:40:39.408864301Z"}
{"log":"    at next (/app/node_modules/express/lib/router/index.js:275:10)\n","stream":"stderr","time":"2019-07-29T01:40:39.408887995Z"}
{"log":"    at favicon (/app/node_modules/serve-favicon/index.js:68:7)\n","stream":"stderr","time":"2019-07-29T01:40:39.408899198Z"}
{"log":"ReqlDriverCompileError: Argument 1 to get may not be `undefined`.\n","stream":"stderr","time":"2019-07-29T01:48:28.590088926Z"}
{"log":"    at ReqlDriverCompileError.ReqlError [as constructor] (/app/node_modules/rethinkdb/errors.js:23:13)\n","stream":"stderr","time":"2019-07-29T01:48:28.590143457Z"}
{"log":"    at ReqlDriverCompileError.ReqlCompileError [as constructor] (/app/node_modules/rethinkdb/errors.js:35:51)\n","stream":"stderr","time":"2019-07-29T01:48:28.590158281Z"}
{"log":"    at new ReqlDriverCompileError (/app/node_modules/rethinkdb/errors.js:46:57)\n","stream":"stderr","time":"2019-07-29T01:48:28.590170818Z"}
{"log":"    at Get.\u003canonymous\u003e (/app/node_modules/rethinkdb/ast.js:1462:17)\n","stream":"stderr","time":"2019-07-29T01:48:28.590182151Z"}
{"log":"    at Get.RDBOp [as constructor] (/app/node_modules/rethinkdb/ast.js:1466:8)\n","stream":"stderr","time":"2019-07-29T01:48:28.590194081Z"}
{"log":"    at new Get (/app/node_modules/rethinkdb/ast.js:1846:38)\n","stream":"stderr","time":"2019-07-29T01:48:28.590204786Z"}

Please run stf doctor and paste the output here.

bug

Most helpful comment

I have solve it. But I think this is a bug what is not very important.
image
The dbapi.saveUserAfterLogin needs email, but my account did not fill out email. So it is undefined.

All 2 comments

Issue-Label Bot is automatically applying the label bug to this issue, with a confidence of 0.72. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

I have solve it. But I think this is a bug what is not very important.
image
The dbapi.saveUserAfterLogin needs email, but my account did not fill out email. So it is undefined.

Was this page helpful?
0 / 5 - 0 ratings