Cannot access Dgraph localhost with docker image

I am trying to follow th quick start guide for tutorial

What I did

I ran
docker run --rm -it -p “8080:8080” -p “9080:9080” -p “8000:8000” -v ~/dgraph:/dgraph “dgraph/standalone:v21.12.0” in windows’s cml

Logs in docker

[Sentry] 2022/09/07 11:02:28 Integration installed: ContextifyFrames
[Sentry] 2022/09/07 11:02:28 Integration installed: Environment
[Sentry] 2022/09/07 11:02:28 Integration installed: Modules
[Sentry] 2022/09/07 11:02:28 Integration installed: IgnoreErrors
[Sentry] 2022/09/07 11:02:28 Integration installed: ContextifyFrames
[Sentry] 2022/09/07 11:02:28 Integration installed: Environment
[Sentry] 2022/09/07 11:02:28 Integration installed: Modules
[Sentry] 2022/09/07 11:02:28 Integration installed: IgnoreErrors
[Sentry] 2022/09/07 11:02:29 Integration installed: ContextifyFrames
[Sentry] 2022/09/07 11:02:29 Integration installed: Environment
[Sentry] 2022/09/07 11:02:29 Integration installed: Modules
[Sentry] 2022/09/07 11:02:29 Integration installed: IgnoreErrors
[Sentry] 2022/09/07 11:02:29 Integration installed: ContextifyFrames
[Sentry] 2022/09/07 11:02:29 Integration installed: Environment
[Sentry] 2022/09/07 11:02:29 Integration installed: Modules
[Sentry] 2022/09/07 11:02:29 Integration installed: IgnoreErrors
I0907 11:02:29.194978 29 sentry_integration.go:48] This instance of Dgraph will send anonymous reports of panics back to Dgraph Labs via Sentry. No confidential information is sent. These reports help improve Dgraph. To opt-out, restart your instance with the --telemetry "sentry=false;" flag. For more info, see https://dgraph.io/docs/howto/#data-handling.
I0907 11:02:29.210173 31 sentry_integration.go:48] This instance of Dgraph will send anonymous reports of panics back to Dgraph Labs via Sentry. No confidential information is sent. These reports help improve Dgraph. To opt-out, restart your instance with the --telemetry "sentry=false;" flag. For more info, see https://dgraph.io/docs/howto/#data-handling.
I0907 11:02:29.385773 29 init.go:110]

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

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

I0907 11:02:29.385833 29 run.go:910] x.Config: {PortOffset:0 Limit:normalize-node=10000; disallow-drop=false; txn-abort-after=5m; max-splits=1000; mutations=allow; mutations-nquad=1000000; query-timeout=0ms; max-pending-queries=64; max-retries=-1; shared-instance=false; query-edge=1000000 LimitMutationsNquad:1000000 LimitQueryEdge:1000000 BlockClusterWideDrop:false LimitNormalizeNode:10000 QueryTimeout:0s MaxRetries:-1 SharedInstance:false GraphQL:{Introspection:true Debug:false Extensions:true PollInterval:1s} Lambda:{Url: Num:1 Port:20000 RestartAfter:30s}}

I0907 11:02:29.385901 29 run.go:911] x.WorkerConfig: {TmpDir:t ExportPath:export Trace:ratio=0.01; jaeger=; datadog= MyAddr: ZeroAddr:[localhost:5080] TLSClientConfig: TLSServerConfig: Raft:snapshot-after-entries=10000; snapshot-after-duration=30m; pending-proposals=256; idx=; group=; learner=false Badger:{Dir: ValueDir: SyncWrites:false NumVersionsToKeep:1 ReadOnly:false Logger:0xc0001e29a0 Compression:1 InMemory:false MetricsEnabled:true NumGoroutines:8 MemTableSize:67108864 BaseTableSize:2097152 BaseLevelSize:10485760 LevelSizeMultiplier:10 TableSizeMultiplier:2 MaxLevels:7 VLogPercentile:0 ValueThreshold:1048576 NumMemtables:15 BlockSize:4096 BloomFalsePositive:0.01 BlockCacheSize:322122547 IndexCacheSize:214748364 NumLevelZeroTables:5 NumLevelZeroTablesStall:15 ValueLogFileSize:1073741823 ValueLogMaxEntries:1000000 NumCompactors:4 CompactL0OnClose:false LmaxCompaction:false ZSTDCompressionLevel:0 VerifyValueChecksum:false EncryptionKey: EncryptionKeyRotationDuration:240h0m0s BypassLockGuard:false ChecksumVerificationMode:0 AllowStopTheWorld:true DetectConflicts:true NamespaceOffset:-1 ExternalMagicVersion:0 managedTxns:false maxBatchCount:0 maxBatchSize:0 maxValueThreshold:0} WhiteListedIPRanges:[{Lower:0.0.0.0 Upper:255.255.255.255}] StrictMutations:false AclEnabled:false HmacSecret:**** AbortOlderThan:5m0s ProposedGroupId:0 StartTime:2022-09-07 11:02:28.872749653 +0000 UTC m=+0.185067503 Security:whitelist=0.0.0.0/0; token= EncryptionKey:**** LogRequest:0 HardSync:false Audit:false}

