collapse collapse
* User Info
 
 
Welcome, Guest. Please login or register.
* Search

* Board Stats
  • stats Total Members: 989
  • stats Total Posts: 18365
  • stats Total Topics: 2500
  • stats Total Categories: 7
  • stats Total Boards: 35
  • stats Most Online: 1144

Author Topic: Persistent Whois cache with out-of-bot upgrading  (Read 76650 times)

0 Members and 6 Guests are viewing this topic.

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: Persistent Whois cache with out-of-bot upgrading
« Reply #165 on: March 31, 2007, 11:13:02 am »
I believe you are right, thanks.

Updated :)

Offline PosManic

  • BeBot Rookie
  • *
  • Posts: 2
  • Karma: +0/-0
Re: Persistent Whois cache with out-of-bot upgrading
« Reply #166 on: April 11, 2007, 01:19:56 am »
I'm pretty new to Be-Bot have been fine till this module upgrade :/ I get:

PHP Fatal error:  Cannot redeclare class WhoisCache in C:\Documents and Settings\Jeremy\My Documents\BeBot_v0.2.11\modules\WhoisCache.php on line 71

when i run bot now:( Any suggestions or help?

Offline Blueeagle

  • Omnipotent
  • BeBot Hero
  • ******
  • Posts: 323
  • Karma: +0/-0
Re: Persistent Whois cache with out-of-bot upgrading
« Reply #167 on: April 11, 2007, 01:45:25 am »
The "Cannot redeclare class" error message occures when you attempt to declare a class twice. This is ofcourse not allowed.

The cause of this is in this case that you've got two modules that attempt to declare the class "WhoisCache".

The solution to this is to rename the old module that handled it to have an underscore (_) in front of it so that bebot doesn't attempt to load it.

If you put the new class in the custom directory you need to rename the one in the modules (or core if that's where it resides) directory.

Hope that helps.
The only problem that can't be solved by adding another wrapper is having too many wrappers.

Offline porter

  • BeBot User
  • **
  • Posts: 28
  • Karma: +0/-0
Re: Persistent Whois cache with out-of-bot upgrading
« Reply #168 on: April 11, 2007, 07:38:49 pm »
I'm pretty new to Be-Bot have been fine till this module upgrade :/ I get:

PHP Fatal error:  Cannot redeclare class WhoisCache in C:\Documents and Settings\Jeremy\My Documents\BeBot_v0.2.11\modules\WhoisCache.php on line 71

when i run bot now:( Any suggestions or help?

Variation of the above suggestion: If you edited the code in the modules directory (i.e. not before moving it there) your text editor may have saved a backup with some appendix to the name and therefore the bot tries to load it twice.

Offline Blueeagle

  • Omnipotent
  • BeBot Hero
  • ******
  • Posts: 323
  • Karma: +0/-0
Re: Persistent Whois cache with out-of-bot upgrading
« Reply #169 on: April 12, 2007, 06:28:49 am »
Variation of the above suggestion: If you edited the code in the modules directory (i.e. not before moving it there) your text editor may have saved a backup with some appendix to the name and therefore the bot tries to load it twice.

If the module doesn't end with exactly .php it should not be attempted loaded. Most *nix editors saves files as .php~ and they are not loaded, however if you manually saved it as .bak.php (ie. instead of .php.bak which would be "the right way(tm)) it will still attempt to load it and re-declear the class.

The only problem that can't be solved by adding another wrapper is having too many wrappers.

Offline porter

  • BeBot User
  • **
  • Posts: 28
  • Karma: +0/-0
Re: Persistent Whois cache with out-of-bot upgrading
« Reply #170 on: April 12, 2007, 06:42:29 pm »
If the module doesn't end with exactly .php it should not be attempted loaded. Most *nix editors saves files as .php~ and they are not loaded

Oh good, I thought it was only looking at whether the first character in the filename was an underscore or not. Should have checked it first but I'd just discovered a backup file of the ~ kind there the other day and thought removing that file was what fixed my bot but in retrospect I am sure I did something else at the same time.

Offline Nanoflux

  • BeBot Rookie
  • *
  • Posts: 8
  • Karma: +0/-0
Re: Persistent Whois cache with out-of-bot upgrading
« Reply #171 on: May 29, 2007, 12:08:08 pm »
The last time i put this in my linux cronjob it crashed the server every time it executed (from the 3rd time onwards)

Any idea how to prevent this? i'd rather it didnt crash  ::)

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: Persistent Whois cache with out-of-bot upgrading
« Reply #172 on: May 29, 2007, 01:31:04 pm »
Uhm it shouldn't crash any system. I'm running the script daily since more then one year, and it never crashed my server.

You could try to increase the delay between http queries from 100 to 1000 milliseconds, maybe your server can't handle any heavy mysql load.

Offline Nanoflux

  • BeBot Rookie
  • *
  • Posts: 8
  • Karma: +0/-0
Re: Persistent Whois cache with out-of-bot upgrading
« Reply #173 on: May 29, 2007, 01:39:08 pm »
I'll try again then on the more powerful server

Offline tonyuh

  • BeBot User
  • **
  • Posts: 48
  • Karma: +0/-0
Re: Persistent Whois cache with out-of-bot upgrading
« Reply #174 on: May 29, 2007, 04:50:23 pm »
The only error i get (some time, not all the time) is fsocketopen or something like that, usually twice per run. Still can't reproduce it on the spot so can't really tell you much info about it. And that doesn't crash anything.. just doesn't update the database :P

Tony

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: Persistent Whois cache with out-of-bot upgrading
« Reply #175 on: May 29, 2007, 05:27:30 pm »
Quote
Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /home/aobots/scripts/whois-update.php on line 18

Warning: fsockopen(): unable to connect to www.anarchy-online.com:80 in /home/aobots/scripts/whois-update.php on line 18
I guess that's the errors you talk about tonyuh. It's some problem to get the name resolved and connect afterwards. Can happen I guess, and unless you get many of them quite harmless. There is a safety before any entries are deleted as state.

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: Persistent Whois cache with out-of-bot upgrading
« Reply #176 on: July 31, 2007, 06:24:04 pm »
Modified the update script and it's config file, per default it now only pulls the org rosters of the FC server to avoid too high load. And it doesn't delete outdated entries at all anymore.

If you want the old behaviour back you'll have to change the new config options.

EDIT: This version works with the 0.4 cache too if you don't want to grab the SVN version.
« Last Edit: July 31, 2007, 06:27:01 pm by Alreadythere »

 

* Recent Posts
0.8.x updates for AO by bitnykk
[June 23, 2024, 03:19:47 pm ]


0.8.x updates for AoC by bitnykk
[June 23, 2024, 03:19:44 pm ]


[AoC] special char for items module by bitnykk
[February 09, 2024, 09:41:18 pm ]


BeBot still alive & kicking ! by bitnykk
[December 17, 2023, 12:58:44 am ]


Bebot and Rasberry by bitnykk
[November 29, 2023, 11:04:14 pm ]

* Who's Online
  • Dot Guests: 305
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.
* Forum Staff
bitnykk admin bitnykk
Administrator
Khalem admin Khalem
Administrator
WeZoN gmod WeZoN
Global Moderator
SimplePortal 2.3.7 © 2008-2024, SimplePortal