Thanks for the details @regis
Based on my limited knowledge of the Tutor platform, I can only see that the tutor_local_lms-worker_1 container gets stuck in a loop of restarting which is why I was getting the 500 error (I might be interpreting the errors wrong though) so I’m assuming that however I’m trying to do this is either being done in the wrong place or following wrong syntax but no matter how many variations I try my lms worker fails to start.
Is there an actual documented procedure on how to use REGISTRATION_EMAIL_PATTERNS_ALLOWED or real-world examples I can follow, since the original docs describing the feature don’t apply to Tutor but the Native method? Please forgive my ignorance and/or stupidity 
Here’s clip from my logs (specifically when I try restart with the new setting in config/lms.env.json)
I also tried adding it to config.yml and running tutor config save --interactive (as per the concepts doc you referred) but the new setting does not show anywhere in the json files hence why I’m doing manual entry into the json files
lms-worker_1 | Traceback (most recent call last):
lms-worker_1 | File "/openedx/venv/lib/python3.8/site-packages/kombu/utils/objects.py", line 42, in __get__
lms-worker_1 | return obj.__dict__[self.__name__]
lms-worker_1 | KeyError: 'data'
lms-worker_1 |
lms-worker_1 | During handling of the above exception, another exception occurred:
lms-worker_1 |
lms-worker_1 | Traceback (most recent call last):
lms-worker_1 | File "/openedx/venv/bin/celery", line 8, in <module>
lms-worker_1 | sys.exit(main())
lms-worker_1 | File "/openedx/venv/lib/python3.8/site-packages/celery/__main__.py", line 16, in main
lms-worker_1 | _main()
lms-worker_1 | File "/openedx/venv/lib/python3.8/site-packages/celery/bin/celery.py", line 322, in main
lms-worker_1 | cmd.execute_from_commandline(argv)
lms-worker_1 | File "/openedx/venv/lib/python3.8/site-packages/celery/bin/celery.py", line 499, in execute_from_commandline
lms-worker_1 | super(CeleryCommand, self).execute_from_commandline(argv)))
lms-worker_1 | File "/openedx/venv/lib/python3.8/site-packages/celery/bin/base.py", line 305, in execute_from_commandline
lms-worker_1 | return self.handle_argv(self.prog_name, argv[1:])
lms-worker_1 | File "/openedx/venv/lib/python3.8/site-packages/celery/bin/celery.py", line 491, in handle_argv
lms-worker_1 | return self.execute(command, argv)
lms-worker_1 | File "/openedx/venv/lib/python3.8/site-packages/celery/bin/celery.py", line 415, in execute
lms-worker_1 | return cls(
lms-worker_1 | File "/openedx/venv/lib/python3.8/site-packages/celery/bin/worker.py", line 221, in run_from_argv
lms-worker_1 | *self.parse_options(prog_name, argv, command))
lms-worker_1 | File "/openedx/venv/lib/python3.8/site-packages/celery/bin/base.py", line 428, in parse_options
lms-worker_1 | self.parser = self.create_parser(prog_name, command)
lms-worker_1 | File "/openedx/venv/lib/python3.8/site-packages/celery/bin/base.py", line 444, in create_parser
lms-worker_1 | self.add_arguments(parser)
lms-worker_1 | File "/openedx/venv/lib/python3.8/site-packages/celery/bin/worker.py", line 278, in add_arguments
lms-worker_1 | default=conf.worker_state_db,
lms-worker_1 | File "/openedx/venv/lib/python3.8/site-packages/celery/utils/collections.py", line 134, in __getattr__
lms-worker_1 | return self[k]
lms-worker_1 | File "/openedx/venv/lib/python3.8/site-packages/celery/utils/collections.py", line 444, in __getitem__
lms-worker_1 | return getitem(k)
lms-worker_1 | File "/openedx/venv/lib/python3.8/site-packages/celery/utils/collections.py", line 287, in __getitem__
lms-worker_1 | return mapping[_key]
lms-worker_1 | File "/opt/pyenv/versions/3.8.12/lib/python3.8/collections/__init__.py", line 1006, in __getitem__
lms-worker_1 | if key in self.data:
lms-worker_1 | File "/openedx/venv/lib/python3.8/site-packages/kombu/utils/objects.py", line 44, in __get__
lms-worker_1 | value = obj.__dict__[self.__name__] = self.__get(obj)
lms-worker_1 | File "/openedx/venv/lib/python3.8/site-packages/celery/app/base.py", line 141, in data
lms-worker_1 | return self.callback()
lms-worker_1 | File "/openedx/venv/lib/python3.8/site-packages/celery/app/base.py", line 920, in _finalize_pending_conf
lms-worker_1 | conf = self._conf = self._load_config()
lms-worker_1 | File "/openedx/venv/lib/python3.8/site-packages/celery/app/base.py", line 930, in _load_config
lms-worker_1 | self.loader.config_from_object(self._config_source)
lms-worker_1 | File "/openedx/venv/lib/python3.8/site-packages/celery/loaders/base.py", line 131, in config_from_object
lms-worker_1 | self._conf = force_mapping(obj)
lms-worker_1 | File "/openedx/venv/lib/python3.8/site-packages/celery/utils/collections.py", line 54, in force_mapping
lms-worker_1 | if isinstance(m, (LazyObject, LazySettings)):
lms-worker_1 | File "/openedx/venv/lib/python3.8/site-packages/django/utils/functional.py", line 246, in inner
lms-worker_1 | self._setup()
lms-worker_1 | File "/openedx/venv/lib/python3.8/site-packages/django/conf/__init__.py", line 69, in _setup
lms-worker_1 | self._wrapped = Settings(settings_module)
lms-worker_1 | File "/openedx/venv/lib/python3.8/site-packages/django/conf/__init__.py", line 170, in __init__
lms-worker_1 | mod = importlib.import_module(self.SETTINGS_MODULE)
lms-worker_1 | File "/opt/pyenv/versions/3.8.12/lib/python3.8/importlib/__init__.py", line 127, in import_module
lms-worker_1 | return _bootstrap._gcd_import(name[level:], package, level)
lms-worker_1 | File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
lms-worker_1 | File "<frozen importlib._bootstrap>", line 991, in _find_and_load
lms-worker_1 | File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
lms-worker_1 | File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
lms-worker_1 | File "<frozen importlib._bootstrap_external>", line 843, in exec_module
lms-worker_1 | File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
lms-worker_1 | File "/openedx/edx-platform/lms/envs/tutor/production.py", line 3, in <module>
lms-worker_1 | from lms.envs.production import *
lms-worker_1 | File "/openedx/edx-platform/lms/envs/production.py", line 66, in <module>
lms-worker_1 | __config__ = yaml.safe_load(f)
lms-worker_1 | File "/openedx/venv/lib/python3.8/site-packages/yaml/__init__.py", line 125, in safe_load
lms-worker_1 | return load(stream, SafeLoader)
lms-worker_1 | File "/openedx/venv/lib/python3.8/site-packages/yaml/__init__.py", line 81, in load
lms-worker_1 | return loader.get_single_data()
lms-worker_1 | File "/openedx/venv/lib/python3.8/site-packages/yaml/constructor.py", line 49, in get_single_data
lms-worker_1 | node = self.get_single_node()
lms-worker_1 | File "/openedx/venv/lib/python3.8/site-packages/yaml/composer.py", line 36, in get_single_node
lms-worker_1 | document = self.compose_document()
lms-worker_1 | File "/openedx/venv/lib/python3.8/site-packages/yaml/composer.py", line 55, in compose_document
lms-worker_1 | node = self.compose_node(None, None)
lms-worker_1 | File "/openedx/venv/lib/python3.8/site-packages/yaml/composer.py", line 84, in compose_node
lms-worker_1 | node = self.compose_mapping_node(anchor)
lms-worker_1 | File "/openedx/venv/lib/python3.8/site-packages/yaml/composer.py", line 127, in compose_mapping_node
lms-worker_1 | while not self.check_event(MappingEndEvent):
lms-worker_1 | File "/openedx/venv/lib/python3.8/site-packages/yaml/parser.py", line 98, in check_event
lms-worker_1 | self.current_event = self.state()
lms-worker_1 | File "/openedx/venv/lib/python3.8/site-packages/yaml/parser.py", line 549, in parse_flow_mapping_key
lms-worker_1 | raise ParserError("while parsing a flow mapping", self.marks[-1],
lms-worker_1 | yaml.parser.ParserError: while parsing a flow mapping
lms-worker_1 | in "/openedx/config/lms.env.json", line 1, column 1
lms-worker_1 | expected ',' or '}', but got '<scalar>'
lms-worker_1 | in "/openedx/config/lms.env.json", line 123, column 1
tutor_local_lms-worker_1 exited with code 1
EDIT:
@regis I think maybe I made some progress, I’ve put (near bottom of lms.env.json file) as follows below and not getting errors or having the workers stuck restarting, however this breaks registration entirely even with valid domains. It allows me to fill in all the details to register and doesn’t show any errors, but clicking the “create account” button simply makes it go greyed out and then nothing happens, clip of logs below config file
{
"SITE_NAME": "lms.domain.tld",
"BOOK_URL": "",
"LOG_DIR": "/openedx/data/logs",
"LOGGING_ENV": "sandbox",
"OAUTH_OIDC_ISSUER": "https://lms.domain.tld/oauth2",
"PLATFORM_NAME": "myplatformname",
"FEATURES": {
"CERTIFICATES_HTML_VIEW": true,
"PREVIEW_LMS_BASE": "preview.lms.domain.tld",
"ENABLE_CORS_HEADERS": true,
"ENABLE_COURSE_DISCOVERY": true,
"ENABLE_COURSEWARE_SEARCH": true,
"ENABLE_CSMH_EXTENDED": false,
"ENABLE_DASHBOARD_SEARCH": true,
"ENABLE_COMBINED_LOGIN_REGISTRATION": true,
"ENABLE_GRADE_DOWNLOADS": true,
"ENABLE_LEARNER_RECORDS": false,
"ENABLE_MOBILE_REST_API": true,
"ENABLE_OAUTH2_PROVIDER": true,
"ENABLE_THIRD_PARTY_AUTH": true,
"MILESTONES_APP": true,
"ENABLE_PREREQUISITE_COURSES": true
},
"LMS_ROOT_URL": "https://lms.domain.tld",
"CMS_ROOT_URL": "https://cms.domain.tld",
"CMS_BASE": "cms.domain.tld",
"LMS_BASE": "lms.domain.tld",
"CONTACT_EMAIL": "support@domain.tld",
"CELERY_BROKER_TRANSPORT": "redis",
"CELERY_BROKER_HOSTNAME": "redis:6379",
"CELERY_BROKER_VHOST": "0",
"CELERY_BROKER_USER": "",
"CELERY_BROKER_PASSWORD": "",
"ALTERNATE_WORKER_QUEUES": "cms",
"ENABLE_COMPREHENSIVE_THEMING": true,
"COMPREHENSIVE_THEME_DIRS": ["/openedx/themes"],
"STATIC_ROOT_BASE": "/openedx/staticfiles",
"EMAIL_BACKEND": "django.core.mail.backends.smtp.EmailBackend",
"EMAIL_HOST": "smtp",
"EMAIL_PORT": 8025,
"EMAIL_USE_TLS": false,
"ACE_ROUTING_KEY": "edx.lms.core.default",
"HTTPS": "on",
"LANGUAGE_CODE": "en",
"SESSION_COOKIE_DOMAIN": "lms.domain.tld",
"CACHES": {
"default": {
"KEY_PREFIX": "default",
"VERSION": "1",
"BACKEND": "django_redis.cache.RedisCache",
"LOCATION": "redis://@redis:6379/1"
},
"general": {
"KEY_PREFIX": "general",
"BACKEND": "django_redis.cache.RedisCache",
"LOCATION": "redis://@redis:6379/1"
},
"mongo_metadata_inheritance": {
"KEY_PREFIX": "mongo_metadata_inheritance",
"TIMEOUT": 300,
"BACKEND": "django_redis.cache.RedisCache",
"LOCATION": "redis://@redis:6379/1"
},
"staticfiles": {
"KEY_PREFIX": "staticfiles_lms",
"BACKEND": "django.core.cache.backends.locmem.LocMemCache",
"LOCATION": "staticfiles_lms"
},
"configuration": {
"KEY_PREFIX": "configuration",
"BACKEND": "django_redis.cache.RedisCache",
"LOCATION": "redis://@redis:6379/1"
},
"celery": {
"KEY_PREFIX": "celery",
"TIMEOUT": "7200",
"BACKEND": "django_redis.cache.RedisCache",
"LOCATION": "redis://@redis:6379/1"
},
"course_structure_cache": {
"KEY_PREFIX": "course_structure",
"TIMEOUT": "7200",
"BACKEND": "django_redis.cache.RedisCache",
"LOCATION": "redis://@redis:6379/1"
},
"ora2-storage": {
"KEY_PREFIX": "ora2-storage",
"BACKEND": "django_redis.cache.RedisCache",
"LOCATION": "redis://@redis:6379/1"
}
},
"SECRET_KEY": "secret",
"AWS_ACCESS_KEY_ID": "",
"AWS_SECRET_ACCESS_KEY": "",
"CONTENTSTORE": null,
"DOC_STORE_CONFIG": null,
"XQUEUE_INTERFACE": {
"django_auth": null,
"url": null
},
"DATABASES": {
"default": {
"ENGINE": "django.db.backends.mysql",
"HOST": "mysql",
"PORT": 3306,
"NAME": "openedx",
"USER": "openedx",
"PASSWORD": "secret",
"ATOMIC_REQUESTS": true,
"OPTIONS": {
"init_command": "SET sql_mode='STRICT_TRANS_TABLES'"
}
}
},
"REGISTRATION_EMAIL_PATTERNS_ALLOWED": ".*@domain.tld", ".*@sub.domain.tld", ".*@domain2.tld", ".*@domain3.tld", ".*@domain4.tld",
"EMAIL_HOST_USER": "",
"EMAIL_HOST_PASSWORD": ""
}
Here’s logs created during the registration process, filled in all details and clicked on “Create Account” button, it goes from clickable to greyed out, and then nothing happens (no errors and doesn’t proceed to another page
caddy_1 | {"level":"error","ts":1645452028.5802546,"logger":"http.log.access.log0","msg":"handled request","request":{"remote_addr":"10.100.13.239:63483","proto":"HTTP/2.0","method":"POST","host":"lms.domain.tld","uri":"/api/user/v1/validation/registration","tls":{"resumed":false,"version":772,"cipher_suite":4867,"proto":"h2","proto_mutual":true,"server_name":"lms.domain.tld"}},"duration":0.129075737,"size":63,"status":403}
lms_1 | [pid: 9|app: 0|req: 74/220] 172.18.0.10 () {64 vars in 1534 bytes} [Mon Feb 21 14:00:28 2022] POST /api/user/v1/validation/registration => generated 63 bytes in 31 msecs (HTTP/1.1 403) 7 headers in 230 bytes (1 switches on core 0)
lms_1 | 2022-02-21 14:00:28,610 ERROR 24 [django.request] [user None] [ip 10.100.13.239] log.py:224 - Internal Server Error: /api/user/v2/account/registration/
lms_1 | Traceback (most recent call last):
lms_1 | File "/openedx/venv/lib/python3.8/site-packages/django/core/handlers/exception.py", line 47, in inner
lms_1 | response = get_response(request)
lms_1 | File "/openedx/venv/lib/python3.8/site-packages/django/core/handlers/base.py", line 181, in _get_response
lms_1 | response = wrapped_callback(request, *callback_args, **callback_kwargs)
lms_1 | File "/openedx/venv/lib/python3.8/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
lms_1 | return view_func(*args, **kwargs)
lms_1 | File "/openedx/venv/lib/python3.8/site-packages/django/views/generic/base.py", line 70, in view
lms_1 | return self.dispatch(request, *args, **kwargs)
lms_1 | File "/openedx/venv/lib/python3.8/site-packages/django/utils/decorators.py", line 43, in _wrapper
lms_1 | return bound_method(*args, **kwargs)
lms_1 | File "/openedx/venv/lib/python3.8/site-packages/django/utils/decorators.py", line 43, in _wrapper
lms_1 | return bound_method(*args, **kwargs)
lms_1 | File "/openedx/venv/lib/python3.8/site-packages/django/views/decorators/debug.py", line 89, in sensitive_post_parameters_wrapper
lms_1 | return view(request, *args, **kwargs)
lms_1 | File "/openedx/edx-platform/./openedx/core/djangoapps/user_authn/views/register.py", line 529, in dispatch
lms_1 | return super().dispatch(request, *args, **kwargs)
lms_1 | File "/openedx/venv/lib/python3.8/site-packages/rest_framework/views.py", line 509, in dispatch
lms_1 | response = self.handle_exception(exc)
lms_1 | File "/openedx/venv/lib/python3.8/site-packages/rest_framework/views.py", line 469, in handle_exception
lms_1 | self.raise_uncaught_exception(exc)
lms_1 | File "/openedx/venv/lib/python3.8/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception
lms_1 | raise exc
lms_1 | File "/openedx/venv/lib/python3.8/site-packages/rest_framework/views.py", line 506, in dispatch
lms_1 | response = handler(request, *args, **kwargs)
lms_1 | File "/openedx/venv/lib/python3.8/site-packages/django/utils/decorators.py", line 43, in _wrapper
lms_1 | return bound_method(*args, **kwargs)
lms_1 | File "/openedx/venv/lib/python3.8/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
lms_1 | return view_func(*args, **kwargs)
lms_1 | File "/openedx/venv/lib/python3.8/site-packages/django/utils/decorators.py", line 43, in _wrapper
lms_1 | return bound_method(*args, **kwargs)
lms_1 | File "/openedx/venv/lib/python3.8/site-packages/ratelimit/decorators.py", line 24, in _wrapped
lms_1 | return fn(request, *args, **kw)
lms_1 | File "/openedx/edx-platform/./openedx/core/djangoapps/user_authn/views/register.py", line 573, in post
lms_1 | response, user = self._create_account(request, data)
lms_1 | File "/openedx/edx-platform/./openedx/core/djangoapps/user_authn/views/register.py", line 634, in _create_account
lms_1 | user = create_account_with_params(request, data)
lms_1 | File "/openedx/edx-platform/./openedx/core/djangoapps/user_authn/views/register.py", line 219, in create_account_with_params
lms_1 | (user, profile, registration) = do_create_account(form, custom_form)
lms_1 | File "/openedx/edx-platform/common/djangoapps/student/helpers.py", line 680, in do_create_account
lms_1 | errors.update(form.errors)
lms_1 | File "/openedx/venv/lib/python3.8/site-packages/django/forms/forms.py", line 170, in errors
lms_1 | self.full_clean()
lms_1 | File "/openedx/venv/lib/python3.8/site-packages/django/forms/forms.py", line 372, in full_clean
lms_1 | self._clean_fields()
lms_1 | File "/openedx/venv/lib/python3.8/site-packages/django/forms/forms.py", line 393, in _clean_fields
lms_1 | value = getattr(self, 'clean_%s' % name)()
lms_1 | File "/openedx/edx-platform/./openedx/core/djangoapps/user_authn/views/registration_form.py", line 251, in clean_email
lms_1 | if not any(re.match(pattern + "$", email) for pattern in allowed_patterns):
lms_1 | File "/openedx/edx-platform/./openedx/core/djangoapps/user_authn/views/registration_form.py", line 251, in <genexpr>
lms_1 | if not any(re.match(pattern + "$", email) for pattern in allowed_patterns):
lms_1 | File "/opt/pyenv/versions/3.8.12/lib/python3.8/re.py", line 191, in match
lms_1 | return _compile(pattern, flags).match(string)
lms_1 | File "/opt/pyenv/versions/3.8.12/lib/python3.8/re.py", line 304, in _compile
lms_1 | p = sre_compile.compile(pattern, flags)
lms_1 | File "/opt/pyenv/versions/3.8.12/lib/python3.8/sre_compile.py", line 764, in compile
lms_1 | p = sre_parse.parse(p, flags)
lms_1 | File "/opt/pyenv/versions/3.8.12/lib/python3.8/sre_parse.py", line 948, in parse
lms_1 | p = _parse_sub(source, state, flags & SRE_FLAG_VERBOSE, 0)
lms_1 | File "/opt/pyenv/versions/3.8.12/lib/python3.8/sre_parse.py", line 443, in _parse_sub
lms_1 | itemsappend(_parse(source, state, verbose, nested + 1,
lms_1 | File "/opt/pyenv/versions/3.8.12/lib/python3.8/sre_parse.py", line 668, in _parse
lms_1 | raise source.error("nothing to repeat",
lms_1 | re.error: nothing to repeat at position 0
caddy_1 | {"level":"error","ts":1645452028.7658617,"logger":"http.log.access.log0","msg":"handled request","request":{"remote_addr":"10.100.13.239:63483","proto":"HTTP/2.0","method":"POST","host":"lms.domain.tld","uri":"/api/user/v2/account/registration/","tls":{"resumed":false,"version":772,"cipher_suite":4867,"proto":"h2","proto_mutual":true,"server_name":"lms.domain.tld"}},"duration":0.314664175,"size":8777,"status":500}
lms_1 | [pid: 24|app: 0|req: 67/221] 172.18.0.10 () {64 vars in 1487 bytes} [Mon Feb 21 14:00:28 2022] POST /api/user/v2/account/registration/ => generated 8777 bytes in 314 msecs (HTTP/1.1 500) 7 headers in 406 bytes (1 switches on core 0)