Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Invalid DNS pattern

See original GitHub issue


We are using https proxies to crawl some website and sometimes i get the following stack trace:

Error during info_callback
Traceback (most recent call last):
  File "/home/wirebot/.virtualenvs/cayzn_tracking.scraping/local/lib/python2.7/site-packages/twisted/protocols/", line 315, in dataReceived
  File "/home/wirebot/.virtualenvs/cayzn_tracking.scraping/local/lib/python2.7/site-packages/twisted/protocols/", line 235, in _checkHandshakeStatus
  File "/home/wirebot/.virtualenvs/cayzn_tracking.scraping/local/lib/python2.7/site-packages/OpenSSL/", line 1442, in do_handshake
    result = _lib.SSL_do_handshake(self._ssl)
  File "/home/wirebot/.virtualenvs/cayzn_tracking.scraping/local/lib/python2.7/site-packages/OpenSSL/", line 933, in wrapper
    callback(Connection._reverse_mapping[ssl], where, return_code)
--- <exception caught here> ---
  File "/home/wirebot/.virtualenvs/cayzn_tracking.scraping/local/lib/python2.7/site-packages/twisted/internet/", line 1102, in infoCallback
    return wrapped(connection, where, ret)
  File "/home/wirebot/.virtualenvs/cayzn_tracking.scraping/local/lib/python2.7/site-packages/scrapy/core/downloader/", line 67, in _identityVerifyingInfoCallback
    verifyHostname(connection, self._hostnameASCII)
  File "/home/wirebot/.virtualenvs/cayzn_tracking.scraping/local/lib/python2.7/site-packages/service_identity/", line 44, in verify_hostname
  File "/home/wirebot/.virtualenvs/cayzn_tracking.scraping/local/lib/python2.7/site-packages/service_identity/", line 73, in extract_ids
  File "/home/wirebot/.virtualenvs/cayzn_tracking.scraping/local/lib/python2.7/site-packages/service_identity/", line 156, in __init__
    "Invalid DNS pattern {0!r}.".format(pattern)
service_identity.exceptions.CertificateError: Invalid DNS pattern ''.

I think this issue is somewhat similar to and this ‘invalid DNS pattern’ error should be caught similarly as the ‘Invalid DNS-ID’. What do you think ?

In the meantime, how can i catch it myself and silent it ?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

dangracommented, Jul 3, 2018

@oximer We are looking forward to release Scrapy 1.6.0 by next week.

But you don’t need git to install Scrapy from master branch, you can include the following line in your requirements.txt instead:

6f5c39d is the commit id for the last commit on master branch at the moment.

jslay88commented, Sep 26, 2018

It takes about 20s to look at the file structure to realize requirements.txt has been renamed to requirements-py2.txt and requirements-py3.txt accordingly depending on the env you are running.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Mail delivery failed, invalid DNS -
Sending test email is working but when I send email from contact form on website, Mail delivery failed,. here what I got: Action:...
Read more >
Scrapy handshake failure using TLSv1.0 through a proxy
CertificateError: Invalid DNS pattern ''. 2018-09-26 14:38:00 [scrapy.downloadermiddlewares.retry] DEBUG: Gave up retrying <GET ...
Read more >
Resolve an Invalid Character in the DNS Name - TechDocs
Create a DNS record that maps the incorrect name to the corrected name. Consider that an Orchestrator host name includes an invalid character....
Read more >
twisted.python.failure.CertificateError: Invalid DNS pattern
Hi. I didnt change anything. But at the beginning of the month my scrayper run ( Not it throws an error.
Read more >
DNS: What Can Go Wrong and How You Can Fix It
These name servers can go down at times due to an issue (i.e. DDoS attacks, network issues with the server, etc.). This can...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found