open-iscsi / open-isns

iSNS server and client for Linux
GNU Lesser General Public License v2.1
26 stars 22 forks source link

Version of 0.102 cannot create service #45

Closed simon28li closed 1 week ago

simon28li commented 2 weeks ago

error information is as follows

root@localhost tests]#../isnsd -c /tmp/isns-test/Test01/server0/config -f -d all
   Removing stale PID file /tmp/isns-test/Test01/server0/pid
   Creating file DB backend (/tmp/isns-test/Test01/server0/database)
   DB: loading all objects from /tmp/isns-test/Test01/server0/database
   Enable ESI monitoring for entity 1
   Created DSA authentication context
   Loading private DSA key from /tmp/isns-test/Test01/server0/auth_key
   Created security principal "(null)" (DSA/2048)
   Setting principal name to "localhost"
   Creating DB keystore
   Control entity is 0x00000001
Warning: Cannot resolve address "127.0.0.1:7770": Name or service not known
** FATAL ERROR **
Error: Unable to create server socket

environmental information

[root@localhost spack-src]#uname -a
Linux localhost 5.10.0-182.0.0.95.oe2203sp3.aarch64 #1 SMP Sat Dec 30 13:16:24 CST 2023 aarch64 aarch64 aarch64 GNU/Linux
[root@localhost spack-src]#cat /etc/os-release
NAME="openEuler"
VERSION="22.03 (LTS-SP3)"
ID="openEuler"
VERSION_ID="22.03"
PRETTY_NAME="openEuler 22.03 (LTS-SP3)"
ANSI_COLOR="0;31"
gonzoleeman commented 2 weeks ago

Do you have 127.0.0.1 listed in /etc/hosts?

I assume you discovered this running the test suite. I went to run the test suite and realized that I had never really finished transitioining to python from perl, so I'm working on that now. But in the mean time, the python tests run fine for me, including Test01. So I suspect your have some network issue on your end.

Can you ping 127.0.0.1?

gonzoleeman commented 2 weeks ago

Hi. I looked at the state of the testing code, and I had to update it. It was hard to tell from your post, but this may or may not be related to your issues.

I posted a pull request #46 -- please check out my branch and try it out. You should be able to run it by taking these steps, and sorry if this is obvious or redundant:

This builds the code. Then to test it, try running it manually:

If it fails, add a "-d" (for debug) flag to the call and post the output. If it succeeds, try leaving off the "Test01", and it will run all 11 unit tests.

simon28li commented 2 weeks ago

Hi. I looked at the state of the testing code, and I had to update it. It was hard to tell from your post, but this may or may not be related to your issues.

I posted a pull request #46 -- please check out my branch and try it out. You should be able to run it by taking these steps, and sorry if this is obvious or redundant:

  • make a clean "builddir" subdirectory
  • run "meson setup -Dslp=disabled builddir" (I usually disable SLP -- it isn't used)
  • run "ninja -C builddir --verbose"

This builds the code. Then to test it, try running it manually:

  • cd to the "tests" subdirectory
  • run "./test-isns.py -fv Test01" (as root)

If it fails, add a "-d" (for debug) flag to the call and post the output. If it succeeds, try leaving off the "Test01", and it will run all 11 unit tests.

Pulled the new branch code and compiled the test steps as you said, and all the tests passed. Until then, I tried to ping 127.0.0.1 and everything was fine, including when using the old code. What's causing this problem, or what's done with your new code?

......
test03_run_external_program_pauw3_again (__main__.Test10)
Run the third external program ...
*** Stage pauw3-2: Run external program pauw3 (slow) ***
./../build/pauw3 -c /tmp/isns-test/Test10/client1/config -n 16 >& /tmp/isns-test/Test10/client1/logfile
*** SUCCESS ***
ok
test04_wait_for_esi_to_expire_again (__main__.Test10)
Wait for ESI to come around ...
*** Stage expired2: Wait for ESI to expire (5s) ***
Snooze.....
./../build/isnsd -c /tmp/isns-test/Test10/server0/config --dump-db >& /tmp/isns-test/Test10/dump/expired2
*** Verifying database dump for stage expired2
*** SUCCESS ***
ok
*** Starting Test11
*** Building ./server.conf -> /tmp/isns-test/Test11/server0/config
*** Building ./client.conf -> /tmp/isns-test/Test11/client1/config
*** Starting server (logging to /tmp/isns-test/Test11/server0/logfile)
./../build/isnsd -c /tmp/isns-test/Test11/server0/config -f -d all >& /tmp/isns-test/Test11/server0/logfile
*** Started server (pid=1984299) ***
test01_run_external_program_pauw4 (__main__.Test11)
Run the second external program ...
*** Stage pauw2: Run external program pauw4 ***
./../build/pauw4 -c /tmp/isns-test/Test11/client1/config >& /tmp/isns-test/Test11/client1/logfile
./../build/isnsd -c /tmp/isns-test/Test11/server0/config --dump-db >& /tmp/isns-test/Test11/dump/pauw2
*** Verifying database dump for stage pauw2
*** SUCCESS ***
ok

----------------------------------------------------------------------
Ran 41 tests in 114.754s

OK
gonzoleeman commented 2 weeks ago

The tests do not modify any systems files, so I doubt running any version of the tests would "fix" your issue. So I'm not sure why your issue went away. But I'm glad my test update worked for you. I'll merge it. Soon I'll tag a new version, as well.

I was thinking version 1.1. What do you think? I'm tired of the "0.*" versioning.

gonzoleeman commented 1 week ago

I am going to mark this issue as closed, since the tests pass for you now.