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

Fatal error: Uncaught League\Uri\PublicSuffix\Exception #13

Closed
erichuang2015 opened this issue Oct 13, 2018 · 8 comments
Closed

Fatal error: Uncaught League\Uri\PublicSuffix\Exception #13

erichuang2015 opened this issue Oct 13, 2018 · 8 comments
Assignees
Labels
duplicate This issue or pull request already exists wontfix This will not be worked on

Comments

@erichuang2015
Copy link

Hi there

Fatal error: Uncaught League\Uri\PublicSuffix\Exception: Unable to load the public suffix list rules for https://publicsuffix.org/list/public_suffix_list.dat

PHP Version 7.1.22
CentOS Linux 7.3.1611

@mallardduck
Copy link
Owner

Issue #8 was related to this issue as well. That user however wasn't available to debug further.

Does loading the DAT file directly in your browser work or fail? This was one thing I was curious about in that instance but was unable to test it. Please attempt to load this URL in your browser, or via CURL in command line: https://publicsuffix.org/list/public_suffix_list.dat

@erichuang2015
Copy link
Author

hello

https://publicsuffix.org/list/public_suffix_list.dat is accessible for me either browser or cli

@erichuang2015
Copy link
Author

hello

it is so strange for me , when I compose this script in local XAMPP with PHP 7.2.10, it works ok

@mallardduck
Copy link
Owner

It does seem very odd. I haven't had time yet to test this myself but I did look into the underlying Exception more and it's really only thrown if a method to refresh the Public Suffix List returns false. Found here.

Without any other errors associated it makes me think there's an issue reaching the dat file, but if you can see it in CLI then I'm not sure. Very peculiar indeed.

@mallardduck
Copy link
Owner

Hey @erichuang2015,

You said:

it is so strange for me , when I compose this script in local XAMPP with PHP 7.2.10, it works ok

So it seems that this library works fine for you locally. Previously I asked if you could test via browser or cli and you said:

https://publicsuffix.org/list/public_suffix_list.dat is accessible for me either browser or cli

When you did the testing for this, did you do that locally or on the server throwing the exception?

You should test loading the .dat file via CURL on the server experiencing the issue. If it doesn't work via CURL on the server throwing the Exception when using this library then that indicates an issue isolated to that server.

@erichuang2015
Copy link
Author

Yes. online server throws errors

@mallardduck
Copy link
Owner

@erichuang2015 Unfortunately it seems that this error you're experiencing is isolated to that server. It's not something I can reproduce or debug myself - I don't have a CentOS 7.3 server. I would guess that even if I had a CentOS 7.3 server I may not even experience the issue.

I would guess that there may be a network/firewall related issue causing the problem. If your server is hosted at a managed hosting provider, then potentially you could submit a ticket with their support.

If that's not an option and you'd have to debug this on your own the best I can do is provide some basic advice. Not sure if it will all apply, but it still may help.

From the affected server do the following:

  1. Do a dig on the publicsuffix.org domain - just to confirm you can resolve the DNS. If that works proceed. If not you've got a DNS resolution issue.
    dig publicsuffix.org
  2. Take (one of) the IP addresses you got from the dig and shoot it a quick ping request. I usually do 3 rounds with ping -c3. If that works you have confirmed your server can reach one of their IPs; so it should be working to load the list. If it doesn't work then you may have something to investigate further.
    ping -c3 {ip from dig}
  3. Now do a telnet to port 80 on one of the IPs from the dig results. If the ping worked and the telnet worked then you definitely should be fine loading the file. Something very weird is happening if this is the case. If they are not working then you likely have a network or firewall issue.
    telnet {ip from dig} 80
  4. Assuming that the ping worked and the telnet failed - or they both failed - the final step might be to do a traceroute, either with the original command or with MTR. Doing a traceroute to the IP used for the last two steps may show you where in the network path the request fails.
    traceroute {ip from dig} or mtr {ip from dig}

Again I hope this helps you debug the issue!

@mallardduck mallardduck added duplicate This issue or pull request already exists wontfix This will not be worked on labels Oct 19, 2018
@mallardduck mallardduck self-assigned this Oct 19, 2018
@mallardduck
Copy link
Owner

Since this is likely an issue isolated to the server I'm going to close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants