Problems Running Dgraph

UPDATE 2

Hmm… So I see there’s a dependancy to have node-js installed, since the error seems to relate to the execution of a javascript file which then dumps out what looks like raw minified javascript before it fails.

Are there node-js dependancies that need installing here ?


UPDATE 1

So I deleted everything from my dgraph startup directory and started like this:

dgraph zero --my=localhosy:5080
dgraph alpha --my=192.168.0.60:7080 --zero=localhost:5080

This seems to have resolved the issue described below.

However the alpha instance is now continually outputting this now:

Lambda server at port: 20000 stopped with error: exit status 1

Hi,

I’m new to graph and have just downloaded and compiled the latest v21.12.0 release.

Here’s the complete output from dgraph version

Dgraph version : v21.12.0
Dgraph codename : zion
Dgraph SHA-256 : 078c75df9fa1057447c8c8afc10ea57cb0a29dfb22f9e61d8c334882b4b4eb37
Commit SHA-1 : d62ed5f15
Commit timestamp : 2021-12-02 21:20:09 +0530
Branch : HEAD
Go version : go1.17.3
jemalloc enabled : true

I’m following the docs for a single host setup here

I then start/run dgraph zero using this:

dgraph zero --my=localhost:5080
dgraph alpha --my=localhost:7080 --zero=localhost:5080

That fixed the issue described below. However the

Alpha is now repeatedly outputting this now:

Lambda server at port: 20000 stopped with error: exit status 1

Which seems to run OK:

I0627 19:13:01.115568 3090410 run.go:254] Setting Config to: {raft:0xc00040e358 telemetry:0xc00040e328 limit:0xc00040e360 bindall:true portOffset:0 numReplicas:1 peer: w:zw rebalanceInterval:480000000000 tlsClientConfig:<nil> audit:<nil> limiterConfig:0xc000138d50}
I0627 19:13:01.115703 3090410 run.go:144] Setting up grpc listener at: 0.0.0.0:5080
I0627 19:13:01.116121 3090410 run.go:144] Setting up http listener at: 0.0.0.0:6080
I0627 19:13:01.119288 3090410 storage.go:125] Init Raft Storage with snap: 0, first: 1, last: 0
I0627 19:13:01.119472 3090410 node.go:152] Setting raft.Config to: &{ID:1 peers:[] learners:[] ElectionTick:20 HeartbeatTick:1 Storage:0xc000388580 Applied:0 MaxSizePerMsg:262144 MaxCommittedSizePerReady:67108864 MaxUncommittedEntriesSize:0 MaxInflightMsgs:256 CheckQuorum:false PreVote:true ReadOnlyOption:0 Logger:0x3771ec8 DisableProposalForwarding:false}
I0627 19:13:01.121166 3090410 node.go:326] Group 0 found 0 entries
I0627 19:13:01.121195 3090410 raft.go:706] Starting a brand new node
I0627 19:13:01.121255 3090410 log.go:34] 1 became follower at term 0
I0627 19:13:01.121275 3090410 log.go:34] newRaft 1 [peers: [], term: 0, commit: 0, applied: 0, lastindex: 0, lastterm: 0]
I0627 19:13:01.121295 3090410 log.go:34] 1 became follower at term 1
I0627 19:13:01.121768 3090410 run.go:388] Running Dgraph Zero...
E0627 19:13:01.122751 3090410 raft.go:590] While proposing CID: Not Zero leader. Aborting proposal: cid:"3f2b86dc-e3aa-42fb-8b31-ccc78287495e" . Retrying...
I0627 19:13:01.122526 3090410 node.go:189] Setting conf state to nodes:1
I0627 19:13:01.123747 3090410 raft.go:1009] Done applying conf change at 0x1
I0627 19:13:03.821922 3090410 log.go:34] 1 is starting a new election at term 1
I0627 19:13:03.822070 3090410 log.go:34] 1 became pre-candidate at term 1
I0627 19:13:03.822091 3090410 log.go:34] 1 received MsgPreVoteResp from 1 at term 1
I0627 19:13:03.822127 3090410 log.go:34] 1 became candidate at term 2
I0627 19:13:03.822153 3090410 log.go:34] 1 received MsgVoteResp from 1 at term 2
I0627 19:13:03.822178 3090410 log.go:34] 1 became leader at term 2
I0627 19:13:03.822191 3090410 log.go:34] raft.node: 1 elected leader 1 at term 2
I0627 19:13:03.822253 3090410 raft.go:955] I've become the leader, updating leases.
I0627 19:13:03.822287 3090410 assign.go:47] Updated UID: 1. Txn Ts: 1. NsID: 1.
I0627 19:13:04.124655 3090410 raft.go:583] CID set for cluster: 10dd1421-2cb4-4943-8175-d00e1f79b8cf
I0627 19:13:04.124894 3090410 license_ee.go:46] Enterprise trial license proposed to the cluster: license:<maxNodes:18446744073709551615 expiryTs:1658945584 >

