Hey @bencheng,
Thanks for your help so far. I have the forgot password plugin running in a container along side of my skygear-server now, but when I call skygear.auth.forgotPassword(email)
, I get an error message like this:
{\"error\":{\"name\":\"UnexpectedError\",\"code\":10000,\"message\":\"(\\"No table of name '{}' exists in schema '{}'.\\", '_user', 'app_boilerplate')\",\"info\":{\"trace\":\"Traceback (most recent call last):\n File \\"/usr/local/lib/python3.5/site-packages/skygear/utils/db.py\\", line 100, in get_table\n return _get_metadata().tables[_full_table_name(schema_name, name)]\nKeyError: 'app_boilerplate._user'\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File \\"/usr/local/lib/python3.5/site-packages/skygear/transmitter/common.py\\", line 40, in wrapper\n return dict(result=f(self, *args, **kwargs))\n File \\"/usr/local/lib/python3.5/site-packages/skygear/transmitter/common.py\\", line 100, in call_func\n return self.op(obj, param.get('args', {}))\n File \\"/usr/local/lib/python3.5/site-packages/skygear/transmitter/common.py\\", line 174, in op\n return func(*args, **kwargs)\n File \\"forgot_password/handlers/forgot_password.py\\", line 72, in forgot_password\n user = user_util.get_user_from_email(c, email)\n File \\"forgot_password/handlers/util/user.py\\", line 78, in get_user_from_email\n users = get_table('_user')\n File \\"/usr/local/lib/python3.5/site-packages/skygear/utils/db.py\\", line 103, in get_table\n name, schema_name)\nException: (\\"No table of name '{}' exists in schema '{}'.\\", '_user', 'app_boilerplate')\n\"}}}
app_boilerplate
is the APP_NAME
right now. From looking at the way that the users table is queried during login/signup, it seems to me that the name of the users table should be user
instead of _user
. Maybe this is what is causing the problem?
My forgot-password.yml
file is below, which is built along with the docker-compose.yml
file for my skygear-server. APP_NAME
, API_KEY
, and MASTER_KEY
are being passed down from docker-compose.yml
.
version: '2'
services:
app:
environment:
FORGOT_TRANSPORT: zmq
FORGOT_PATH: forgot
FORGOT_ARGS: tcp://0.0.0.0:5555
forgot-password:
build: https://github.com/SkygearIO/forgot_password.git
environment:
DATABASE_URL: "${DATABASE_URL}"
SKYGEAR_ADDRESS: tcp://app:5555
APP_NAME:
API_KEY:
MASTER_KEY:
LOAD_MODULES: forgot_password
PUBSUB_URL: "ws://app:${SKYGEAR_PORT}/pubsub"
SKYGEAR_ENDPOINT: "http://app:${SKYGEAR_PORT}"
FORGOT_PASSWORD_APP_NAME: "${APP_NAME}"
FORGOT_PASSWORD_URL_PREFIX: "http://app:${SKYGEAR_PORT}"
FORGOT_PASSWORD_SENDER: test_email@gmail.com
FORGOT_PASSWORD_SUBJECT: Forgot Password
SMTP_HOST: smtp.gmail.com
Any idea what might be causing the issue looking up the users table in Skygear? Thanks again for your help so far.