Anope IRC Services

Please login or register.

Login with username, password and session length
Advanced search  

News:

Pages: [1]   Go Down

Author Topic: Anope always clean Mysql DB  (Read 8377 times)

0 Members and 1 Guest are viewing this topic.

Max13

  • Anope User
  • Offline Offline
  • Posts: 11
    • www.virtual-info.wb.st
Anope always clean Mysql DB
« on: May 03, 2008, 06:08:08 PM »

Hi,

I'm administrator of a new IRC server.
I wanted anope to use a databse, like that i would be able to use communication beatween my website and my server. When i switched from db file to Mysql db, anope was running, delete the files, config anope with "UseRDB" option, then /os update.
Everything OK, but it was on localhost and on a Windows XP system.
Now, I've sent my files on a private shell, anope with "UseRDB" option, restore DB, but when I start anope, it always clean my database and create db files...
How can i ask anope to start reading DB instead of cleaning it and creating .db files ?

Thanks for help !

[Sorry for my language, i'm french...]
Logged
With XP, we were near a biiig hole,
Now with Vista, we can make a biiig step ahead...

katsklaw

  • Guest
(No subject)
« Reply #1 on: May 03, 2008, 06:31:14 PM »

stop using UseRDB. UseRDB loads from sql and dumps it's data to the .db files.

You can not run Anope right off of sql only. Anope only dumps data to sql in a write only mode and does not read/write. Once you have loaded your data into the .db files you need to turn UseRDB off again so Anope will not clear the .db files.
Logged

Max13

  • Anope User
  • Offline Offline
  • Posts: 11
    • www.virtual-info.wb.st
(No subject)
« Reply #2 on: May 03, 2008, 08:44:28 PM »

Okay...

The problem is... I only have the mysql database =S
How can i do to convert the SQL's files ? T_T   ;(

And, can you explain me more precisely the directive "UseRDB" please ?

Thanks !
Logged
With XP, we were near a biiig hole,
Now with Vista, we can make a biiig step ahead...

Jobe

  • Contributor
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 1023
    • Anope IRC Services
(No subject)
« Reply #3 on: May 04, 2008, 01:31:07 PM »

Firstly, no matter what you do or say, Anope ALWAYS writes to the .db files regardless of whether you use UseRDB or not.

Secondly, UseRDB makes Anope read from the MySQL at start-up instead of the *.db files.
Logged
Your IP: ()
My IRC Status:

Come along and visit http://www.anopequotes.org/

Max13

  • Anope User
  • Offline Offline
  • Posts: 11
    • www.virtual-info.wb.st
(No subject)
« Reply #4 on: May 08, 2008, 11:33:08 PM »

Thank you for your help... I'll try it soon...
Logged
With XP, we were near a biiig hole,
Now with Vista, we can make a biiig step ahead...

Max13

  • Anope User
  • Offline Offline
  • Posts: 11
    • www.virtual-info.wb.st
(No subject)
« Reply #5 on: May 09, 2008, 05:44:39 PM »

There is what I get when I do ./services -debug -nofork:


Quote

[...]
[May 09 18:45:48.821799 2008] debug: MySQL: UPDATE anope_bs_core SET active = 0
[May 09 18:45:48.822139 2008] debug: MySQL: DELETE FROM anope_bs_core WHERE active = 0
[May 09 18:45:48.822616 2008] debug: MySQL: UPDATE anope_hs_core SET active = 0
[May 09 18:45:48.822886 2008] debug: MySQL: DELETE FROM anope_hs_core WHERE active = 0
[May 09 18:45:48.823262 2008] debug: MySQL: UPDATE anope_os_akills SET active = 0
[May 09 18:45:48.823444 2008] debug: MySQL: UPDATE anope_os_sglines SET active = 0
[May 09 18:45:48.823627 2008] debug: MySQL: UPDATE anope_os_sqlines SET active = 0
[May 09 18:45:48.823807 2008] debug: MySQL: UPDATE anope_os_szlines SET active = 0

[...]

[May 09 18:45:48.830447 2008] debug: MySQL: DELETE FROM anope_os_akills WHERE active = 0
[May 09 18:45:48.830660 2008] debug: MySQL: DELETE FROM anope_os_sglines WHERE active = 0
[May 09 18:45:48.830855 2008] debug: MySQL: DELETE FROM anope_os_sqlines WHERE active = 0
[May 09 18:45:48.831051 2008] debug: MySQL: DELETE FROM anope_os_szlines WHERE active = 0


Before i lunched it, no 'active' field had the value 0, so Anope set it to 0 then delete every table with the active's value 0...

Any solution ?
Logged
With XP, we were near a biiig hole,
Now with Vista, we can make a biiig step ahead...

Max13

  • Anope User
  • Offline Offline
  • Posts: 11
    • www.virtual-info.wb.st
(No subject)
« Reply #6 on: May 09, 2008, 05:47:36 PM »

Here there is my debug output:


Quote

[...]

[May 09 18:45:48.821799 2008] debug: MySQL: UPDATE anope_bs_core SET active = 0
[May 09 18:45:48.822139 2008] debug: MySQL: DELETE FROM anope_bs_core WHERE active = 0
[May 09 18:45:48.822616 2008] debug: MySQL: UPDATE anope_hs_core SET active = 0
[May 09 18:45:48.822886 2008] debug: MySQL: DELETE FROM anope_hs_core WHERE active = 0
[May 09 18:45:48.823262 2008] debug: MySQL: UPDATE anope_os_akills SET active = 0
[May 09 18:45:48.823444 2008] debug: MySQL: UPDATE anope_os_sglines SET active = 0
[May 09 18:45:48.823627 2008] debug: MySQL: UPDATE anope_os_sqlines SET active = 0
[May 09 18:45:48.823807 2008] debug: MySQL: UPDATE anope_os_szlines SET active = 0

[...]

[May 09 18:45:48.830447 2008] debug: MySQL: DELETE FROM anope_os_akills WHERE active = 0
[May 09 18:45:48.830660 2008] debug: MySQL: DELETE FROM anope_os_sglines WHERE active = 0
[May 09 18:45:48.830855 2008] debug: MySQL: DELETE FROM anope_os_sqlines WHERE active = 0
[May 09 18:45:48.831051 2008] debug: MySQL: DELETE FROM anope_os_szlines WHERE active = 0
[May 09 18:45:48.831280 2008] debug: MySQL: UPDATE anope_os_news SET active = 0
[May 09 18:45:48.831468 2008] debug: MySQL: DELETE FROM anope_os_news WHERE active = 0
[May 09 18:45:48.831694 2008] debug: MySQL: UPDATE anope_os_exceptions SET active = 0
[May 09 18:45:48.831878 2008] debug: MySQL: DELETE FROM anope_os_exceptions WHERE active
= 0

[...]


We can see that anope is setting my active fields on 0, then delete all table with the active field on 0...
Before it, there is no field with the value 0...

Any Solution ?
Logged
With XP, we were near a biiig hole,
Now with Vista, we can make a biiig step ahead...

katsklaw

  • Guest
(No subject)
« Reply #7 on: May 09, 2008, 09:09:52 PM »

There is no solution because there is no problem. That is intended behavior. Anope's sql code is not the best and is NOT intended be used externally at this time.
Logged

Max13

  • Anope User
  • Offline Offline
  • Posts: 11
    • www.virtual-info.wb.st
(No subject)
« Reply #8 on: May 10, 2008, 02:02:11 AM »

Okay...

Is there a solution to convert MySQL DB to *.db files ?
I don't have my Backups anymore...
Logged
With XP, we were near a biiig hole,
Now with Vista, we can make a biiig step ahead...

katsklaw

  • Guest
(No subject)
« Reply #9 on: May 10, 2008, 02:31:39 AM »

as explained earlier .. use UseRDB to load from sql .. once you have done that and Anope has done an update, un-comment UseRDB
Logged

Max13

  • Anope User
  • Offline Offline
  • Posts: 11
    • www.virtual-info.wb.st
(No subject)
« Reply #10 on: May 10, 2008, 08:27:00 AM »

I told you before that I used UseRDB with no *.db files, and with -debug -nofork...

I didn't try to un-comment it, because I wrote the output a few messages before, and we can see that Anope set my table to active = 0, then delete all table with active = 0, so all my tables are beeing deleted...

Exemple in 2 lines:

[May 09 18:45:48.831280 2008] debug: MySQL: UPDATE anope_os_news SET active = 0
[May 09 18:45:48.831468 2008] debug: MySQL: DELETE FROM anope_os_news WHERE active = 0

As you can see...

Thanks for your help
Logged
With XP, we were near a biiig hole,
Now with Vista, we can make a biiig step ahead...

katsklaw

  • Guest
(No subject)
« Reply #11 on: May 10, 2008, 11:07:05 AM »

You are totally missing the point of UseRDB.

If you have NO .db files and ONLY have sql. .. Use UseRDB to load the data FROM sql INTO the .db files and issue an /os update. /os update dumps the data INTO the .db files ... once that's done YOU WILL HAVE DATA IN THE .DB FILES!!! Anope CAN NOT run without the .db files!!! Once you hae updated, DELETE UseRDB!!

I KNOW THE SQL CODE DELETES THE DATA ... THAT IS INTENTIONAL .. ANOPE'S SQL TABLES ARE TO BE USED ONLY BY ANOPE. PLEASE STOP TRYING TO USE THEM FOR OTHER THINGS!!!

This appears as a problem that needs a solution because YOU are expecting Anope to work differently than it actually does, the only "problem" is your expectations.

[Edited on 10-5-2008 by katsklaw]
Logged

Max13

  • Anope User
  • Offline Offline
  • Posts: 11
    • www.virtual-info.wb.st
(No subject)
« Reply #12 on: May 10, 2008, 11:41:39 AM »

Sorry but...

Even if I'm expecting something else, I'm doing everything you tell me...

I have no .db files... And I've started Anope with UseRDB...
It creates the .db files, send global "we're back", then:

I did "/os update",
it answers me "Don't have permission",
I did "/ns register pass po@po.po",
it anserws "your pass is pass",
I did "/os update",
It answers "Backup in progress" or something like,
I did "/os shutdown",
It answers "Updating databases on shutdown",
I comment "UseRDB",
I restart Anope, and nick.db files has only the nick i've registered before...
And all the other files are clean.

Now I explain you precisely what I did and what I get... If there is an error from me, I apologize, but please tell me where.
Thank you
Logged
With XP, we were near a biiig hole,
Now with Vista, we can make a biiig step ahead...

Jan Milants

  • Team
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 1372
(No subject)
« Reply #13 on: May 10, 2008, 12:22:58 PM »

i don't know how old you databases are, but maybe anope loads everything from the sql only to expire all nicks and channels (default after 3 weeks of not being used). after starting anope with userdb use an /ns list and /cs list to check the nicks and channels are actually there...

[Edited on 10-5-2008 by Viper]
Logged
If you like me donate coins to 1FBmZVT4J8WAUMHKqpWhgNVj3XXnRN1cCk :)

