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

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

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

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

toast-uz opened this issue Jul 29, 2017 · 7 comments
Labels
Component: build Related to the Makefiles / build scripts in the project. Type: Bug

Comments

@toast-uz
Copy link
Contributor

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
Copy link
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
Copy link
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
Copy link
Contributor Author

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
Copy link
Contributor Author

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
Copy link
Contributor

ralight commented Aug 9, 2017

Fixed as per your PR, thanks very much.

@ralight ralight closed this as completed Aug 9, 2017
@ralight ralight added Type: Bug Component: build Related to the Makefiles / build scripts in the project. labels Aug 9, 2017
@Aztec03hub
Copy link

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

@toast-uz
Copy link
Contributor Author

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
…ost by 127.0.0.1)

Signed-off-by: Wolfgang Hottgenroth <[email protected]>
ralight pushed a commit that referenced this issue Aug 8, 2018
ralight pushed a commit that referenced this issue Nov 8, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Aug 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Component: build Related to the Makefiles / build scripts in the project. Type: Bug
Projects
None yet
Development

No branches or pull requests

3 participants