Postgraphile - "Query Root must be provided" error message - graphql

We have an existing postgresql database with data and we are experimenting with postgraphile as a graphql API. We are running into an error that is leaving us scratching our head. the server runs fine but we get the following:
postgraphile -c postgres://username:password#localhost:5432/my_db
PostGraphile server listening on port 5000
‣ Connected to Postgres instance postgres://localhost:5432/my_db
‣ Introspected Postgres schema(s) public
‣ GraphQL endpoint served at http://localhost:5000/graphql
‣ GraphiQL endpoint served at http://localhost:5000/graphiql
* * *
An error occurred, it might be okay but it doesn't look like the error we were expecting... run with envvar 'DEBUG="graphile-build:warn"' to view the error
An error occurred, it might be okay but it doesn't look like the error we were expecting... run with envvar 'DEBUG="graphile-build:warn"' to view the error
Error: Query root type must be provided.
at assertValidSchema (C:\Users\user\AppData\Roaming\npm\node_modules\postgraphile\node_modules\graphql\type\validate.js:78:11)
at Object.validate (C:\Users\user\AppData\Roaming\npm\node_modules\postgraphile\node_modules\graphql\validation\validate.js:61:35)
at parseQuery (C:\Users\user\AppData\Roaming\npm\node_modules\postgraphile\build\postgraphile\http\createPostGraphileHttpRequestHandler.js:208:48)
at Promise.all.paramsList.map (C:\Users\user\AppData\Roaming\npm\node_modules\postgraphile\build\postgraphile\http\createPostGraphileHttpRequestHandler.js:469:63)
at Array.map (<anonymous>)
at requestHandler (C:\Users\user\AppData\Roaming\npm\node_modules\postgraphile\build\postgraphile\http\createPostGraphileHttpRequestHandler.js:435:52)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
and when we navigate to localhost:500/graphiql we see a a "no schema available" in the documentation explorer.
is the query root the publicschema? or what are we missing?

Newer versions of PostGraphile have much more helpful error messages, often including a suggested solution. The "An error occurred" errors like those above now also contain a preview of the underlying error which helps with diagnosis.
There are instructions here on how to set the DEBUG environmental variable here: https://www.graphile.org/postgraphile/debugging/#debug-envvars
Here's how you might do it in Linux, macOS or Windows:
# Bash (Linux, macOS, etc)
export DEBUG="graphile-build:warn" postgraphile -c postgres://username:password#localhost:5432/my_db
# Windows Console
set DEBUG=graphile-build:warn & postgraphile -c postgres://username:password#localhost:5432/my_db
# Windows PowerShell
$env:DEBUG = "graphile-build:warn"; postgraphile -c postgres://username:password#localhost:5432/my_db

Related

I'm getting issues in running nightwatch test cases in local configuration. For all browsers there's different issue which are listed as below:

Edge:
Error: An error occurred while retrieving a new session: "Unable to create new service: EdgeDriverService"
Chrome:
Error: An error occurred while retrieving a new session: "Unable to create new service: ChromeDriverService"
Firefox:
Error: An error occurred while retrieving a new session: "Expected browser binary location, but unable to find binary in default location, no 'moz:firefoxOptions.binary' capability provided, and no binale to find binary in default locatiory flag set on the command line"
This looks to me like a configuration issue. Assuming that you are using nightwatchjs without selenium, you need to ensure that the runner is able to find the chromedriver and geckodriver binaries. You can check my sample repo here. If you are using selenium, then you can check here.

Error: command "bash" failed with no error message?

I am using terraform on my Mac system, and terraform apply results with below error
Error: command "bash" failed with no error message
on ssm.tf line 7, in data "external" "ssm-dynamic-general":
7: data "external" "ssm-dynamic-general" {
However there is nothing wrong in ssm.tf file, same runs perfectly fine in my another system.
Can some one please let me know what i am missing here?
You might have done what I accidentally did: not follow the external program protocol:
https://www.terraform.io/docs/providers/external/data_source.html#external-program-protocol
In my particular case, I failed to send the errors that were coming from my program to standard error. Instead, those errors were going to standard out.
That's why Terraform wasn't able to report on those errors.
So if you send any and all errors from your program to standard error using > &2, you should be able to see those errors when you run terraform plan.

composer-rest-server Error: throw er; // Unhandled 'error' event

I installed and startet my business network. Now I want to do composer-rest-server -c admin#test-network but I get the following output:
Discovering types from business network definition ...
Discovering the Returning Transactions..
Discovered types from business network definition
Generating schemas for all types in business network definition ...
Generated schemas for all types in business network definition
Adding schemas for all types to Loopback ...
Added schemas for all types to Loopback
events.js:183
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE :::3000
at Server.setupListenHandle [as _listen2] (net.js:1360:14)
at listenInCluster (net.js:1401:12)
at Server.listen (net.js:1485:7)
at module.exports.promise.then.then (/home/dany/.nvm/versions/node/v8.15.0/lib/node_modules/composer-rest-server/cli.js:143:19)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:189:7)
The funny thing is, that everything worked fine before. Then I restarted the fabric and reinstalled the bna file and now I get this error. Thanks for your help
It seems you have not stopped your script properly that's why this error is coming. This error comes when your port is already occupied and you are trying to start something on same port. So you can kill process on this port then it should work fine.
If you are using linux OS then this command might help you.
fuser -n tcp -k 3000