Max13

  • Anope User
  • Offline Offline
  • Posts: 11
    • www.virtual-info.wb.st
(No subject)
« Reply #14 on: May 10, 2008, 12:40:05 PM »

Quote
Message original :  Viper
i don't know how old you databases are, but maybe anope loads everything from the sql only to expire all nicks and channels (default after 3 weeks of not being used). after starting anope with userdb use an /ns list and /cs list to check the nicks and channels are actually there...

[Edited on 10-5-2008 by Viper]


Uh... I set it on 2 months, and my db are 3 weeks old...
I've already done /ns list * or /cs list *
Nothing... 0/0

=/
Logged
With XP, we were near a biiig hole,
Now with Vista, we can make a biiig step ahead...

Jan Milants

  • Team
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 1372
(No subject)
« Reply #15 on: May 10, 2008, 03:03:32 PM »

then your .db's won't even be filled.
make sure userdb is not defined, that there is actually any data in the sql database and run anope in debug to make sure it READS from sql on startup.
Logged
If you like me donate coins to 1FBmZVT4J8WAUMHKqpWhgNVj3XXnRN1cCk :)

Max13

  • Anope User
  • Offline Offline
  • Posts: 11
    • www.virtual-info.wb.st
(No subject)
« Reply #16 on: May 10, 2008, 05:04:08 PM »

