What's problem of this query?

Hi, I query the node with type function and fetch the <dgraph.type> as response.
However, the response only return the uid.
some node miss the dgraph.type

That feels like a bug, do you have the steps to reproduce?

not yet, let me try reproduce first.

Hi Michel,
I find it maybe some problem with my sst.
I copy my data in /dgraph to github as dgraph.tar.
GitHub - awsl-dbq/discuss-10119
Using the data then you can reproduce it.

query{
  q(func: has(<dgraph.type>)){
    <dgraph.type>
    uid
    
  }
}
{
  "data": {
    "q": [
      {
        "uid": "0x2"
      },
      {
        "uid": "0x3"
      },
      {
        "uid": "0x4"
      },
      {
        "uid": "0x5"
      }
    ]
  },
  "extensions": {
    "server_latency": {
      "parsing_ns": 63153,
      "processing_ns": 42564437,
      "encoding_ns": 45632,
      "assign_timestamp_ns": 643939,
      "total_ns": 43387166
    },
    "txn": {
      "start_ts": 410060
    },
    "metrics": {
      "num_uids": {
        "_total": 8,
        "dgraph.type": 4,
        "uid": 4
      }
    }
  }
}

I wasn’t able to open the dataset from the directories. Probably you are using Windows? I got the error “manifest has bad magic”, “Error while opening WAL store”. Trying to reproduce with the exported data tho.

Using the exported data itself I wasn’t able to reproduce the issue.

Tested with Liveloader and Bulkloader later.

I’m using docker on linux.
the docker-compose file is in the git repo.
the dgraph.tar is all files in volume /dgraph

here is the log of docker-compose up

