Hello
i have a fresh version oft drupal 8 and the http:BL Module.
But after i type in the Key and enable it the Webside is down with:

"The website encountered an unexpected error. Please try again later."

"Comment submissions only. (Blocked comments are unpublished, regardless of comment moderation permissions.)"
That Option i have enable.

Update:
When i run drupal in a subdomain the Modul works fine.

Can it be well it runs in a folder /drupal7/testdrupal8/.
That Drupal 7 Blocks it ?

Comments

rothlive created an issue. See original summary.

rothlive’s picture

Issue summary: View changes

Hello
i have a fresh version oft drupal 8 and the http:BL Module.
But after i type in the Key and enable it the Webside is down with:

"The website encountered an unexpected error. Please try again later."

"Comment submissions only. (Blocked comments are unpublished, regardless of comment moderation permissions.)"
That Option i have enable.

rothlive’s picture

Issue summary: View changes
cilefen’s picture

"The website encountered an unexpected error. Please try again later."

When this happens something is logged. Check the logs.

bryrock’s picture

Assigned: Unassigned » bryrock
Status: Active » Postponed

Thanks for the information. Not going to be able to look at this for at least 2-3 weeks.

rothlive’s picture

StatusFileSize
new58.71 KB
new34.12 KB

I searched a little longer because on one server it didn't work on another.
It's a problem with Ip 6 addresses. If you switch off IP 6 everything works.
Something about the database and the data type.
Below the PHP error message.

1
2

AH01071: Got error 'PHP message: Drupal\\Core\\Entity\\EntityStorageException: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'host_ip' at row 1: INSERT INTO {httpbl_host} (uuid, host_ip, host_status, source, expire, created, changed) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6); Array\n(\n [:db_insert_placeholder_0] => \n [:db_insert_placeholder_1] => Deleted IP 6\n [:db_insert_placeholder_2] => 0\n [:db_insert_placeholder_3] => Project Honeypot\n [:db_insert_placeholder_4] => \n [:db_insert_placeholder_5] => \n [:db_insert_placeholder_6] => \n)\n in /drupal-8.4.3/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php on line 805 #0 ..\n'

bryrock’s picture

Component: User interface » Code
Status: Postponed » Postponed (maintainer needs more info)

I honestly don't a see a specific enough issue being reported here, though the IPv6 possibility is a good theory, because, yes, httpbl storage is not large enough for IPv6 addresses.

I don't understand the update regarding using the module in a drupal7 folder(?).

Another possible issue is the conflict with page_cache. For more info see #2868126: TypeError: Argument 1 passed to Drupal\Core\Routing\RequestContext::fromRequest() must be an instance.

The workaround for that one is to use only dynamic_page_cache with httpbl.

The dev release has recently been updated to fix an unreported issue that only affected adding/editing IPs manually using the form.

As long as page_cache is not enabled, httpbl is working with Drupal 8.5.6.

bryrock’s picture

Priority: Critical » Major

Reduced priority from Critical.

darren oh’s picture

Title: drupal-8.4.3 crash after enable the module » Fix failure with IPv6
Status: Postponed (maintainer needs more info) » Active

I have confirmed that the issue is that the host_ip column is limited to 15 characters. This prevents users with IPv6 addresses from using the site. I was able to use my site after changing the character limit for the host_ip column to 39. The core ban_ip table uses a limit of 40 characters, so that should be the limit for consistency.

bryrock’s picture

Assigned: bryrock » Unassigned
Status: Active » Postponed

The httpBL service itself (at Project Honeypot) does not support IPv6.

You'll never get a positive hit on an IPv6 IP, so all IPv6 hosts will appear as "safe."

darren oh’s picture

Status: Postponed » Active

It’s better for IPv6 addresses to be assumed to be safe than for them not to be able to use the site at all.

bryrock’s picture

Assigned: Unassigned » bryrock
Status: Active » Needs review
StatusFileSize
new2.58 KB

As long as Project Honeypot doesn't support IPv6, then I agree there's nothing that can be done other than to assume IPv6 hosts are safe (or uninstall the module, of course), but I don't see any point in actually storing them as "safe." Seems dishonest.

So here's another approach:

The IP is validated for IPv4. If it's not, then a $project_supported (FALSE) variable is sent to the evaluator function [evaluateVisitor($ip, $request, $project_supported)].

When that function sees it's not a supported query, it marks it "safe", logs a notice (that it won't actually be checked) and returns the request without any further lookups, local or Project Honeypot.

The IP still gets through, but no checking is done and no storage happens, so no crash.

darren oh’s picture

Status: Needs review » Reviewed & tested by the community

I have reviewed the patch and successfully tested it on my own site.

darren oh’s picture

Changing the field length to accommodate IPv6 addresses could still be helpful for addresses that an admin adds manually.

  • bryrock authored f3e4385 on 8.x-1.x
    Issue #2931626 by bryrock, rothlive: Fix failure with IPv6
    
bryrock’s picture

Assigned: bryrock » Unassigned
Status: Reviewed & tested by the community » Fixed

  • bryrock committed 78c6644 on 8.x-1.x
    Issue #2931626 by bryrock: Fix failure with IPv6 - amend for comment...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.