However, when I try to start/run the alpha’s

dgraph alpha --my=IPADDR:7080 --zero=localhost:5080

I’m seeing multiple connection failures. e.g.

x00\x15dgraph.graphql.schema\x00": Unable to find any servers for group: 1. closer err: <nil>
E0627 19:16:17.451400 3093032 pool.go:311] CONN: Unable to connect with IPADDR:5080 : rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing dial tcp: lookup IPADDR: no such host"
E0627 19:16:18.326074 3093032 groups.go:1223] Error during SubscribeForUpdates for prefix "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x15dgraph.graphql.schema\x00": Unable to find any servers for group: 1. closer err: <nil>
I0627 19:16:18.327404 3093032 run.go:533] Running node command: /home/linuxbrew/.linuxbrew/bin/node t/index.js
E0627 19:16:18.461064 3093032 pool.go:311] CONN: Unable to connect with IPADDR:5080 : rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing dial tcp: lookup IPADDR: no such host"

I’m a little confused as to what IPADDR refers to. Should it be replaced with a real address ? It didn’t seem to change the error messages when I replaced it with localhost

I was able to reproduce the lambda spam issue, dgraph should still work. Also, maybe just typo in above, localhosy:5080.

I0627 13:09:11.354480  500583 run.go:533] Running node command: /home/joaquin/.nvm/versions/node/v18.3.0/bin/node t/index.js
/home/joaquin/area51/work/dgraph/t/index.js:2
(()=>{var __webpack_modules__={9078:(e,t,n)=>{"use strict";var i=n(159),a=n(983);function r(e){if(!(this instanceof r))return new r(e);this.headers=e.headers,this.negotiator=new 
... snip ...
("express:view"),a=n(5622),r=n(5747),o=a.dirname,s=a.basename,c=a.extname,p=a.join,l=a.resolve;function u(e,t){var a=t||{};if(thisE0627 13:09:11.481561  500583 run.go:543] Lambda server at port: 20000 stopped with error: exit status 1
1 Like

Change your alpha command to:

dgraph alpha --my=IPADDR:7080 --zero=localhost:5080 --lambda num=0 

In v21.12, starting an Alpha also launches a single default Lambda server. You can also launch multiple ‘default’ or ‘custom’ lambda servers. Adding the --lambda num=0 overrides this default behavior.

--lambda string              Lambda options
                                       num=1; Number of JS lambda servers to be launched by alpha.
                                       port=20000; The starting port at which the lambda server listens.
                                       restart-after=30s; Restarts the lambda server after given duration of unresponsiveness
                                       url=; The URL of a lambda server that implements custom GraphQL Javascript resolvers. This should be used only when using custom lambda server. Use num subflag to launch official lambda server. This flag if set, overrides the other lambda flags.
                                    (default "url=; num=1; port=20000; restart-after=30s; ")
1 Like

Sort of surprised a newbie like me hit this issue. Has anybody else seen this ? Also, the tutorial doesn’t mention the using --lambda num=0 to disable launching the Lambda server.

1 Like

Hi, the tutorials as well as the docs for version 21.12 need to be updated to reflect the changes introduced. However, since the officially supported version is still v21.03.2 we suggest you download and install that version if you’re following the learning guides or the docs.

2 Likes