Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to make standalone nebula graph work #5296

Closed
chiru-arh opened this issue Jan 31, 2023 · 11 comments
Closed

Not able to make standalone nebula graph work #5296

chiru-arh opened this issue Jan 31, 2023 · 11 comments
Assignees
Labels
affects/none PR/issue: this bug affects none version. severity/none Severity of bug type/question Type: question about the product

Comments

@chiru-arh
Copy link

chiru-arh commented Jan 31, 2023

I have installed nebulagraph standalone for linux with the below mentioned installation steps. However I'm not able to make the client work.

Installation steps : Built from source

  1. Nebulagraph (Standalone)
    $ git clone --branch release-3.3 https://github.com/vesoft-inc/nebula.git
    $ cd nebula
    $ mkdir build && cd build
    $ cmake -DCMAKE_INSTALL_PREFIX=/usr/local/nebula -DENABLE_TESTING=OFF -DENABLE_STANDALONE_VERSION=on -
    DCMAKE_BUILD_TYPE=Release ..
    $ make -j2
    $ sudo make install

  2. Nebula cpp client
    $ git clone --branch release-3.3 https://github.com/vesoft-inc/nebula-cpp.git
    $ cd nebula-cpp
    $ mkdir build && cd build
    $ cmake -DCMAKE_BUILD_TYPE=Release ..
    $ make
    $ sudo make install
    $ sudo ldconfig

  3. Start the nebula service
    $ sudo /usr/local/nebula/scripts/nebula.service start all

  4. Compile example code (SessionExample.cpp)
    $ LIBRARY_PATH=/usr/local/nebula/lib:$LIBRARY_PATH g++ -std=c++11 SessionExample.cpp -I/usr/local/nebula/include -lnebula_graph_client -o session_example

  5. Run session_example
    $ ./session_example

  6. I get the below log after the above step and the program doesn't terminate (gets stuck in ConnectionPool init function)
    $ Current address : 127.0.0.1:9669

@SuperYoko
Copy link
Contributor

Failed to reproduce the issue in release-3.3, can you please give more info? Like standalone info log or config. Or maybe use gcc to debug your code?

@chiru-arh
Copy link
Author

chiru-arh commented Feb 3, 2023

Thank you for verifying. I tried on a different machine and I get the below logs for SessionExample.cpp

Current address: 192.168.0.101:9669
Host|Port|HTTP port|Status|Leader count|Leader distribution|Partition distribution|Version|
"127.0.0.1"|9779|19779|"ONLINE"|0|"No valid partition"|"No valid partition"|""|

Host|Port|HTTP port|Status|Leader count|Leader distribution|Partition distribution|Version|
"127.0.0.1"|9779|19779|"ONLINE"|0|"No valid partition"|"No valid partition"|""|

Additionally StorageClientExample.cpp gives below logs
E0203 15:10:55.648643 14699 MetaClient.cpp:42] Get space id for nba failed
scan edge...

@chiru-arh
Copy link
Author

chiru-arh commented Feb 6, 2023

Additionally StorageClientExample.cpp gives below logs
E0203 15:10:55.648643 14699 MetaClient.cpp:42] Get space id for nba failed
scan edge...

How can I fix above error?
Also is there any more documentation for nebula cpp client usage to create space, executing nGQL commands etc similar to nebula console?

@wey-gu
Copy link
Contributor

wey-gu commented Feb 6, 2023

@chiru091096 could you try to do things with nebula-console or nebula-studio, looks like things are fine now.

With nebula-console, you could type:
:play basketballplayer
Then you will have the graph space named basketballplayer as it was mention the most in the docs.

@chiru-arh
Copy link
Author

chiru-arh commented Feb 6, 2023

Hi @wey-gu ,
I'm able to execute mentioned commands with nebula console and it works fine. I'm even able to create new spaces, create verticies, edges etc. However, how can I do the same with the nebula cpp client?

