Unable to create API tokens #4683
Unanswered
jmatlock-fnts
asked this question in
Q&A
Replies: 3 comments 3 replies
-
|
Thank you for the reply. With the docker compose version, I’m not exactly sure what should be checked from a credentials perspective. Reading through the documentation, it appears everything should just work out of the box with no changes being needed. Is my understanding correct, or have I misunderstood something?
Thank you
From: ProtoDev ***@***.***>
Sent: Saturday, May 9, 2026 5:38 PM
To: IBM/mcp-context-forge ***@***.***>
Cc: Matlock, Jeff ***@***.***>; Author ***@***.***>
Subject: Re: [IBM/mcp-context-forge] Unable to create API tokens (Discussion #4683)
WARNING - THIS IS AN EXTERNAL EMAIL
the additional details. The "Invalid authentication credentials" error typically indicates an issue with the credentials being used; please ensure they are correct and have the necessary permissions to generate tokens.
—
Reply to this email directly, view it on GitHub<https://urldefense.com/v3/__https:/github.com/IBM/mcp-context-forge/discussions/4683*discussioncomment-16865484__;Iw!!KZxU5fs11A!BBG4Ts_gyhZ3e6OvTE2EvTnxils73gowhI1j_bxVEmAQkBMDed7byMx7OLr_Uj4xTJzXRt0hgp8xgeTmiyioaP8$>, or unsubscribe<https://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/BW5Y3VK7VT4C7BSRQH62M5L4Z6XM3AVCNFSM6AAAAACYWVZEE6VHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTMOBWGU2DQNA__;!!KZxU5fs11A!BBG4Ts_gyhZ3e6OvTE2EvTnxils73gowhI1j_bxVEmAQkBMDed7byMx7OLr_Uj4xTJzXRt0hgp8xgeTmHCnObVE$>.
Triage notifications on the go with GitHub Mobile for iOS<https://urldefense.com/v3/__https:/apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675__;!!KZxU5fs11A!BBG4Ts_gyhZ3e6OvTE2EvTnxils73gowhI1j_bxVEmAQkBMDed7byMx7OLr_Uj4xTJzXRt0hgp8xgeTmvUBpZyI$> or Android<https://urldefense.com/v3/__https:/play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign*3Dnotification-email*26utm_medium*3Demail*26utm_source*3Dgithub__;JSUlJSU!!KZxU5fs11A!BBG4Ts_gyhZ3e6OvTE2EvTnxils73gowhI1j_bxVEmAQkBMDed7byMx7OLr_Uj4xTJzXRt0hgp8xgeTmBD1tS54$>.
You are receiving this because you authored the thread.Message ID: ***@***.******@***.***>>
|
Beta Was this translation helpful? Give feedback.
0 replies
-
|
From what I can tell, all environment variables are correct. I even went as far as to tear down the docker compose environment and remove all the data and rebuild it from scratch and still get the same results. The docker logs produce these additional error messages. Appears the email_users table is missing information or has incorrect information that should have been populated when the containers were created. I assume at the moment this is a bug of some sort with the contextforge docker compose setup.
gateway-1 | 2026-05-11T16:01:06 - mcpgateway.middleware.rbac - ERROR - Authentication failed: HTTPException: 401: Invalid token
gateway-1 | 2026-05-11T16:01:41 - mcpgateway.middleware.rbac - ERROR - Authentication failed: HTTPException: 401: Invalid token
gateway-1 | 2026-05-11T16:03:03 - mcpgateway.services.token_blocklist_service - ERROR - Failed to revoke token b00f0265-40b3-48f9-9786-15422d34faa4: (psycopg.errors.ForeignKeyViolation) insert or update on table "token_revocations" violates foreign key constraint "fk_token_revocations_revoked_by"
gateway-1 | DETAIL: Key (revoked_by)=(admin) is not present in table "email_users".
gateway-1 | [SQL: INSERT INTO token_revocations (jti, revoked_at, revoked_by, reason, token_expiry, last_activity) VALUES (%(jti)s::VARCHAR, %(revoked_at)s::TIMESTAMP WITH TIME ZONE, %(revoked_by)s::VARCHAR, %(reason)s::VARCHAR, %(token_expiry)s::TIMESTAMP WITH TIME ZONE, %(last_activity)s::TIMESTAMP WITH TIME ZONE)]
gateway-1 | [parameters: {'jti': 'b00f0265-40b3-48f9-9786-15422d34faa4', 'revoked_at': datetime.datetime(2026, 5, 11, 16, 3, 3, 640903, tzinfo=datetime.timezone.utc), 'revoked_by': 'admin', 'reason': 'admin_logout', 'token_expiry': datetime.datetime(2026, 5, 11, 16, 21, 5, tzinfo=datetime.timezone.utc), 'last_activity': datetime.datetime(2026, 5, 11, 16, 3, 3, 638568, tzinfo=datetime.timezone.utc)}]
gateway-1 | (Background on this error at: https://sqlalche.me/e/20/gkpj)
From: ProtoDev ***@***.***>
Sent: Sunday, May 10, 2026 5:41 PM
To: IBM/mcp-context-forge ***@***.***>
Cc: Matlock, Jeff ***@***.***>; Author ***@***.***>
Subject: Re: [IBM/mcp-context-forge] Unable to create API tokens (Discussion #4683)
WARNING - THIS IS AN EXTERNAL EMAIL
It sounds like the credentials should indeed work out of the box with the docker compose setup. Ensure that your environment variables are correctly set and match those expected by the application. If issues persist, reviewing the logs might offer further insights.
—
Reply to this email directly, view it on GitHub<https://urldefense.com/v3/__https:/github.com/IBM/mcp-context-forge/discussions/4683*discussioncomment-16872857__;Iw!!KZxU5fs11A!F9DcmUhZLGglqMmbcQnEamrP0d4iJ3JaSKaLPEysafrelWiex4EukEVsqs2ZP0ARY_I4AXaMhL2dDLpTXmEZCJ4$>, or unsubscribe<https://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/BW5Y3VIO2WS75XQQAPVKFED42EARBAVCNFSM6AAAAACYWVZEE6VHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTMOBXGI4DKNY__;!!KZxU5fs11A!F9DcmUhZLGglqMmbcQnEamrP0d4iJ3JaSKaLPEysafrelWiex4EukEVsqs2ZP0ARY_I4AXaMhL2dDLpTdJBAjGc$>.
Triage notifications on the go with GitHub Mobile for iOS<https://urldefense.com/v3/__https:/apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675__;!!KZxU5fs11A!F9DcmUhZLGglqMmbcQnEamrP0d4iJ3JaSKaLPEysafrelWiex4EukEVsqs2ZP0ARY_I4AXaMhL2dDLpTYo0Dkno$> or Android<https://urldefense.com/v3/__https:/play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign*3Dnotification-email*26utm_medium*3Demail*26utm_source*3Dgithub__;JSUlJSU!!KZxU5fs11A!F9DcmUhZLGglqMmbcQnEamrP0d4iJ3JaSKaLPEysafrelWiex4EukEVsqs2ZP0ARY_I4AXaMhL2dDLpTJlCnKJk$>.
You are receiving this because you authored the thread.Message ID: ***@***.******@***.***>>
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hey everyone. I'm new to contextforge and just finished setting it up using the docker compose method. Everything appears to be working except I'm unable to generate API tokens. The last step of deployment was to run the following command:
Generate API token
docker compose exec gateway python3 -m mcpgateway.utils.create_jwt_token
--username admin@example.com --exp 10080 --secret my-test-key
I have also tried running
docker compose exec gateway python3 -m mcpgateway.utils.create_jwt_token
--username admin@example.com --exp 10080 --secret my-test-key-but-now-longer-than-32-bytes
Both commands return the following errors:
WARN[0000] The "KEY_FILE_PASSWORD" variable is not set. Defaulting to a blank string.
Traceback (most recent call last):
File "", line 198, in _run_module_as_main
File "", line 88, in _run_code
File "/app/mcpgateway/utils/create_jwt_token.py", line 69, in
DEFAULT_ALGO: str = settings.jwt_algorithm
^^^^^^^^^^^^^^^^^^^^^^
File "/app/mcpgateway/config.py", line 3290, in getattr
return getattr(get_settings(), key)
^^^^^^^^^^^^^^
File "/app/mcpgateway/config.py", line 3232, in get_settings
cfg = Settings(**kwargs)
^^^^^^^^^^^^^^^^^^
File "/app/mcpgateway/config.py", line 3115, in init
super().init(kwargs)
File "/app/.venv/lib64/python3.12/site-packages/pydantic_settings/main.py", line 247, in init
super().init(pydantic_self.class._settings_build_values(sources, init_kwargs))
File "/app/.venv/lib64/python3.12/site-packages/pydantic/main.py", line 263, in init
validated_self = self.pydantic_validator.validate_python(data, self_instance=self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pydantic_core._pydantic_core.ValidationError: 10 validation errors for Settings
experimental_rust_mcp_runtime_enabled
Input should be a valid boolean, unable to interpret input [type=bool_parsing, input_value='', input_type=str]
For further information visit https://errors.pydantic.dev/2.13/v/bool_parsing
experimental_rust_mcp_session_core_enabled
Input should be a valid boolean, unable to interpret input [type=bool_parsing, input_value='', input_type=str]
For further information visit https://errors.pydantic.dev/2.13/v/bool_parsing
experimental_rust_mcp_event_store_enabled
Input should be a valid boolean, unable to interpret input [type=bool_parsing, input_value='', input_type=str]
For further information visit https://errors.pydantic.dev/2.13/v/bool_parsing
experimental_rust_mcp_resume_core_enabled
Input should be a valid boolean, unable to interpret input [type=bool_parsing, input_value='', input_type=str]
For further information visit https://errors.pydantic.dev/2.13/v/bool_parsing
experimental_rust_mcp_live_stream_core_enabled
Input should be a valid boolean, unable to interpret input [type=bool_parsing, input_value='', input_type=str]
For further information visit https://errors.pydantic.dev/2.13/v/bool_parsing
experimental_rust_mcp_affinity_core_enabled
Input should be a valid boolean, unable to interpret input [type=bool_parsing, input_value='', input_type=str]
For further information visit https://errors.pydantic.dev/2.13/v/bool_parsing
experimental_rust_mcp_session_auth_reuse_enabled
Input should be a valid boolean, unable to interpret input [type=bool_parsing, input_value='', input_type=str]
For further information visit https://errors.pydantic.dev/2.13/v/bool_parsing
experimental_rust_a2a_runtime_enabled
Input should be a valid boolean, unable to interpret input [type=bool_parsing, input_value='', input_type=str]
For further information visit https://errors.pydantic.dev/2.13/v/bool_parsing
experimental_rust_a2a_runtime_delegate_enabled
Input should be a valid boolean, unable to interpret input [type=bool_parsing, input_value='', input_type=str]
For further information visit https://errors.pydantic.dev/2.13/v/bool_parsing
experimental_rust_a2a_runtime_managed
Input should be a valid boolean, unable to interpret input [type=bool_parsing, input_value='', input_type=str]
For further information visit https://errors.pydantic.dev/2.13/v/bool_parsing
Also when trying to create via the UI, the error returned is as follows:
Failed to create token: Invalid authentication credentials
I've poured over all the documentation and I am not sure what I'm missing. Has anyone ran in to this issue and resolved it?
Beta Was this translation helpful? Give feedback.
All reactions