No connection check when creating a database
ttemnikova opened this issue · 5 comments
- Login to Arachne Data Node
- Go to Administration → Databases
- Click the “Create database“ button
- Fill in the fields so that it is impossible to connect to the data source using the defined connection string and credentials
- Click the “Save“ button
Expected result: the database is not saved, the user receives an appropriate error message (from the response): “Cannot establish connection to the data source“
Actual result: the database is saved
It seems that this is a regression.
When running in docker mode, the same connection settings might not be usable for datanode and EE because of different container configuration. Those who are facing this situation might not have the power to change it and be fine with datanode not being able to connect to the datasource, as long as their analyses run.
The changes here should not block creating or updating datasources if check fails.
So, the check should be implemented as separate button and failure must not block create/update process, just tell the user that check failed and let him to proceed if he opts to.
The changes here should not block creating or updating datasources if check fails.
In this case we need to handle a situation when a user submits an analysis on a data source without established connection. For example, these submissions should not hang and the users should be informed about the problem with the data source.
This has to be handled in any case. Even if datasource is initially accessible, it might later stop being available.
API-wise, the following 2 endpoints are added:
POST /api/v1/data-sources/{id}/check
- verify connection on already stored datasource. Body is required.
POST /api/v1/data-sources/check
- verify connection using the data provided in request. Request body is same as for datasource create endpoint (POST /api/v1/data-sources
)
For both of these endpoints, response structure is as follows:
{modelType, cdmVersion}
At the moment, EE only supports detecting modelType = 'CDM' | 'OTHER'