@wey-gu
Copy link
Contributor

wey-gu commented Feb 6, 2023

Hi @wey-gu , I'm able to execute mentioned commands with nebula console and it works fine. I'm even able to create new spaces, create verticies, edges etc. However, how can I do the same with the nebula cpp client?

Yes, it should be equivalent, but one thing that may confuse you is DDL(schema-related queries, including space creation, tag creation, index creation, etc.) won't take effect after the query is executed, it's async and will need (up to) two heartbeats to take effect.

@chiru-arh
Copy link
Author

chiru-arh commented Feb 6, 2023

okay, @wey-gut hanks for the information.
Additionally, @wey-gu, @SuperYoko is there any example code or documentation I can refer to for executing DDL(schema-related queries, including space creation, tag creation, index creation, etc.) operations with nebula cpp client? If you can share it, it'll be very helpful.

@Sophie-Xie Sophie-Xie added the type/bug Type: something is unexpected label Feb 7, 2023
@github-actions github-actions bot added affects/none PR/issue: this bug affects none version. severity/none Severity of bug labels Feb 7, 2023
@Sophie-Xie Sophie-Xie added type/question Type: question about the product and removed type/bug Type: something is unexpected labels Feb 7, 2023
@chiru-arh
Copy link
Author

chiru-arh commented Feb 7, 2023

Hi,
I added below code to create space in SessionExample.cpp file with nebula-cpp client

result = session.execute("CREATE SPACE basketballplayer(partition_num=15, replica_factor=1, vid_type=fixed_string(30));");
if (result.errorCode != nebula::ErrorCode::SUCCEEDED) {
std::cout << "Exit with error code: " << static_cast<int>(result.errorCode) << std::endl;
return static_cast<int>(result.errorCode);
}
std::cout << *result.data <<std::endl;

However, executing it results in segmentation fault with bellow logs

*** Aborted at 1675765960 (Unix time, try 'date -d @1675765960') ***
*** Signal 11 (SIGSEGV) (0x0) received by PID 21393 (pthread TID 0x7f898b685ac0) (linux TID 21393) (code: address not mapped to object), stack trace: ***
/usr/local/nebula/lib/libnebula_graph_client.so(+0x3c53e1)[0x7f898ab5d3e1]
/usr/local/nebula/lib/libnebula_graph_client.so(+0x3bc18b)[0x7f898ab5418b]
/usr/local/nebula/lib/libnebula_graph_client.so(+0x3ba4c7)[0x7f898ab524c7]
/lib/x86_64-linux-gnu/libc.so.6(+0x354bf)[0x7f8989e074bf]
./session_example[0x4033f5]
./session_example(_ZNK6nebula7DataSet8toStringB5cxx11Ev+0x54)[0x402a12]
./session_example[0x402cb7]
./session_example[0x401f57]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xef)[0x7f8989df283f]
./session_example[0x401978]
(safe mode, symbolizer not available)
Segmentation fault (core dumped)

However, the same query works fine with nebula-graph console. How can I fix this

@wey-gu
Copy link
Contributor

wey-gu commented Feb 7, 2023

@Shylock-Hg do you have more ideas on this, please?

@Shylock-Hg
Copy link
Contributor

Shylock-Hg commented Feb 8, 2023

@Shylock-Hg do you have more ideas on this, please?

Create space is a DDL statement, its result has no data field.

@chiru-arh
Copy link
Author

chiru-arh commented Feb 10, 2023

@Shylock-Hg thank you for the reply. I removed the statement accessing data field and that crash issue was resolved.
Further I'm able to create and use space. I'm also able to create Tag.

Thank you @wey-gu,@Shylock-Hg, @SuperYoko , @Sophie-Xie for the quick support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects/none PR/issue: this bug affects none version. severity/none Severity of bug type/question Type: question about the product
Projects
None yet
Development

No branches or pull requests

5 participants