zero_1    | [Decoder]: Using assembly version of decoder
zero_1    | [Sentry] 2020/09/26 11:34:35 Integration installed: ContextifyFrames
zero_1    | [Sentry] 2020/09/26 11:34:35 Integration installed: Environment
zero_1    | [Sentry] 2020/09/26 11:34:35 Integration installed: Modules
zero_1    | [Sentry] 2020/09/26 11:34:35 Integration installed: IgnoreErrors
zero_1    | I0926 11:34:36.041683      14 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 --enable_sentry=false flag. For more info, see https://dgraph.io/docs/howto/#data-handling.
zero_1    | I0926 11:34:36.248480      14 init.go:102] 
zero_1    | 
zero_1    | Dgraph version   : v20.07.0
zero_1    | Dgraph codename  : shuri
zero_1    | Dgraph SHA-256   : 4cd320fc6eab163ab68602a5122a6c82c8467c2ed5ac93478d5f40d44eec71c4
zero_1    | Commit SHA-1     : d65e20530
zero_1    | Commit timestamp : 2020-07-28 15:31:37 -0700
zero_1    | Branch           : HEAD
zero_1    | Go version       : go1.14.4
zero_1    | 
zero_1    | For Dgraph official documentation, visit https://dgraph.io/docs/.
zero_1    | For discussions about Dgraph     , visit https://discuss.dgraph.io.
zero_1    | To say hi to the community       , visit https://dgraph.slack.com.
zero_1    | 
zero_1    | Licensed variously under the Apache Public License 2.0 and Dgraph Community License.
zero_1    | Copyright 2015-2020 Dgraph Labs, Inc.
zero_1    | 
zero_1    | 
zero_1    | I0926 11:34:36.248555      14 run.go:108] Setting up grpc listener at: 0.0.0.0:5080
zero_1    | I0926 11:34:36.249046      14 run.go:108] Setting up http listener at: 0.0.0.0:6080
zero_1    | badger 2020/09/26 11:34:36 INFO: All 1 tables opened in 2ms
zero_1    | badger 2020/09/26 11:34:36 INFO: Replaying file id: 0 at offset: 12616
zero_1    | badger 2020/09/26 11:34:36 INFO: Replay took: 991.384µs
zero_1    | I0926 11:34:36.375145      14 node.go:148] Setting raft.Config to: &{ID:1 peers:[] learners:[] ElectionTick:20 HeartbeatTick:1 Storage:0xc000304080 Applied:0 MaxSizePerMsg:262144 MaxCommittedSizePerReady:67108864 MaxUncommittedEntriesSize:0 MaxInflightMsgs:256 CheckQuorum:false PreVote:true ReadOnlyOption:0 Logger:0x2bcf318 DisableProposalForwarding:false}
zero_1    | I0926 11:34:36.375431      14 node.go:317] Found hardstate: {Term:17 Vote:1 Commit:83 XXX_unrecognized:[]}
zero_1    | I0926 11:34:36.375538      14 node.go:326] Group 0 found 83 entries
zero_1    | I0926 11:34:36.375558      14 raft.go:448] Restarting node for dgraphzero
zero_1    | I0926 11:34:36.375627      14 log.go:34] 1 became follower at term 17
zero_1    | I0926 11:34:36.375709      14 log.go:34] newRaft 1 [peers: [], term: 17, commit: 83, applied: 0, lastindex: 83, lastterm: 17]
zero_1    | I0926 11:34:36.375820      14 run.go:311] Running Dgraph Zero...
zero_1    | I0926 11:34:36.486791      14 node.go:185] Setting conf state to nodes:1 
zero_1    | I0926 11:34:36.487324      14 raft.go:708] Done applying conf change at 0x1
zero_1    | I0926 11:34:36.487545      14 pool.go:160] CONNECTING to server:7080
zero_1    | W0926 11:34:36.491581      14 pool.go:254] Connection lost with server:7080. Error: rpc error: code = Unknown desc = No node has been set up yet
zero_1    | I0926 11:34:37.376166      14 log.go:34] 1 no leader at term 17; dropping index reading msg
zero_1    | I0926 11:34:37.745970      14 zero.go:422] Got connection request: cluster_info_only:true 
zero_1    | I0926 11:34:38.676188      14 log.go:34] 1 is starting a new election at term 17
zero_1    | I0926 11:34:38.676238      14 log.go:34] 1 became pre-candidate at term 17
zero_1    | I0926 11:34:38.676244      14 log.go:34] 1 received MsgPreVoteResp from 1 at term 17
zero_1    | I0926 11:34:38.676281      14 log.go:34] 1 became candidate at term 18
zero_1    | I0926 11:34:38.676288      14 log.go:34] 1 received MsgVoteResp from 1 at term 18
zero_1    | I0926 11:34:38.676339      14 log.go:34] 1 became leader at term 18
zero_1    | I0926 11:34:38.676353      14 log.go:34] raft.node: 1 elected leader 1 at term 18
zero_1    | I0926 11:34:38.676385      14 raft.go:673] I've become the leader, updating leases.
zero_1    | I0926 11:34:38.676394      14 assign.go:42] Updated Lease id: 20001. Txn Ts: 420053
server_1  | I0926 11:34:38.925183      13 admin.go:594] Error reading GraphQL schema: Please retry again, server is not ready to accept requests.
zero_1    | W0926 11:34:39.376229      14 node.go:674] [0x1] Read index context timed out
zero_1    | I0926 11:34:39.377773      14 zero.go:440] Connected: cluster_info_only:true 
zero_1    | I0926 11:34:39.379110      14 zero.go:422] Got connection request: id:1 addr:"server:7080" 
zero_1    | I0926 11:34:39.379310      14 zero.go:553] Connected: id:1 addr:"server:7080" 
server_1  | I0926 11:34:39.379662      13 groups.go:135] Connected to group zero. Assigned group: 0
server_1  | I0926 11:34:39.380010      13 groups.go:137] Raft Id after connection to Zero: 0x1
server_1  | I0926 11:34:39.380284      13 pool.go:160] CONNECTING to server:7080
server_1  | I0926 11:34:39.380375      13 draft.go:210] Node ID: 0x1 with GroupID: 1
server_1  | I0926 11:34:39.380441      13 node.go:148] Setting raft.Config to: &{ID:1 peers:[] learners:[] ElectionTick:20 HeartbeatTick:1 Storage:0xc0004da7c0 Applied:0 MaxSizePerMsg:262144 MaxCommittedSizePerReady:67108864 MaxUncommittedEntriesSize:0 MaxInflightMsgs:256 CheckQuorum:false PreVote:true ReadOnlyOption:0 Logger:0x2bcf318 DisableProposalForwarding:false}
server_1  | I0926 11:34:39.380940      13 node.go:317] Found hardstate: {Term:17 Vote:1 Commit:5931 XXX_unrecognized:[]}
server_1  | I0926 11:34:39.386387      13 node.go:326] Group 1 found 5931 entries
server_1  | I0926 11:34:39.386787      13 draft.go:1609] Restarting node for group: 1
server_1  | I0926 11:34:39.387090      13 log.go:34] 1 became follower at term 17
server_1  | I0926 11:34:39.387730      13 log.go:34] newRaft 1 [peers: [], term: 17, commit: 5931, applied: 0, lastindex: 5931, lastterm: 17]
server_1  | I0926 11:34:39.388058      13 draft.go:160] Operation started with id: opRollup
server_1  | I0926 11:34:39.388463      13 groups.go:155] Server is ready
server_1  | I0926 11:34:39.388578      13 draft.go:1009] Found Raft progress: 5727
server_1  | I0926 11:34:39.388625      13 groups.go:790] Got address of a Zero leader: zero:5080
server_1  | I0926 11:34:39.388761      13 groups.go:804] Starting a new membership stream receive from zero:5080.
server_1  | I0926 11:34:39.389682      13 groups.go:821] Received first state update from Zero: counter:83 groups:<key:1 value:<members:<key:1 value:<id:1 group_id:1 addr:"server:7080" leader:true last_update:1600936830 > > tablets:<key:"Name" value:<group_id:1 predicate:"Name" > > tablets:<key:"dgraph.graphql.schema" value:<group_id:1 predicate:"dgraph.graphql.schema" > > tablets:<key:"dgraph.graphql.xid" value:<group_id:1 predicate:"dgraph.graphql.xid" > > tablets:<key:"dgraph.type" value:<group_id:1 predicate:"dgraph.type" > > tablets:<key:"friend" value:<group_id:1 predicate:"friend" > > tablets:<key:"name" value:<group_id:1 predicate:"name" space:166546 > > checksum:12158923514919085318 > > zeros:<key:1 value:<id:1 addr:"zero:5080" leader:true > > maxLeaseId:20000 maxTxnTs:420052 maxRaftId:1 cid:"20d6fc65-5309-482e-91ca-a273fa2a66eb" license:<maxNodes:18446744073709551615 expiryTs:1578103546 > 
server_1  | I0926 11:34:39.505852      13 node.go:185] Setting conf state to nodes:1 
server_1  | I0926 11:34:41.589015      13 log.go:34] 1 is starting a new election at term 17
server_1  | I0926 11:34:41.589073      13 log.go:34] 1 became pre-candidate at term 17
server_1  | I0926 11:34:41.589092      13 log.go:34] 1 received MsgPreVoteResp from 1 at term 17
server_1  | I0926 11:34:41.589654      13 log.go:34] 1 became candidate at term 18
server_1  | I0926 11:34:41.589700      13 log.go:34] 1 received MsgVoteResp from 1 at term 18
server_1  | I0926 11:34:41.590515      13 log.go:34] 1 became leader at term 18
server_1  | I0926 11:34:41.590579      13 log.go:34] raft.node: 1 elected leader 1 at term 18
server_1  | I0926 11:34:42.388835      13 groups.go:873] Leader idx=0x1 of group=1 is connecting to Zero for txn updates
server_1  | I0926 11:34:42.388951      13 groups.go:882] Got Zero leader: zero:5080
server_1  | I0926 11:34:44.087164      13 admin.go:605] No GraphQL schema in Dgraph; serving empty GraphQL API

I didn’t find any Error while opening WAL store in logs.

yes, I know . If I export and reload it . It works.
However, there may be something wrong with the sst .

Got it.

@dmai, can you reproduce it on your side? I wasn’t able to. Thanks.

Got it, I don’t use any container system for testing. Just in specific cases. I like to maintain the testing in a controllable environment. With Docker, we have some limitations. I can’t change between an NVMe or HDD easily with it. Also, Docker on Windows or Darwin doesn’t use the whole potential of the machine.

BTW, I think my issue was in the decompressing program. Not sure. I’ll download other and try again.