Comments (1)
Looks like it only occurs while running the runserver
command. It seems related to the way we serialize the settings in a temporary file. As an example, let's use the following command:
$ bin/ralph runserver -b es --es-client-options verify_certs=True
Output (truncated) logs:
2023-01-08 21:37:03,644 INFO ralph.cli Running API server on 0.0.0.0:8100 with es backend
2023-01-08 21:37:03,644 INFO ralph.cli Do not use runserver in production - start production servers through a process manager such as gunicorn/supervisor/circus.
INFO: Will watch for changes in these directories: ['/app']
INFO: Loading environment from '/tmp/tmpmd28cd30'
INFO: Uvicorn running on http://0.0.0.0:8100 (Press CTRL+C to quit)
INFO: Started reloader process [1] using WatchFiles
Process SpawnProcess-1:
Traceback (most recent call last):
File "/usr/local/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
[...]
File "/app/src/ralph/api/__init__.py", line 5, in <module>
from ralph.conf import settings
File "/app/src/ralph/conf.py", line 302, in <module>
settings = Settings()
File "pydantic/env_settings.py", line 39, in pydantic.env_settings.BaseSettings.__init__
File "pydantic/main.py", line 342, in pydantic.main.BaseModel.__init__
pydantic.error_wrappers.ValidationError: 1 validation error for Settings
BACKENDS -> DATABASE -> ES -> CLIENT_OPTIONS
value is not a valid dict (type=type_error.dict)
If we take a look at the temporary settings:
$ bin/compose exec app cat /tmp/tmpmd28cd30
RALPH_RUNSERVER_BACKEND=es
RALPH_BACKENDS__DATABASE__ES__CLIENT_OPTIONS={'verify_certs': True}
RALPH_BACKENDS__DATABASE__MONGO__COLLECTION=marsha
RALPH_BACKENDS__DATABASE__MONGO__DATABASE=statements
RALPH_BACKENDS__DATABASE__MONGO__CONNECTION_URI=mongodb://mongo:27017/
RALPH_BACKENDS__DATABASE__ES__OP_TYPE=index
RALPH_BACKENDS__DATABASE__ES__INDEX=statements
RALPH_BACKENDS__DATABASE__ES__HOSTS=http://elasticsearch:9200
The RALPH_BACKENDS__DATABASE__ES__CLIENT_OPTIONS
environment variable is not properly parsed.
from ralph.
Related Issues (20)
- Add Graylog backend
- (api) Make code tidier by replacing scopes as strings
- Replace Python linters with Ruff
- Support Python 3.12
- Remove JSON column from ClickHouse backend HOT 1
- Rewrite contributing section in documentation
- Switch from setup.cfg to pyproject.toml
- Add "# TODO" check to linting
- Ensure testing of `count` as result of `write`, for all backends. HOT 1
- Fix `www-authenticate` header HOT 1
- Modifying `settings` on a DataBackend does not update `client`
- [Clickhouse]Look into removing use of both `statementId` and `statement_id` in queries
- [pydantic >2] Replace deprecated `parse_obj_as`
- [Pydantic > 2] Replace for loop in `factory.py` model generation HOT 1
- [pydantic > 2] xAPI extensions cannot hold empty strings
- [pydantic > 2] [API] Fix `IRI` typing of `verb` and `activity` queries in `get`
- [pydantic > 2] [api] Add URL validation to `openid` field
- [backends] [clickhouse] Look into removing redundency of `statement_id` and `statementId`
- [pydantic > 2] [tests] [polyfactory] Remove custom value for `course_id`
- Rename LDP `DEFAULT_STREAM_ID` setting to `STREAM_ID` HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ralph.