Dgraph alpha --security whitelist fails with bind error

To facilitate better answering of questions, if you have a question, please fill in the following info. Otherwise, please delete the template.

What I want to do

I’ve used dgraph migrate to define schema and dump data for me. I ran into some errors on the import and wanted to make some data changes. I tried dropping the data from Ratel but can’t because the IP address of the remote Ratel server isn’t whitelisted.

What I did

I successfully dropped the data from the command line using curl, but I still want to get my Ratel instance whitelisted so that I can add indexes, etc. to the schema.

When I run the --security whitelist command, I get the following port bind error. I’ve confirmed that it’s dgraph running on the port. Dgraph is running as root, so I tried running the whitelist command with sudo, but get the same error:

Output of the command and port verification is below.

Thanks in advance for any suggestions.

[centos@ ~]$ sudo /usr/local/bin/dgraph alpha --security whitelist=[myiplist]
[Sentry] 2021/08/06 00:39:50 Integration installed: ContextifyFrames
[Sentry] 2021/08/06 00:39:50 Integration installed: Environment
[Sentry] 2021/08/06 00:39:50 Integration installed: Modules
[Sentry] 2021/08/06 00:39:50 Integration installed: IgnoreErrors
[Sentry] 2021/08/06 00:39:50 Integration installed: ContextifyFrames
[Sentry] 2021/08/06 00:39:50 Integration installed: Environment
[Sentry] 2021/08/06 00:39:50 Integration installed: Modules
[Sentry] 2021/08/06 00:39:50 Integration installed: IgnoreErrors
I0806 00:39:50.992578 20766 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.
I0806 00:39:51.195846 20766 init.go:110]

Dgraph version : v21.03.1
Dgraph codename : rocket-1
Dgraph SHA-256 : a00b73d583a720aa787171e43b4cb4dbbf75b38e522f66c9943ab2f0263007fe
Commit SHA-1 : ea1cb5f35
Commit timestamp : 2021-06-17 20:38:11 +0530
Branch : HEAD
Go version : go1.16.2
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.

I0806 00:39:51.195873 20766 run.go:752] x.Config: {PortOffset:0 Limit:query-timeout=0ms; txn-abort-after=5m; mutations-nquad=1000000; disallow-drop=false; max-retries=-1; max-pending-queries=10000; mutations=allow; query-edge=1000000; normalize-node=10000 LimitMutationsNquad:1000000 LimitQueryEdge:1000000 BlockClusterWideDrop:false LimitNormalizeNode:10000 QueryTimeout:0s MaxRetries:-1 GraphQL:debug=false; extensions=true; poll-interval=1s; lambda-url=; introspection=true GraphQLDebug:false}
I0806 00:39:51.195945 20766 run.go:753] x.WorkerConfig: {TmpDir:t ExportPath:export Trace:ratio=0.01; jaeger=; datadog= MyAddr: ZeroAddr:[localhost:5080] TLSClientConfig: TLSServerConfig: Raft:group=; learner=false; snapshot-after-entries=10000; snapshot-after-duration=30m; pending-proposals=256; idx= Badger:{Dir: ValueDir: SyncWrites:false NumVersionsToKeep:1 ReadOnly:false Logger:0xc0004787e0 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:5 BlockSize:4096 BloomFalsePositive:0.01 BlockCacheSize:697932185 IndexCacheSize:375809638 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 DetectConflicts:true NamespaceOffset:-1 managedTxns:false maxBatchCount:0 maxBatchSize:0 maxValueThreshold:0} WhiteListedIPRanges:[{Lower: Upper:} {Lower: Upper:}] StrictMutations:false AclEnabled:false HmacSecret:**** AbortOlderThan:5m0s ProposedGroupId:0 StartTime:2021-08-06 00:39:50.621707797 +0000 UTC m=+0.206477069 Ludicrous:enabled=false; concurrency=2000 LudicrousEnabled:false Security:whitelist=; token= EncryptionKey:**** LogRequest:0 HardSync:false Audit:false}
I0806 00:39:51.196071 20766 run.go:754] worker.Config: {PostingDir:p WALDir:w MutationsMode:0 AuthToken: HmacSecret:**** AccessJwtTtl:0s RefreshJwtTtl:0s CachePercentage:0,65,35 CacheMb:1024 Audit: ChangeDataConf:file=; kafka=; sasl_user=; sasl_password=; ca_cert=; client_cert=; client_key=; sasl-mechanism=PLAIN;}
I0806 00:39:51.196592 20766 log.go:295] Found file: 7 First Index: 0
I0806 00:39:51.198396 20766 storage.go:125] Init Raft Storage with snap: 0, first: 1, last: 0
I0806 00:39:51.198426 20766 server_state.go:140] Opening postings BadgerDB with options: {Dir:p ValueDir:p SyncWrites:false NumVersionsToKeep:2147483647 ReadOnly:false Logger:0x33e3080 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:5 BlockSize:4096 BloomFalsePositive:0.01 BlockCacheSize:697932185 IndexCacheSize:375809638 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 DetectConflicts:false NamespaceOffset:1 managedTxns:false maxBatchCount:0 maxBatchSize:0 maxValueThreshold:0}
I0806 00:39:51.214805 20766 log.go:34] All 0 tables opened in 0s
I0806 00:39:51.215594 20766 log.go:34] Discard stats nextEmptySlot: 0
I0806 00:39:51.215624 20766 log.go:34] Set nextTxnTs to 0
I0806 00:39:51.215710 20766 log.go:34] Deleting empty file: p/000006.vlog
2021/08/06 00:39:51 listen tcp 0.0.0.0:8080: bind: address already in use

[centos ~]$ sudo netstat -lnpt | grep 8080
tcp6 0 0 :::8080 :::* LISTEN 9036/dgraph

You have another Dgraph instance already running. You should kill it before starting a new one.

Ok, thanks, that worked. I didn’t realize the whitelist flag need to be set at start up.