Error when running `feathers generate authentication` for `RethinkDB`

I’m having issues when running feathers generate authentication with selecting rethinkdb as database.
Environment:
Mac OS X Sierra
feathers 2.2.3
npm 5.1.0
rethinkdb 2.3.5
Steps to reproduce:
I have up and running https://github.com/tenzan/feathers-chat.git
feathers generate authentication
Select Username + Password (Local)
What is the name of the user (entity) service? (users) <-- Enter
What kind of service is it? (Use arrow keys) ❯ RethinkDB <-- Enter
Output:
events.js:182
throw er; // Unhandled 'error' event
^
TypeError: Parameter "url" must be a string, not object
at Url.parse (url.js:102:11)
at Object.urlParse [as parse] (url.js:96:5)
at ConnectionGenerator._getConfiguration (/usr/local/lib/node_modules/feathers-cli/node_modules/generator-feathers/generators/connection/index.js:46:24)
at ConnectionGenerator._writeConfiguration (/usr/local/lib/node_modules/feathers-cli/node_modules/generator-feathers/generators/connection/index.js:103:32)
at ConnectionGenerator.writing (/usr/local/lib/node_modules/feathers-cli/node_modules/generator-feathers/generators/connection/index.js:297:10)
at Object.<anonymous> (/usr/local/lib/node_modules/feathers-cli/node_modules/yeoman-generator/lib/index.js:417:23)
at /usr/local/lib/node_modules/feathers-cli/node_modules/run-async/index.js:25:25
at Promise (<anonymous>)
at /usr/local/lib/node_modules/feathers-cli/node_modules/run-async/index.js:24:19
at /usr/local/lib/node_modules/feathers-cli/node_modules/yeoman-generator/lib/index.js:418:9
I had same errors on different Mac PCs with same environment.
It's an issue with generator-feathers
Remove the rethinkdb object from config/default
will see if I can fix the main problem
Edit: Fixed

Error on installing Titan DB on Windows

Following the official guide of Titan DB here, and trying to run the command:
graph = TitanFactory.open('conf/titan-cassandra-es.properties')
I got this error:
Backend shorthand unknown: conf/titan-cassandra-es.properties
Obviously, the reason is the incorrect path to the
titan-cassandra-es.properties
file. So I changed it to:
graph = TitanFactory.open('../conf/titan-cassandra-es.properties')
and got this error:
Encountered unregistered class ID: 141.
The error happens in the following version:
titan-0.5.4-hadoop2
On titan-1.0.0-hadoop2 instead of this error message I get this one:
Invalid import definition: 'com.thinkaurelius.titan.hadoop.MapReduceIndexManagement'; reason: startup failed: script14747941661821834264593.groovy: 1: unable to resolve class com.thinkaurelius.titan.hadoop.MapReduceIndexManagement # line 1, column 1. import com.thinkaurelius.titan.hadoop.MapReduceIndexManagement ^
1 error
And on titan-1.0.0-hadoop2 I get this one:
The input line is too long.
The syntax of the command is incorrect.
Does anyone know how to handle this issue?
It seems like you have not even managed to get Titan 1 to start up yet.
I do not believe Titan 1 has been deployed to support Windows out of the box. I.e. the downloadable package will not just work with windows.
Saying that I have managed to get Titan DB 1 to work on windows. To do so, all you have to do is install Cassandra 2.x on Windows. This guide may help you out. Start cassandra and enable thrift connections.
With that done you should be able to get Titan doing basic operations on windows. From there you may find dealing with you current errors easier.
Side Note: Windows support for Titan 0.5.x may be more substantial. So you could look into that as well.

Resources