...

It's terrible... I don't know what was the solution, but, I've modified network name and server name, then reconfigure the .conf files, .db encryption and comment mysql encryption... Now everything is Ok ^^

But I have another problem... I put "enc_none" for .db encryption, and when I ask for my password with "/ns getpass", it answers me a hash... Like md5 hash... So I tried every .db encryption, after reading MySQL, my password isn't the same I've put the first time...

PS: For my first problem, if there is a confusion between .db and mysql encryption, if anope can't convert it, it will erase all data thinking it's not it's data... I think my problem was this...

Thank you for your help Viper and Katsklaw.
Logged
With XP, we were near a biiig hole,
Now with Vista, we can make a biiig step ahead...

Jan Milants

  • Team
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 1372
(No subject)
« Reply #17 on: May 10, 2008, 11:10:51 PM »

you have to use the same enc type you used when you dumped the data to sql. anope cannot convert from one type to another without use of a module.
Logged
If you like me donate coins to 1FBmZVT4J8WAUMHKqpWhgNVj3XXnRN1cCk :)

Max13

  • Anope User
  • Offline Offline
  • Posts: 11
    • www.virtual-info.wb.st
(No subject)
« Reply #18 on: May 10, 2008, 11:58:51 PM »

Can you give me the name of this module ?
Logged
With XP, we were near a biiig hole,
Now with Vista, we can make a biiig step ahead...
Pages: [1]   Go Up