Visitors - Ludwig integration

Created on 19 November 2023, about 1 year ago
Updated 6 July 2024, 5 months ago

Problem/Motivation

On the host page the host displays odd number information, such as "3071259386", or "883396627". As I recall this information was a IP address? Or URL??

Steps to reproduce

I have no idea what's going on with my install problems with this module, perhaps something stuck in the database. For a long time this module operated perfect and I used it daily. I have been having problems with visitors since about update 8.x-2.13 under Drupal 9. I did various installs and roll backs and ended up keeping it at 8.x-2.12 until I eventually uninstalled it. I even replaced the database a few times trying to do updates (one update scared me when it cleared my log, version 8.x-2.13 I think). I kept it uninstalled when I moved to Drupal 10.

On D10 I tried a "fresh" install of 8.x-2.16 but noticed something still off. I think I got an error about having to install previous versions first, so I did that and uninstalled (clearing caches and opcache each time like a maniac) and went back to 8.x-2.12, which was the first D10 compatible version. It seemed to install/operate fine, and I went through the progression of updates until I once again started having errors and problems around 8.x-2.13. I don't think 8.x-2.14 even installed at all, and I didn't even touch 8.x-2.15. Currently all the reports seem to be operating normally with 8.x-2.16 except for the host page. I don't know if this is a bug or something on my end, so I'm putting this under Support Category. ??

  • Drupal Version 10.1.6
  • PHP Version 8.1.25
  • MySQL 5.7.42-log
  • I'm using the Admin UI (and FTP if needed) for installs/updates and not Composer, although I have Ludwig installed. I know, I know, old school... sorry... I'm still trying to figure out installing that, and what I know is more practical for me now.

I wish I could give better information, but I've been having long and complicated problems (and actions) with this module that my notes are a mess. It all started around 8.x-2.13 and I've had numerous errors and white pages around 8.x-2.13 to 8.x-2.15

I'm wondering if there is a cache stuck in the database, and if clearing it might resolve, but I don't know where to look, and I don't like messing with the database directly, so I"m posting here first for ideas. I would have thought that uninstalling the module would have removed all the database information but something leads me to believe that this didn't happen.

This was one of my favorite modules, so I would love to get it back working normally on my system again. I would appreciate any ideas, advice or suggestions. Thanks to bluegeek9 for the great module and issues help!

Possible Related Error Message

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

TypeError: long2ip(): Argument #1 ($ip) must be of type int, string given in long2ip() (line 157 of modules/visitors/src/Controller/Report/Hosts.php).

Drupal\visitors\Controller\Report\Hosts->getData() (Line: 81)
Drupal\visitors\Controller\Report\Hosts->display()
call_user_func_array() (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 592)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 58)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 57)
Drupal\advban\AdvbanMiddleware->handle() (Line: 50)
Drupal\ban\BanMiddleware->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 704)
Drupal\Core\DrupalKernel->handle() (Line: 19)

Not sure if issue 3313061 β†’ is related since it references a different version. Sorry if I'm erroneously posting... my head is spinning trying to keep up with Drupal issues lately.

✨ Feature request
Status

Closed: won't fix

Version

