Open aubaugh opened 4 years ago
Try curl -X POST https://localhost:3000/db/docstore -d "create=true" -d "type=docstore"
creating a db requires a POST
method, not GET
Still getting the 500 status code. The server does print Opening db docstore
when I run the command with or without -X POST
.
I noticed the Dockerfile uses version 10.x of Node.js so I'm using 10.18.0
Can you share the exact error from the server?
It should work ok with node 10x or 12x
I wasn't able to build with 12x, I can post the error I got when I tried to do so.
Here's the error from the server:
{"statusCode":500,"error":"Internal Server Error","message":"An internal server error occurred"}⏎
Does the server log itself have any output? If not you can set LOG=DEBUG
before you start the server and it should output more details in the server console
My bad the debug feature isn't included yet, it is on this branch: https://github.com/phillmac/orbit-db-http-api-dev/tree/debug but not in the official repo here yet
oh weird, it does look like I got some debug messages from this repo:
Opening db docstore
2019-12-19T00:46:06.620Z [DEBUG] orbit-db: open()
2019-12-19T00:46:06.621Z [DEBUG] orbit-db: Open database 'docstore'
2019-12-19T00:46:06.621Z [DEBUG] orbit-db: Look from 'db'
2019-12-19T00:46:06.623Z [WARN] orbit-db: Not a valid OrbitDB address 'docstore', creating the database
2019-12-19T00:46:06.624Z [DEBUG] orbit-db: create()
2019-12-19T00:46:06.624Z [DEBUG] orbit-db: Creating database 'docstore' as docstore in 'db'
Ok cool... I would have expected a massive stack trace immediately after... Does the log just cut off there??
Yeah, it just stops there and the client gets the 500 status code
Ok the only other thing to try is to use the debug branch on either of the repos and include --debug
when you start the server
On the debug branch of this repo I get this on the server:
Opening db docstore
2019-12-19T01:20:08.065Z [DEBUG] orbit-db: open()
2019-12-19T01:20:08.066Z [DEBUG] orbit-db: Open database 'docstore'
2019-12-19T01:20:08.066Z [DEBUG] orbit-db: Look from 'db'
2019-12-19T01:20:08.067Z [WARN] orbit-db: Not a valid OrbitDB address 'docstore', creating the database
2019-12-19T01:20:08.067Z [DEBUG] orbit-db: create()
2019-12-19T01:20:08.068Z [DEBUG] orbit-db: Creating database 'docstore' as docstore in 'db'
{ Error: Not a valid OrbitDB address: /orbitdb/bafyreicjqmfea2dlhcbyszyneaxcpdhlxjpsycxxaibpp4wlzfctiujxdm/docstore
at Function.parse (/root/orbit-db-http-api/node_modules/orbit-db/src/orbit-db-address.js:44:13)
at OrbitDB._determineAddress (/root/orbit-db-http-api/node_modules/orbit-db/src/OrbitDB.js:257:27)
at process._tickCallback (internal/process/next_tick.js:68:7)
isBoom: true,
isServer: true,
data: null,
output:
{ statusCode: 500,
payload:
{ statusCode: 500,
error: 'Internal Server Error',
message: 'An internal server error occurred' },
headers: {} },
reformat: [Function] }
And this on the client:
{"statusCode":500,"error":"Internal Server Error","message":"Error: Not a valid OrbitDB address: /orbitdb/bafyreicjqmfea2dlhcbyszyneaxcp
dhlxjpsycxxaibpp4wlzfctiujxdm/docstore"}⏎
Is create: true
set in the db options? I don't think docstore
is a reserved word or anything, but you might try naoming ti something else anyway just to see.
I pass -d "create=true"
when making the POST request with curl
. I tried another name but didn't get a different response
This is the second time today i've seen something todo with ipfs and an address starting with bafyre
What ipfs version are you using?
@aphelionz
ipfs dag get bafyreicjqmfea2dlhcbyszyneaxcpdhlxjpsycxxaibpp4wlzfctiujxdm
{"accessController":"/ipfs/zdpuAzt2GWKYeF4Pbo3hcMipCimE7SqCKZcckGduqcDJ3tmRx","name":"docstore","type":"docstore"}
ipfs cid format -f "%P" bafyreicjqmfea2dlhcbyszyneaxcpdhlxjpsycxxaibpp4wlzfctiujxdm
cidv1-cbor-sha2-256-32
I don't know what to make of this... https://github.com/orbitdb/orbit-db/blob/master/src/orbit-db-address.js#L17 Is wrong?
I ran the cli in local mode so it looks like 0.36.3 of js-ipfs based on package-lock.json
Specifically this line
https://github.com/orbitdb/orbit-db/blob/master/src/orbit-db-address.js#L30
requires that the hash contains zd
or Qm
I'm getting the same error when i want to create the database
{"statusCode":500,"error":"Internal Server Error","message":"An internal server error occurred"}
Hi I am also facing the same issue. were anyone able to fix this issue?
I get the expected result when executing
curl https://localhost:3000/dbs
andcurl https://localhost:3000/identity
but I get a 500 status code when executing:curl https://localhost:3000/db/docstore -d "create=true" -d "type=docstore"
Not sure if it makes a difference but I'm using a self-signed certificate that I added to my CA list.