I0907 11:02:29.385986 29 run.go:912] worker.Config: {PostingDir:p WALDir:w MutationsMode:1 AuthToken: HmacSecret:**** AccessJwtTtl:0s RefreshJwtTtl:0s CachePercentage:50,30,20 CacheMb:1024 Audit: ChangeDataConf:file=; kafka=; sasl_user=; sasl_password=; ca_cert=; client_cert=; client_key=; sasl-mechanism=PLAIN; tls=false;}

I0907 11:02:29.386310 29 log.go:295] Found file: 1 First Index: 1
I0907 11:02:29.386506 29 storage.go:125] Init Raft Storage with snap: 0, first: 1, last: 13
I0907 11:02:29.386682 29 server_state.go:140] Opening postings BadgerDB with options: {Dir:p ValueDir:p SyncWrites:false NumVersionsToKeep:2147483647 ReadOnly:false Logger:0x3771ec8 Compression:1 InMemory:false MetricsEnabled:true NumGoroutines:8 MemTableSize:67108864 BaseTableSize:2097152 BaseLevelSize:10485760 LevelSizeMultiplier:10 TableSizeMultiplier:2 MaxLevels:7 VLogPercentile:0 ValueThreshold:1048576 NumMemtables:15 BlockSize:4096 BloomFalsePositive:0.01 BlockCacheSize:322122547 IndexCacheSize:214748364 NumLevelZeroTables:5 NumLevelZeroTablesStall:15 ValueLogFileSize:1073741823 ValueLogMaxEntries:1000000 NumCompactors:4 CompactL0OnClose:false LmaxCompaction:false ZSTDCompressionLevel:0 VerifyValueChecksum:false EncryptionKey: EncryptionKeyRotationDuration:240h0m0s BypassLockGuard:false ChecksumVerificationMode:0 AllowStopTheWorld:true DetectConflicts:false NamespaceOffset:1 ExternalMagicVersion:1 managedTxns:false maxBatchCount:0 maxBatchSize:0 maxValueThreshold:0}
I0907 11:02:29.390945 31 init.go:110]

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

