0% found this document useful (0 votes)
24 views

Prompt Backend Error

The document details logs from starting up a backend application using Docker Compose. It initializes Redis and DynamoDB containers and attaches the logs. The backend fails to start up due to an error loading a private key file when trying to authenticate with GitHub.

Uploaded by

Vishal Singh
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views

Prompt Backend Error

The document details logs from starting up a backend application using Docker Compose. It initializes Redis and DynamoDB containers and attaches the logs. The backend fails to start up due to an error loading a private key file when trying to authenticate with GitHub.

Uploaded by

Vishal Singh
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

[ec2-user@ip-10-42-1-131 ml-mesh]$ make apps.

start/prompt COMPONENT=backend
ENVIRONMENT=dev
docker compose -f apps/prompt/docker-compose.dev.yaml --profile backend up --force-
recreate
WARN[0000] The "GITHUB_TOKEN" variable is not set. Defaulting to a blank string.
WARN[0000] /home/ec2-user/ml-mesh/apps/prompt/docker-compose.dev.yaml: `version` is
obsolete
[+] Running 3/0
✔ Container prompt-redisdb-1 Recreated
0.0s
✔ Container prompt-dynamodb-1 Recreated
0.0s
✔ Container prompt-backend-1 Recreated
0.0s
Attaching to backend-1, dynamodb-1, redisdb-1
redisdb-1 | 1:C 24 May 2024 17:12:48.242 # oO0OoO0OoO0Oo Redis is starting
oO0OoO0OoO0Oo
redisdb-1 | 1:C 24 May 2024 17:12:48.242 # Redis version=7.0.15, bits=64,
commit=00000000, modified=0, pid=1, just started
redisdb-1 | 1:C 24 May 2024 17:12:48.242 # Warning: no config file specified,
using the default config. In order to specify a config file use redis-server
/path/to/redis.conf
redisdb-1 | 1:M 24 May 2024 17:12:48.243 * monotonic clock: POSIX clock_gettime
redisdb-1 | 1:M 24 May 2024 17:12:48.243 * Running mode=standalone, port=6379.
redisdb-1 | 1:M 24 May 2024 17:12:48.243 # Server initialized
redisdb-1 | 1:M 24 May 2024 17:12:48.243 * Loading RDB produced by version 7.0.15
redisdb-1 | 1:M 24 May 2024 17:12:48.243 * RDB age 185 seconds
redisdb-1 | 1:M 24 May 2024 17:12:48.243 * RDB memory usage when created 0.82 Mb
redisdb-1 | 1:M 24 May 2024 17:12:48.244 * Done loading RDB, keys loaded: 0, keys
expired: 0.
redisdb-1 | 1:M 24 May 2024 17:12:48.244 * DB loaded from disk: 0.000 seconds
redisdb-1 | 1:M 24 May 2024 17:12:48.244 * Ready to accept connections
dynamodb-1 | Initializing DynamoDB Local with the following configuration:
dynamodb-1 | Port: 8000
dynamodb-1 | InMemory: false
dynamodb-1 | Version: 2.4.0
dynamodb-1 | DbPath: null
dynamodb-1 | SharedDb: true
dynamodb-1 | shouldDelayTransientStatuses: false
dynamodb-1 | CorsParams: null
dynamodb-1 |
backend-1 | INFO: Will watch for changes in these directories:
['/apps/prompt/backend']
backend-1 | INFO: Uvicorn running on http://0.0.0.0:4000 (Press CTRL+C to
quit)
backend-1 | INFO: Started reloader process [1] using StatReload
backend-1 | src.app - (app.py).create_app(24) - Initializing application...
backend-1 | src.app - (app.py).create_app(46) - Adding routers...
backend-1 | INFO: Started server process [9]
backend-1 | INFO: Waiting for application startup.
backend-1 | src._init - (_init.py).init(31) - Creating tables...
backend-1 | ERROR: Traceback (most recent call last):
backend-1 | File "/usr/local/lib/python3.8/site-packages/jwt/algorithms.py",
line 350, in prepare_key
backend-1 | RSAPrivateKey, load_pem_private_key(key_bytes, password=None)
backend-1 | File
"/usr/local/lib/python3.8/site-packages/cryptography/hazmat/backends/openssl/
backend.py", line 494, in _handle_key_loading_error
backend-1 | raise ValueError(
backend-1 | ValueError: ('Could not deserialize key data. The data may be in an
incorrect format, it may be encrypted with an unsupported algorithm, or it may be
an unsupported key type (e.g. EC curves with explicit parameters).',
[<OpenSSLError(code=503841036, lib=60, reason=524556, reason_text=unsupported)>])
backend-1 |
backend-1 | During handling of the above exception, another exception occurred:
backend-1 |
backend-1 | Traceback (most recent call last):
backend-1 | File "/usr/local/lib/python3.8/site-packages/starlette/routing.py",
line 671, in lifespan
backend-1 | async with self.lifespan_context(app):
backend-1 | File "/usr/local/lib/python3.8/site-packages/starlette/routing.py",
line 566, in __aenter__
backend-1 | await self._router.startup()
backend-1 | File "/usr/local/lib/python3.8/site-packages/starlette/routing.py",
line 650, in startup
backend-1 | handler()
backend-1 | File "/apps/prompt/backend/src/_init.py", line 34, in init
backend-1 | _syncronize_prompts()
backend-1 | File "/apps/prompt/backend/src/_init.py", line 56, in
_syncronize_prompts
backend-1 | files = github.ls("")
backend-1 | File "/apps/prompt/backend/src/extensions/github.py", line 53, in
ls
backend-1 | contents = self.repo.get_contents(path)
backend-1 | File "/apps/prompt/backend/src/extensions/github.py", line 33, in
repo
backend-1 | installation = gi.get_installations()[0]
backend-1 | File
"/usr/local/lib/python3.8/site-packages/github/PaginatedList.py", line 76, in
__getitem__
backend-1 | self.__fetchToIndex(index)
backend-1 | File
"/usr/local/lib/python3.8/site-packages/github/PaginatedList.py", line 92, in
__fetchToIndex
backend-1 | self._grow()
backend-1 | File
"/usr/local/lib/python3.8/site-packages/github/PaginatedList.py", line 95, in _grow
backend-1 | newElements = self._fetchNextPage()
backend-1 | File
"/usr/local/lib/python3.8/site-packages/github/PaginatedList.py", line 244, in
_fetchNextPage
backend-1 | headers, data = self.__requester.requestJsonAndCheck(
backend-1 | File "/usr/local/lib/python3.8/site-packages/github/Requester.py",
line 537, in requestJsonAndCheck
backend-1 | return self.__check(*self.requestJson(verb, url, parameters,
headers, input, self.__customConnection(url)))
backend-1 | File "/usr/local/lib/python3.8/site-packages/github/Requester.py",
line 702, in requestJson
backend-1 | return self.__requestEncode(cnx, verb, url, parameters, headers,
input, encode)
backend-1 | File "/usr/local/lib/python3.8/site-packages/github/Requester.py",
line 787, in __requestEncode
backend-1 | requestHeaders["Authorization"] = f"{self.__auth.token_type}
{self.__auth.token}"
backend-1 | File "/usr/local/lib/python3.8/site-packages/github/Auth.py", line
186, in token
backend-1 | return self.create_jwt()
backend-1 | File "/usr/local/lib/python3.8/site-packages/github/Auth.py", line
220, in create_jwt
backend-1 | encrypted = jwt.encode(payload, key=self.private_key,
algorithm=self._jwt_algorithm)
backend-1 | File "/usr/local/lib/python3.8/site-packages/jwt/api_jwt.py", line
73, in encode
backend-1 | return api_jws.encode(
backend-1 | File "/usr/local/lib/python3.8/site-packages/jwt/api_jws.py", line
160, in encode
backend-1 | key = alg_obj.prepare_key(key)
backend-1 | File "/usr/local/lib/python3.8/site-packages/jwt/algorithms.py",
line 353, in prepare_key
backend-1 | return cast(RSAPublicKey, load_pem_public_key(key_bytes))
backend-1 | ValueError: Unable to load PEM file. See
https://cryptography.io/en/latest/faq/#why-can-t-i-import-my-pem-file for more
details. MalformedFraming
backend-1 |
backend-1 | ERROR: Application startup failed. Exiting.
^[[B^[[A^CGracefully stopping... (press Ctrl+C again to force)
[

You might also like