[CDRIVER-1129] Silent failure parsing hostnames longer than HOST_NAME_MAX Created: 21/Feb/16 Updated: 07/Jun/17 Resolved: 08/Sep/16 |
|
| Status: | Closed |
| Project: | C Driver |
| Component/s: | libmongoc |
| Affects Version/s: | 1.3.3 |
| Fix Version/s: | 1.5.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | David Feurle | Assignee: | A. Jesse Jiryu Davis |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Linux / Ubuntu |
||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Description |
|
mongoc_uri_parse_hostname lowercases hostnames ( |
| Comments |
| Comment by Githook User [ 08/Sep/16 ] | |||||||||||||||||||||||||||
|
Author: {u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}Message: | |||||||||||||||||||||||||||
| Comment by Julien BENOIT [ 07/Sep/16 ] | |||||||||||||||||||||||||||
|
Thanks for your help. @david This is what I did, and by the way it make the name more understandable. | |||||||||||||||||||||||||||
| Comment by A. Jesse Jiryu Davis [ 06/Sep/16 ] | |||||||||||||||||||||||||||
|
david@firehome.de thanks for providing such effective help. =) | |||||||||||||||||||||||||||
| Comment by David Feurle [ 06/Sep/16 ] | |||||||||||||||||||||||||||
|
@jesse nice work analyzing this! Thanks! | |||||||||||||||||||||||||||
| Comment by David Feurle [ 06/Sep/16 ] | |||||||||||||||||||||||||||
|
@julien as a workaround you could add a shorter alias to your Hosts file. | |||||||||||||||||||||||||||
| Comment by David Feurle [ 06/Sep/16 ] | |||||||||||||||||||||||||||
|
maybe it is an operating system / compile specific error? I'm using gcc 5.4 on ubuntu 16.04 | |||||||||||||||||||||||||||
| Comment by David Feurle [ 06/Sep/16 ] | |||||||||||||||||||||||||||
|
I'm a c++ programmer, I only have attached c++ code. Meanwhile I have set up a container with said test code. The error is still reproducible with v1.4. I can give you a limited shell access to the container so you could see for yourselve. | |||||||||||||||||||||||||||
| Comment by A. Jesse Jiryu Davis [ 06/Sep/16 ] | |||||||||||||||||||||||||||
|
Thanks David, the C source code for a program I can run that reproduces the error would be ideal. | |||||||||||||||||||||||||||
| Comment by David Feurle [ 06/Sep/16 ] | |||||||||||||||||||||||||||
|
It was really easy to reproduce -> do you want me to reproduce it and send you a debugable binary? Which os do you use? Could you set up a ubuntu 16.04 container? | |||||||||||||||||||||||||||
| Comment by A. Jesse Jiryu Davis [ 06/Sep/16 ] | |||||||||||||||||||||||||||
|
Reopened, we'll see if we can reproduce the issue. | |||||||||||||||||||||||||||
| Comment by Julien BENOIT [ 06/Sep/16 ] | |||||||||||||||||||||||||||
|
Hi, I encounter pretty much the same problem. however, it was not directly with the mongo C driver, but through a PHP extension. https://github.com/mongodb/mongo-php-driver/issues/387 I opened issue before I stumbled upon this ticket which makes me think it could be caused by the C driver. The URI parsed incorrectly is : `internal-mongodb-elb-internal-1111111111.eu-west-1.elb.amazonaws.com`. You can get full details in the ticket on PHP extension Github. Thank you for your assistance. Feel free to ask any questions. Julien BENOIT. P.S : I did not find out to reopen this ticket. I think since I am not the author, I can't | |||||||||||||||||||||||||||
| Comment by A. Jesse Jiryu Davis [ 20/Mar/16 ] | |||||||||||||||||||||||||||
|
Hi, I'm not a C++ user so I wrote a test in C, parsing your example URI works as expected:
If your issue persists, please feel free to reopen this issue with more details about what's going wrong. In particular, if the parsed "host" or "host_and_port" in your test don't have the values you expect, then what are their actual values? | |||||||||||||||||||||||||||
| Comment by A. Jesse Jiryu Davis [ 21/Feb/16 ] | |||||||||||||||||||||||||||
|
Interesting, thanks for the report! |