2.16

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States corE

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @corE
  • πŸ‡ΊπŸ‡ΈUnited States corE
  • πŸ‡ΊπŸ‡ΈUnited States corE
  • πŸ‡­πŸ‡·Croatia devad

    Since you said you are using Ludwig... did you created manually the ludwig.json file inside your modules/visitors folder?

  • πŸ‡ΊπŸ‡ΈUnited States corE

    Thank you @devad

    I thing I need to tackle the composer hurdle. I've been doing the old way for so long that I'm a little intimidated by setting it up. I really like the Ludwig idea, but I think they want to discontinue it.

    Here is what I came up with for your suggestion, although I couldn't find any reference to these in the visitor files. I assume the are specified elsewhere? You may not be familiar with Ludwig but I don't suppose you would be able to determine if this looks correct? I think I have the URLs right.

    {
        "require": {
            "composer/ca-bundle": {
                "version": "1.3.7",
                "url": "https://github.com/composer/ca-bundle/archive/1.3.7.zip"
        },
            "maxmind/web-service-common-php": {
                "version" : "v0.9.0",
                "url": "https://github.com/maxmind/web-service-common-php/archive/v0.9.0.zip"
        },
            "maxmind/MaxMind-DB-Reader-php": {
                "version" : "v1.11.0",
                "url": "https://github.com/maxmind/MaxMind-DB-Reader-php/archive/v1.11.0.zip"
        },
            "maxmind/GeoIP2-php": {
                "version" : "v2.13.0",
                "url": "https://github.com/maxmind/GeoIP2-php/archive/v2.13.0.zip
    
            }
        }
    }
    
  • πŸ‡­πŸ‡·Croatia devad

    Yes, you have the URLs right. The library names should be kept the same as composer's.

    This ludwig.json file should work.

    {
        "require": {
            "composer/ca-bundle": {
                "version": "1.3.7",
                "url": "https://github.com/composer/ca-bundle/archive/1.3.7.zip"
        },
            "maxmind/web-service-common-php": {
                "version" : "v0.9.0",
                "url": "https://github.com/maxmind/web-service-common-php/archive/v0.9.0.zip"
        },
            "maxmind-db/reader": {
                "version" : "v1.11.0",
                "url": "https://github.com/maxmind/MaxMind-DB-Reader-php/archive/v1.11.0.zip"
        },
            "geoip2/geoip2": {
                "version" : "v2.13.0",
                "url": "https://github.com/maxmind/GeoIP2-php/archive/v2.13.0.zip"
    
            }
        }
    }
    
    
  • πŸ‡ΊπŸ‡ΈUnited States bluegeek9

    The IP address appears as an integer because the ip address format has changed. You need to convert the data. You can use Drush, or the form, admin/config/system/visitors/rebuild-ip-address

    https://8-x-2-16-vdqqys14ud2xzuff8fhka1b63lwsnptt.tugboatqa.com/admin/co...

    ip2long only support IPv4. Visitors supports IPv6 and IPv4.

  • πŸ‡­πŸ‡·Croatia devad

    I thing I need to tackle the composer hurdle. I've been doing the old way for so long that I'm a little intimidated by setting it up.

    https://www.drupal.org/docs/contributed-modules/ludwig/migration-from-ludwig-to-composer-instructions β†’

    I really like the Ludwig idea, but I think they want to discontinue it.

    Ludwig will be around until a new similar official UI tool is completed. πŸ’¬ Retire Ludwig? Postponed

  • πŸ‡ΊπŸ‡ΈUnited States corE

    Thank you @bluegeek9 and @devad !

    I tried the /rebuild-ip-address link (which I did not see or know about in the visitors UI). It gave a message that some item updates have been processed, but it returned it on the same page asking "Do you want to rebuild the IP Address?" with the Confirm button. I pressed it multiple times and it returned to this confirm page with the items processed message each time, so I can only hope that it worked correctly. I didn't see any changes on the host page ip address presentation (the odd number are still there) and am wondering it this flush acts immediately, or it if will act on new hits only?

    ...and @devad, I can report that your ludwig.json rewrite "work nicely" as you have outlined! Thank you very much for your help on this as well as the encouragement with composer, and the ludwig future development info. When I get the time I will try to figure out composer.

    In appreciation!

  • πŸ‡ΊπŸ‡ΈUnited States corE

    Hum... perhaps things didn't go so well. I just checked today and the visitors entries stopped on the 17th. I checked my notes and that is the day I went from 8.x-2.12 to 8.x-2.16. It looks like I can't get past 8.x-2.12 for some reason. My 8.x-2.12 install was pre Ludwig operation πŸ’¬ Visitors - Ludwig integration Active mention above. My 8.x-2.12 was acting normally with the exception of the odd numbers in hosts. The Ludwig procedure and /rebuild-ip-address πŸ’¬ Visitors - Ludwig integration Active procedure were performed on 8.x-2.16, so perhaps I'll try rolling back to 8.x-2.12 and giving these procedures a go again on that version and see what happens. Weird! [scratching my head]

  • πŸ‡ΊπŸ‡ΈUnited States bluegeek9
  • Status changed to Closed: won't fix 5 months ago
  • πŸ‡ΊπŸ‡ΈUnited States bluegeek9
Production build 0.71.5 2024