Wappler Version : 6 Beta 2
Operating System : win11
Server Model: node
Database Type: couch
Hosting Type: docker local
Expected behavior
Connection should work
Actual behavior
What actually happens?
Connection refused error
status: "500",
message: "error happened in your connection. Reason: connect ECONNREFUSED 127.0.0.1:9913",
stack: "Error: error happened in your connection. Reason: connect ECONNREFUSED 127.0.0.1:9913
at responseHandler (/opt/node_app/node_modules/nano/lib/nano.js:157:16)
at /opt/node_app/node_modules/nano/lib/nano.js:456:13
at processTicksAndRejections (node:internal/process/task_queues:96:5)"
}
Sorry, more tales of woe relating to couchdb
I have a couch database running in a local docker container
i can connect via the admin panel on port 9913
I have 2 collections defined
and can connect via db_connection from the Database manager tab
I also have a connection defined under workflows globals
The username and password match the database settings on the Resource Manager and those used in the Database manager connection settings i.e. “myuser” + user password (displayed)
I have a simple query defined to query the notes collection using the db_connection
If i run it in a browser i get connection refused on port 9913
file: \app\modules\connections\db_connection.json
{
"name": "db_connection",
"module": "dbconnector",
"action": "connect",
"options": {
"client": "couchdb",
"connection": {
"host": "127.0.0.1",
"port": 9913,
"user": "myuser",
"password": "1gFD6lSfVNBXHb3t",
"database": "my_db"
},
"databaseResource": "Local / couchdb",
"cloudDatabaseName": "my_db"
},
"fileName": "db_connection.json"
}
.wappler\targets\Development\databases\db_connection.json
{
"type": "couchdb",
"connection": {
"host": "127.0.0.1",
"port": 9913,
"user": "myuser",
"password": "1gFD6lSfVNBXHb3t",
"database": "my_db"
},
"direct": true,
"databaseResource": "Local / couchdb",
"cloudDatabaseName": "my_db",
"schema": {
"partitioned": false,
"tables": {
"notes": {
"meta": [
{
"name": "_id",
"type": "objectId"
},
{
"name": "title",
"type": "text"
},
{
"name": "content",
"type": "text"
}
]
},
"product": {
"meta": [
{
"name": "_id",
"type": "objectId"
},
{
"name": "product_id",
"type": "number"
},
{
"name": "product_name",
"type": "text"
}
]
}
},
"views": {}
}
}
db_connection.js
dmx.databases = dmx.databases || {};
dmx.databases['db_connection'] = {type: "pouchdb", remote: "http://127.0.0.1:9913/my_db"}