I0907 11:02:29.391188 31 run.go:254] Setting Config to: {raft:0xc0004d4308 telemetry:0xc0004d42d8 limit:0xc0004d4310 bindall:true portOffset:0 numReplicas:1 peer: w:zw rebalanceInterval:480000000000 tlsClientConfig: audit: limiterConfig:0xc0004d2670}
I0907 11:02:29.391760 31 run.go:144] Setting up grpc listener at: 0.0.0.0:5080
I0907 11:02:29.392545 31 run.go:144] Setting up http listener at: 0.0.0.0:6080
I0907 11:02:29.393185 31 log.go:295] Found file: 1 First Index: 1
I0907 11:02:29.393338 31 storage.go:125] Init Raft Storage with snap: 0, first: 1, last: 16
I0907 11:02:29.393904 31 node.go:152] Setting raft.Config to: &{ID:1 peers: learners: ElectionTick:20 HeartbeatTick:1 Storage:0xc00026ac80 Applied:0 MaxSizePerMsg:262144 MaxCommittedSizePerReady:67108864 MaxUncommittedEntriesSize:0 MaxInflightMsgs:256 CheckQuorum:false PreVote:true ReadOnlyOption:0 Logger:0x3771ec8 DisableProposalForwarding:false}
I0907 11:02:29.394773 31 node.go:321] Found hardstate: {Term:3 Vote:1 Commit:16 XXX_unrecognized:}
I0907 11:02:29.394847 31 node.go:326] Group 0 found 16 entries
I0907 11:02:29.394853 31 raft.go:649] Restarting node for dgraphzero
I0907 11:02:29.394998 31 log.go:34] 1 became follower at term 3
I0907 11:02:29.395294 31 log.go:34] newRaft 1 [peers: , term: 3, commit: 16, applied: 0, lastindex: 16, lastterm: 3]
I0907 11:02:29.398383 31 run.go:388] Running Dgraph Zero…
I0907 11:02:29.399437 31 node.go:189] Setting conf state to nodes:1
I0907 11:02:29.400133 31 raft.go:1009] Done applying conf change at 0x1
I0907 11:02:29.400526 31 pool.go:164] CONN: Connecting to localhost:7080
W0907 11:02:29.400554 31 pool.go:211] CONN: Shutting down extra connection to localhost:7080
W0907 11:02:29.400713 31 pool.go:211] CONN: Shutting down extra connection to localhost:7080
W0907 11:02:29.400944 31 pool.go:211] CONN: Shutting down extra connection to localhost:7080
I0907 11:02:29.404638 29 log.go:34] All 1 tables opened in 1ms
I0907 11:02:29.405747 29 log.go:34] Discard stats nextEmptySlot: 0
I0907 11:02:29.405869 29 log.go:34] Set nextTxnTs to 1
I0907 11:02:29.406130 29 log.go:34] Deleting empty file: p/000001.vlog
I0907 11:02:29.411904 29 groups.go:100] Current Raft Id: 0x1
I0907 11:02:29.411935 29 groups.go:116] Sending member request to Zero: id:1 addr:“localhost:7080”
I0907 11:02:29.412074 29 worker.go:114] Worker listening at address: [::]:7080
I0907 11:02:29.413246 29 run.go:713] Bringing up GraphQL HTTP API at 0.0.0.0:8080/graphql
I0907 11:02:29.413282 29 run.go:714] Bringing up GraphQL HTTP admin API at 0.0.0.0:8080/admin
E0907 11:02:29.413244 29 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:
I0907 11:02:29.417583 29 run.go:514] Setting up lambda servers
I0907 11:02:29.417710 29 run.go:742] gRPC server started. Listening on port 9080
I0907 11:02:29.417715 29 run.go:743] HTTP server started. Listening on port 8080
I0907 11:02:29.512482 29 pool.go:164] CONN: Connecting to localhost:5080
I0907 11:02:29.515750 31 zero.go:511] Got connection request: cluster_info_only:true
I0907 11:02:29.515926 31 log.go:34] 1 no leader at term 3; dropping index reading msg
I0907 11:02:30.402341 31 pool.go:327] CONN: Re-established connection with localhost:7080.
I0907 11:02:30.402349 31 pool.go:327] CONN: Re-established connection with localhost:7080.
I0907 11:02:30.402356 31 pool.go:327] CONN: Re-established connection with localhost:7080.
E0907 11:02:30.405829 31 pool.go:311] CONN: Unable to connect with localhost:7080 : rpc error: code = Unknown desc = No node has been set up yet
E0907 11:02:30.416852 29 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:
I0907 11:02:30.903584 31 pool.go:321] CONN: Returning from MonitorHealth for localhost:7080
I0907 11:02:30.903776 31 pool.go:321] CONN: Returning from MonitorHealth for localhost:7080
I0907 11:02:30.903883 31 pool.go:321] CONN: Returning from MonitorHealth for localhost:7080
E0907 11:02:31.407953 31 pool.go:311] CONN: Unable to connect with localhost:7080 : rpc error: code = Unknown desc = No node has been set up yet
E0907 11:02:31.418085 29 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:
I0907 11:02:31.418553 29 run.go:533] Running node command: /usr/bin/node t/index.js
W0907 11:02:31.515924 31 node.go:713] [0x1] Read index context timed out
I0907 11:02:31.516007 31 log.go:34] 1 no leader at term 3; dropping index reading msg
Server Listening on port 20000!
I0907 11:02:32.396807 31 log.go:34] 1 is starting a new election at term 3
I0907 11:02:32.396903 31 log.go:34] 1 became pre-candidate at term 3
I0907 11:02:32.396911 31 log.go:34] 1 received MsgPreVoteResp from 1 at term 3
I0907 11:02:32.396932 31 log.go:34] 1 became candidate at term 4
I0907 11:02:32.396935 31 log.go:34] 1 received MsgVoteResp from 1 at term 4
I0907 11:02:32.396947 31 log.go:34] 1 became leader at term 4
I0907 11:02:32.396953 31 log.go:34] raft.node: 1 elected leader 1 at term 4
I0907 11:02:32.397042 31 raft.go:955] I’ve become the leader, updating leases.
I0907 11:02:32.397076 31 assign.go:47] Updated UID: 1. Txn Ts: 20001. NsID: 1.
E0907 11:02:32.409944 31 pool.go:311] CONN: Unable to connect with localhost:7080 : rpc error: code = Unknown desc = No node has been set up yet
E0907 11:02:32.419034 29 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:
E0907 11:02:33.412749 31 pool.go:311] CONN: Unable to connect with localhost:7080 : rpc error: code = Unknown desc = No node has been set up yet
E0907 11:02:33.419187 29 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:
W0907 11:02:33.516212 31 node.go:713] [0x1] Read index context timed out
I0907 11:02:33.516418 31 zero.go:536] Connected: cluster_info_only:true
I0907 11:02:33.517136 31 zero.go:511] Got connection request: id:1 addr:“localhost:7080”
I0907 11:02:33.517302 31 zero.go:658] Connected: id:1 addr:“localhost:7080”
I0907 11:02:33.517583 29 groups.go:135] Connected to group zero. Assigned group: 0
I0907 11:02:33.517616 29 groups.go:137] Raft Id after connection to Zero: 0x1
I0907 11:02:33.517627 29 draft.go:348] Node ID: 0x1 with GroupID: 1
I0907 11:02:33.517632 29 draft.go:357] RaftContext: id:1 group:1 addr:“localhost:7080”
I0907 11:02:33.517702 29 node.go:152] Setting raft.Config to: &{ID:1 peers: learners: ElectionTick:20 HeartbeatTick:1 Storage:0xc000174c00 Applied:0 MaxSizePerMsg:262144 MaxCommittedSizePerReady:67108864 MaxUncommittedEntriesSize:0 MaxInflightMsgs:256 CheckQuorum:false PreVote:true ReadOnlyOption:0 Logger:0x3771ec8 DisableProposalForwarding:false}
I0907 11:02:33.517993 29 log.go:34] Number of ranges found: 2
I0907 11:02:33.518015 29 log.go:34] Sent range 0 for iteration: [, 010000000000000000000b6467726170682e74797065fffffffffffffffe) of size: 0 B
I0907 11:02:33.518032 29 log.go:34] Sent range 1 for iteration: [010000000000000000000b6467726170682e74797065fffffffffffffffe, ) of size: 0 B
I0907 11:02:33.518045 29 log.go:34] LoadFromDb Schema Streaming about 0 B of uncompressed data (0 B on disk)
I0907 11:02:33.531462 29 log.go:34] LoadFromDb Schema Sent data of size 0 B
I0907 11:02:33.531736 29 log.go:34] Number of ranges found: 1
I0907 11:02:33.531754 29 log.go:34] LoadFromDb Type Streaming about 0 B of uncompressed data (0 B on disk)
I0907 11:02:33.532903 29 log.go:34] Sent range 0 for iteration: [, ) of size: 0 B
I0907 11:02:33.533726 29 log.go:34] LoadFromDb Type Sent data of size 0 B
I0907 11:02:33.533778 29 groups.go:154] Load schema from DB: OK
I0907 11:02:33.533795 29 node.go:321] Found hardstate: {Term:3 Vote:1 Commit:13 XXX_unrecognized:}
I0907 11:02:33.533836 29 node.go:326] Group 1 found 13 entries
I0907 11:02:33.533859 29 draft.go:2168] Restarting node for group: 1
I0907 11:02:33.533889 29 log.go:34] 1 became follower at term 3
I0907 11:02:33.533913 29 log.go:34] newRaft 1 [peers: , term: 3, commit: 13, applied: 0, lastindex: 13, lastterm: 3]
I0907 11:02:33.533933 29 draft.go:279] Operation started with id: opRollup
I0907 11:02:33.533969 29 groups.go:157] Init and start Raft node: OK
I0907 11:02:33.534017 29 draft.go:1507] Found Raft checkpoint: 0
I0907 11:02:33.534086 29 groups.go:867] Got address of a Zero leader: localhost:5080
I0907 11:02:33.534228 29 groups.go:881] Starting a new membership stream receive from localhost:5080.

I0907 11:02:33.534457 29 node.go:189] Setting conf state to nodes:1

I0907 11:02:33.535124 29 groups.go:898] Received first state update from Zero: counter:16 groups:<key:1 value:<members:<key:1 value:<id:1 group_id:1 addr:“localhost:7080” leader:true last_update:1662548147 > > tablets:<key:“0-dgraph.drop.op” value:<group_id:1 predicate:“0-dgraph.drop.op” > > tablets:<key:“0-dgraph.graphql.p_query” value:<group_id:1 predicate:“0-dgraph.graphql.p_query” > > tablets:<key:“0-dgraph.graphql.schema” value:<group_id:1 predicate:“0-dgraph.graphql.schema” > > tablets:<key:“0-dgraph.graphql.xid” value:<group_id:1 predicate:“0-dgraph.graphql.xid” > > tablets:<key:“0-dgraph.type” value:<group_id:1 predicate:“0-dgraph.type” > > checksum:14965571037763386389 > > zeros:<key:1 value:<id:1 addr:“localhost:5080” leader:true > > maxTxnTs:20000 maxRaftId:1 cid:“6a917247-367a-4445-b7fc-085b5ad2daab” license:<maxNodes:18446744073709551615 expiryTs:1665128822 enabled:true >
E0907 11:02:34.414297 29 admin.go:1137] namespace: 0. Error reading GraphQL schema: Please retry again, server is not ready to accept requests.
I0907 11:02:34.416243 31 pool.go:327] CONN: Re-established connection with localhost:7080.
I0907 11:02:34.420364 29 pool.go:164] CONN: Connecting to localhost:7080
I0907 11:02:34.534501 29 groups.go:165] Informed Zero about tablets I have: OK
I0907 11:02:34.534660 29 groups.go:168] Upserted Schema and Types: OK
I0907 11:02:34.534666 29 groups.go:171] Server is ready: OK
I0907 11:02:34.534671 29 access_ee.go:412] ResetAcl closed
I0907 11:02:34.534674 29 access_ee.go:322] RefreshAcls closed
I0907 11:02:36.735020 29 log.go:34] 1 is starting a new election at term 3
I0907 11:02:36.735071 29 log.go:34] 1 became pre-candidate at term 3
I0907 11:02:36.735074 29 log.go:34] 1 received MsgPreVoteResp from 1 at term 3
I0907 11:02:36.735086 29 log.go:34] 1 became candidate at term 4
I0907 11:02:36.735088 29 log.go:34] 1 received MsgVoteResp from 1 at term 4
I0907 11:02:36.735098 29 log.go:34] 1 became leader at term 4
I0907 11:02:36.735101 29 log.go:34] raft.node: 1 elected leader 1 at term 4
I0907 11:02:37.534986 29 groups.go:953] Leader idx=0x1 of group=1 is connecting to Zero for txn updates
I0907 11:02:37.535025 29 groups.go:965] Got Zero leader: localhost:5080
I0907 11:02:39.420417 29 admin.go:1148] namespace: 0. No GraphQL schema in Dgraph; serving empty GraphQL API
I0907 11:08:29.399133 31 raft.go:823] Skipping creating a snapshot. Num groups: 1, Num checkpoints: 0

PASTE THE RESULTS OF dgraph version HERE.

What is Windows’s CML?

I would recommend using v21.03.2.

Also, the tilde symbol ~, will not work under Windows. You’d have to use %USER_PROFILE% in the DOS command shell, or in $env:HOME in Powershell. It would be best not to mount the dgraph volume, as Windows file system are not compatible to Dgraph compiled for Linux.

docker run --rm -it -p "8080:8080" -p "9080:9080" -p "8000:8000"  "dgraph/standalone:v21.03.2"

I tried to solution. The same problem persists. After the run the docker image, I tried to access localhost:8080, This message popped up:

Dgraph browser is available for running separately using the dgraph-ratel binary

And localhost:8000 is not accessible.

Ratel isn’t available in that image. You should run it separately
https://hub.docker.com/r/dgraph/ratel

1 Like
docker run -rm -d -p "8000:8000" "dgraph/ratel:v21.03.2"
docker run --rm -it -p "8080:8080" -p "9080:9080" "dgraph/standalone:v21.03.2"