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

Test 08-ssl-bridge.py failed even on master branch. #507

Closed
toast-uz opened this Issue Jul 29, 2017 · 7 comments

Comments

Projects
None yet
3 participants
@toast-uz
Contributor

toast-uz commented Jul 29, 2017

As I reported in mosquitto-dev ML before, test 08-ssl-bridge.py failed even on master branch. Seemed to fail to accept bridge on port 1883. I've tested on CentOS7.

$ make test
(snip)
./08-ssl-bridge.py
Warning: Bridge bridge_test using insecure mode.
1501332759: mosquitto version 1.4.14 (build date 2017-07-29 12:50:18+0000) starting
1501332759: Config loaded from 08-ssl-bridge.conf.
1501332759: Opening ipv4 listen socket on port 1889.
1501332759: Opening ipv6 listen socket on port 1889.
1501332759: Bridge local.ip-172-31-17-55.ap-northeast-1.compute.internal.bridge_test doing local SUBSCRIBE on topic bridge/#
1501332759: Connecting bridge bridge_test (localhost:1888)
1501332759: Warning: Unable to connect to bridge bridge_test.
1501332760: New connection from ::1 on port 1889.
1501332760: Socket error on client <unknown>, disconnecting.
1501332780: mosquitto version 1.4.14 terminating

Traceback (most recent call last):
  File "./08-ssl-bridge.py", line 37, in <module>
    (bridge, address) = ssock.accept()
  File "/usr/lib64/python2.7/ssl.py", line 881, in accept
    newsock, addr = socket.accept(self)
  File "/usr/lib64/python2.7/socket.py", line 202, in accept
    sock, addr = self._sock.accept()
socket.timeout: timed out
make[2]: *** [08] Error 1
make[2]: Leaving directory `/home/centos/mosquitto/test/broker'
make[1]: *** [test] Error 2
make[1]: Leaving directory `/home/centos/mosquitto/test'
make: *** [test] Error 2
@ralight

This comment has been minimized.

Contributor

ralight commented Jul 30, 2017

Looks like this is down to the async dns changes, it works fine without.

ralight added a commit that referenced this issue Jul 30, 2017

@ralight

This comment has been minimized.

Contributor

ralight commented Jul 30, 2017

I think the latest commit to fixes does the job, could you please confirm it works for you?

@toast-uz

This comment has been minimized.

Contributor

toast-uz commented Jul 30, 2017

Tried but unfortunately the result seemed same.

$ git log --oneline
a480a9d Fix 08-ssl-bridge.py test when using async dns lookups.
124ee1a [490] Further fix for auth related crashes.
(snip)
$ make test
(snip)
Warning: Bridge bridge_test using insecure mode.
1501415619: mosquitto version 1.4.14 (build date 2017-07-30 11:50:55+0000) starting
1501415619: Config loaded from 08-ssl-bridge.conf.
1501415619: Opening ipv4 listen socket on port 1889.
1501415619: Opening ipv6 listen socket on port 1889.
1501415619: Bridge local.ip-172-31-25-118.ap-northeast-1.compute.internal.bridge_test doing local SUBSCRIBE on topic bridge/#
1501415619: Connecting bridge bridge_test (localhost:1888)
1501415619: Warning: Unable to connect to bridge bridge_test.
1501415619: New connection from ::1 on port 1889.
1501415619: Socket error on client <unknown>, disconnecting.
1501415622: Bridge local.ip-172-31-25-118.ap-northeast-1.compute.internal.bridge_test doing local SUBSCRIBE on topic bridge/#
1501415622: Connecting bridge bridge_test (localhost:1888)
1501415625: Bridge local.ip-172-31-25-118.ap-northeast-1.compute.internal.bridge_test doing local SUBSCRIBE on topic bridge/#
1501415625: Connecting bridge bridge_test (localhost:1888)
1501415628: Bridge local.ip-172-31-25-118.ap-northeast-1.compute.internal.bridge_test doing local SUBSCRIBE on topic bridge/#
1501415628: Connecting bridge bridge_test (localhost:1888)
1501415631: Bridge local.ip-172-31-25-118.ap-northeast-1.compute.internal.bridge_test doing local SUBSCRIBE on topic bridge/#
1501415631: Connecting bridge bridge_test (localhost:1888)
1501415634: Bridge local.ip-172-31-25-118.ap-northeast-1.compute.internal.bridge_test doing local SUBSCRIBE on topic bridge/#
1501415634: Connecting bridge bridge_test (localhost:1888)
1501415637: Bridge local.ip-172-31-25-118.ap-northeast-1.compute.internal.bridge_test doing local SUBSCRIBE on topic bridge/#
1501415637: Connecting bridge bridge_test (localhost:1888)
1501415639: mosquitto version 1.4.14 terminating

Traceback (most recent call last):
  File "./08-ssl-bridge.py", line 37, in <module>
    (bridge, address) = ssock.accept()
  File "/usr/lib64/python2.7/ssl.py", line 881, in accept
    newsock, addr = socket.accept(self)
  File "/usr/lib64/python2.7/socket.py", line 202, in accept
    sock, addr = self._sock.accept()
socket.timeout: timed out
make[2]: *** [08] Error 1
make[2]: Leaving directory `/home/centos/mosquitto/test/broker'
make[1]: *** [test] Error 2
make[1]: Leaving directory `/home/centos/mosquitto/test'
make: *** [test] Error 2
@toast-uz

This comment has been minimized.

Contributor

toast-uz commented Aug 3, 2017

I've solved.

The server listened 0.0.0.0:1888 while the client dialed to localhost:1888 as ipv6.
After I changed from address localhost:1888 to address 127.0.0.1:1888 in 08-ssl-bridge.conf, the test turned to success.

@ralight

This comment has been minimized.

Contributor

ralight commented Aug 9, 2017

Fixed as per your PR, thanks very much.

@ralight ralight closed this Aug 9, 2017

@ralight ralight added bug build labels Aug 9, 2017

@PhilLaFayette

This comment has been minimized.

PhilLaFayette commented Nov 21, 2017

Thanks for this, was wondering what happened after a fresh build from source. @toast-uz 's fix did the trick.

@toast-uz

This comment has been minimized.

Contributor

toast-uz commented Nov 21, 2017

No issue on the source but some issue on the test code. In 08-ssl-bridge.py, the bridge client is a real mosquitto but the bridge target is a dummy code using Python. The real mosquitto listens on both of IPv4 and IPv6, while the dummy code listens on IPv4 only.

wollud1969 added a commit to wollud1969/mosquitto that referenced this issue Jun 21, 2018

Change test scripts according to hints in eclipse#507 (replace localh…
…ost by 127.0.0.1)

Signed-off-by: Wolfgang Hottgenroth <wolfgang.hottgenroth@icloud.com>

ralight added a commit that referenced this issue Aug 8, 2018

Change test scripts according to hints in #507 (replace localhost by …
…127.0.0.1)

Signed-off-by: Wolfgang Hottgenroth <wolfgang.hottgenroth@icloud.com>

ralight added a commit that referenced this issue Nov 8, 2018

Change test scripts according to hints in #507 (replace localhost by …
…127.0.0.1)

Signed-off-by: Wolfgang Hottgenroth <wolfgang.hottgenroth@icloud.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment