-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
unable to add mongodb data source #4691
Comments
I've found it. It's a really monkey patch, but it worked. schema = get_configuration_schema_for_query_runner_type(req["type"]) I need that 8, because a new data source will have id of 8 in the database. Next is config variable below. Line: I also commented out this two lines: I was able to add MongoDB databases. |
Is it missing a |
Each Query Runner is within
So check your Python dependencies are loaded correctly. Look for this error message:
|
Hmmm, this is a old bug report for a pretty old release of Redash. With our latest development code (eg the @wtfiwtz If you're not running a production setup, it might be worth trying that out? Note that the image isn't well tested enough (yet) to consider "production ready", so be careful with it. 😄 |
Thanks @justinclift ... managed to get it working on I still get a warning about
I run Thanks! |
Well, as long as it's working I suppose. 😁 |
I'll close this issue report as it's for a very outdated Redash release, and you've managed to fix your setup as well. 😄 |
Issue Summary
I am unable to add MongoDB data source.
Steps to Reproduce
Any other info e.g. Why do you consider this to be a bug? What did you expect to happen instead?
I would like to add MonoDB data source. It works great with Clickhouse and MySQL sources.
Technical details:
Traceback (from virtualenv with requirements and requrements_all installed):
python3 manage.py ds new --type mongodb
Name: aaa
Connection String (required): aaa
Database Name (required): aaa
Replica Set Name (optional):
Replica Set Read Preference (optional):
Traceback (most recent call last):
File "manage.py", line 9, in
manager()
File "/data/redash/app/lib/python3.6/site-packages/click/core.py", line 722, in call
return self.main(*args, **kwargs)
File "/data/redash/app/lib/python3.6/site-packages/flask/cli.py", line 586, in main
return super(FlaskGroup, self).main(*args, **kwargs)
File "/data/redash/app/lib/python3.6/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/data/redash/app/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/data/redash/app/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/data/redash/app/lib/python3.6/site-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/data/redash/app/lib/python3.6/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/data/redash/app/lib/python3.6/site-packages/click/decorators.py", line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File "/data/redash/app/lib/python3.6/site-packages/flask/cli.py", line 426, in decorator
return __ctx.invoke(f, *args, **kwargs)
File "/data/redash/app/lib/python3.6/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/data/redash/app/gitredash/redash/cli/data_sources.py", line 155, in new
if not options.is_valid():
File "/data/redash/app/gitredash/redash/utils/configuration.py", line 45, in is_valid
self.validate()
File "/data/redash/app/gitredash/redash/utils/configuration.py", line 57, in validate
jsonschema.validate(self._config, self._schema)
File "/data/redash/app/lib/python3.6/site-packages/jsonschema/validators.py", line 936, in validate
cls.check_schema(schema)
File "/data/redash/app/lib/python3.6/site-packages/jsonschema/validators.py", line 300, in check_schema
raise exceptions.SchemaError.create_from(error)
jsonschema.exceptions.SchemaError: <map object at 0x7f9464015ac8> is not of type 'array'
Failed validating 'type' in metaschema['properties']['properties']['additionalProperties']['properties']['enum']:
{'items': True, 'type': 'array'}
On schema['properties']['readPreference']['enum']:
<map object at 0x7f9464015ac8>
I modified 2 files to get more debug data:
/data/redash/app/lib/python3.6/site-packages/jsonschema/validators.py:
@classmethod
def check_schema(cls, schema):
for error in cls(cls.META_SCHEMA).iter_errors(schema):
# ADDED DEBUG
with open('/tmp/sprjson','w+') as sprjson:
sprjson.write(str(schema))
sprjson.write(str(cls))
sprjson.write(str(error))
# / ADDED DEBUG
raise exceptions.SchemaError.create_from(error)
/data/redash/app/gitredash/redash/utils/configuration.py
def validate(self):
# ADDED DEBUG
with open('/tmp/validebug','w+') as validebug:
validebug.write(str(self._config))
validebug.write(str(self._schema))
# / ADDED DEBUG
jsonschema.validate(self._config, self._schema)
cat /tmp/sprjson
{'type': 'object', 'properties': {'connectionString': {'type': 'string', 'title': 'Connection String'}, 'dbName': {'type': 'string', 'title': 'Database Name'}, 'replicaSetName': {'type': 'string', 'title': 'Replica Set Name'}, 'readPreference': {'type': 'string', 'title': 'Replica Set Read Preference', 'enum': <map object at 0x7f9464015ac8>}}, 'required': ['connectionString', 'dbName']}<class 'jsonschema.validators.create..Validator'><map object at 0x7f9464015ac8> is not of type 'array'
Failed validating 'type' in schema['properties']['properties']['additionalProperties']['properties']['enum']:
{'items': True, 'type': 'array'}
On instance['properties']['readPreference']['enum']:
<map object at 0x7f9464015ac8>
cat /tmp/validebug
{'connectionString': 'aaa', 'dbName': 'aaa'}{'type': 'object', 'properties': {'connectionString': {'type': 'string', 'title': 'Connection String'}, 'dbName': {'type': 'string', 'title': 'Database Name'}, 'replicaSetName': {'type': 'string', 'title': 'Replica Set Name'}, 'readPreference': {'type': 'string', 'title': 'Replica Set Read Preference', 'enum': <map object at 0x7f9464015ac8>}}, 'required': ['connectionString', 'dbName']}
The text was updated successfully, but these errors were encountered: