Ratel crashes with a blank screen when clicking schema Predicate or Samples & Statistics

Report a Ratel Bug

What Version of Ratel are you using?

Ratel Version
Built at 2021-02-23T07:46:34.681Z
Commit: 4334c42
Commit Info: 4334c42 Tue Feb 9 17:24:38 2021 +0530 (HEAD -> master, origin/master, origin/HEAD)

What version of Dgraph are you using?

Dgraph Version
Dgraph SHA-256   : 0153cb8d3941ad5ad107e395b347e8d930a0b4ead6f4524521f7a525a9699167,
Dgraph version   : v20.11.2,
jemalloc enabled : true

Which Version of the UI are you using

  • Stable
  • Bleeding Edge

Have you tried reproducing the issue with the latest release?

use latest release

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

Expected behaviour and actual result.


@zzl221000 Can you try hard-refreshing (C-F5 or S-F5) ?

@chewxy
I tried and still have issues.

I have seen this happen in the past. @zzl221000 can you generate an example to reproduce? or show me (if easy) to reproduce with https://play.dgraph.io/ ?

@MichelDiz The problem occurs after using the bulk loader.

use bulk loader

./dgraph bulk -f test.rdf -s s.schema -g g.schema --map_shards=4 --reduce_shards=1
reproduce files

g.schema (1.2 KB)
s.schema (1.0 KB)
test.rdf (1.8 KB)

This issue keeps happening on my dev environment. It is really annoying :angry:
OS: Windows 10.

@gja can you have a look at this? I have managed to reproduce the issue.

I have tested it with v20.11.2 and the latest Ratel. No luck trying to reproduce. I have follow what @zzl221000 shared.

It must be something very specific.

@koculu please share some reproducible data and query that leads to the issue.

Hi @MichelDiz
I have a better suggestion to fix this issue:

  1. Is there an option to run Ratel UI with source javascript? is there an option to disable minification and obfuscation?
  2. I can take a look to understand what is going wrong and provide you exact place of the bug.
  3. or I can provide you remote session to check together.

Clone the Ratel’s repo and run it. There’s zero minification by doing this.

1 Like

@MichelDiz
Is there a build script for Windows? This issue happens on Windows.
Or a documentation / site to quickly install necessary build tools and do build manually?

Ratel is a ReactJS application. You can run in any OS, but we don’ have any specific recommendations for Windows.

Just install Nodejs/NPM, maybe Yarn. Run “npm i”, “npm run start”. And that’s it.

I have NPM NodeJS and bash. build script works perfectly with one issue.
I followed all the instructions but cannot build the go server package.
Can you please take a look?

You don’t need to build the binary itself. Just go to the client and run it there.

I executed following:
go get -u github.com/dgraph-io/ratel

then I did not get the source in go/src path.
Then I manually cloned the ratel repo using git clone.

Then started the build.

Don’t do this. This is the process to create the binary. It will minify and so on. Ignore this process.

Ok got it. It took me a while to see that npm start command under client :slight_smile:
I found the root cause:
The problem is on sample query retrieval. I did not dig into more details because my main task is different at the moment. I simply commented out the sample statisctics for now.
I think following is what TODO next:

  1. Do not fail the app if sample statistics fetch fail (important)
  2. Fix the parse error.

I hope this helps. Let me know if you need further details about the bug.

Why did it fail? Somehow Ratel has lost the connection with Dgraph?
When you click on the predicate in the panel, is the “Samples & Statistics” set on the right panel?

Why it fails is important.

No dgraph return successful result to the following query.

{
        samples(func: has(<post-attachment>), first: 10) {
            uid
            expand(_all_) {
              uid
              expand(_all_)
            }
        }
    }

but parsing fails. I don’t know exactly what’s happening on react side.

I think it is related with expanded edges.
React part does not expect an inner object within samples.

Reproduction scenario might be this (not tested):
create some records with edges.
then click the edge in the predicates page.

@gja @thiyaga if you could look into this? Thanks