Dgraph-alpha fails on ubuntu (Installscript with system.d)

Report a Dgraph Bug

What version of Dgraph are you using?

Dgraph Version
$ dgraph version
 
Dgraph version   : v21.03.0
Dgraph codename  : rocket
Dgraph SHA-256   : b4e4c77011e2938e9da197395dbce91d0c6ebb83d383b190f5b70201836a773f
Commit SHA-1     : a77bbe8ae
Commit timestamp : 2021-04-07 21:36:38 +0530
Branch           : HEAD
Go version       : go1.16.2
jemalloc enabled : true

Have you tried reproducing the issue with the latest release?

Yes

What is the hardware spec (RAM, OS)?

Ubuntu 20.04.2 LTS
8 GB RAM

Steps to reproduce the issue (command/config used to run Dgraph).

Installed dgraph on a clean system with via curl

curl https://get.dgraph.io -sSf | bash -s -- --systemd

Expected behaviour and actual result.

Then check status of dgraph. Zero is running, but alpha returns this message:

# service dgraph-alpha status
â—Ź dgraph-alpha.service - dgraph.io Alpha instance
     Loaded: loaded (/etc/systemd/system/dgraph-alpha.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Tue 2021-05-18 07:36:56 CEST; 2s ago
    Process: 7753 ExecStart=/bin/bash -c dgraph alpha --lru_mb 2048 -p /var/lib/dgraph/p -w /var/lib/dgraph/w (code=exited, status=1/F>
   Main PID: 7753 (code=exited, status=1/FAILURE)

systemd[1]: dgraph-alpha.service: Scheduled restart job, restart counter is at 5.
systemd[1]: Stopped dgraph.io Alpha instance.
systemd[1]: dgraph-alpha.service: Start request repeated too quickly.
systemd[1]: dgraph-alpha.service: Failed with result 'exit-code'.
systemd[1]: Failed to start dgraph.io Alpha instance.

When I edit /etc/systemd/system/dgraph-alpha.service and remove --lru_mb 2048, alpha runs as expected.

Ah thanks for reminding me. I started some work literally this morning to put a PR to fix this exact thing. Will get it done

2 Likes
curl https://get.dgraph.io -sSf | bash

this is my install command in ubuntu server, i didn’t use

-s -- --systemd

and after i successfully install the dgraph.
i type the command dgraph version, and i can get info of dgraph version. is it means i had already successfully install the whole dgraph things i need in ubuntu ?
and when i type the command dgraph alpha , i got many code showing on the screen that the ubuntu console , like this

Charset=function(e,t){if(!e||!t)return e;var n=r.parse(e);return n.parameters.charset=t,r.format(n)}},8706:(e,t,n)=>{"use strict";var i=n(5158)("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(this.defaultEngine=a.defaultEngE0519 11:04:35.715363 2910132 run.go:543] Lambda server at port: 20000 stopped with error: exit status 1
E0519 11:04:36.110545 2910132 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>
E0519 11:04:36.218751 2910132 pool.go:311] CONN: Unable to connect with localhost:5080 : rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing dial tcp [::1]:5080: connect: connection refused"
E0519 11:04:37.111646 2910132 groups.go:1223] Error 

do i mistake somthing ? or whta do i need to do to solve the problem ? thank for any help !

i use the command curl https://get.dgraph.io -sSf | bash that without -s -- --systemd, and i successfully install the dgraph , i type the command dgraph version , and i got

root@iZuf68nltmjhh98k0z2rohZ:~# 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

For Dgraph official documentation, visit https://dgraph.io/docs.
For discussions about Dgraph     , visit http://discuss.dgraph.io.
For fully-managed Dgraph Cloud   , visit https://dgraph.io/cloud.

Licensed variously under the Apache Public License 2.0 and Dgraph Community License.
Copyright 2015-2021 Dgraph Labs, Inc.

but when i type the command dgraph alpha, i got many code showing in the console and some error like this below :

g":n=t.etag;break;case"weak":n=t.wetag;break;default:throw new TypeError("unknown value for etag function: "+e)}return n},t.compileQueryParser=function(e){var t;if("function"==typeof e)return e;switch(e){case!0:t=d.parse;break;case!1:t=h;break;case"extended":t=f;break;case"simple":t=d.parse;break;default:throw new TypeError("unknown value for query parser function: "+e)}return t},t.compileTrust=function(e){return"function"==typeof e?e:!0===e?function(){return!0}:"number"==typeof e?function(t,n){return n<e}:("string"==typeof e&&(e=e.split(/ *, */)),l.compile(e||[]))},t.setCharset=function(e,t){if(!e||!t)return e;var n=r.parse(e);return n.parameters.charset=t,r.format(n)}},8706:(e,t,n)=>{"use strict";var i=n(5158)("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(this.defaultEngine=a.defaultEngE0519 11:09:13.661355 2910132 run.go:543] Lambda server at port: 20000 stopped with error: exit status 1
E0519 11:09:14.291252 2910132 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>
E0519 11:09:14.587462 2910132 pool.go:311] CONN: Unable to connect with localhost:5080 : rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing dial tcp [::1]:5080: connect: connection refused"
E0519 11:09:15.143381 2910132 admin.go:1137] namespace: 0. Error reading GraphQL schema: Please retry again, server is not ready to accept requests.
E0519 11:09:15.292252 2910132 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>
^CI0519 11:09:15.585572 2910132 run.go:954] Caught Ctrl-C. Terminating now (this may take a few seconds)...
I0519 11:09:15.585614 2910132 run.go:959] Stopped before initialization completed

how can i slove the problem , thank you for any help !