Page 1 of 1

Backup_Scripts_Errors

PostPosted: Sun Apr 01, 2012 9:32 am
by ruben23
Multi_server(1DB/web_Server and 1 Asterisk/vici
VERSION: 2.4-361a
BUILD: 120221-1647
© 2012 ViciDial Group
Asterisk 1.4
Dhadi_current
Scratch_Install


Hi guys i have issue on backing up database using the ADMIN_backup.pl, which i have 1 Database/Web Server and 1 Asterisk server.

I run the script on teh Asterisk server nad getting this error log

Code: Select all
/usr/share/astguiclient# /usr/share/astguiclient/ADMIN_backup.pl --db-without-logs --debugX

----- DEBUG -----


----- SUPER DEBUG -----


----- Backup Database Without Logs -----

/usr/bin/mysqldump --user=cron --password=1234 --lock-tables --flush-logs asterisk  callcard_accounts callcard_accounts_details conferences groups_alias inbound_numbers live_channels live_inbound live_sip_channels menu parked_channels phone_favorites phones phones_alias server_updater servers system_settings vicidial_agent_sph vicidial_auto_calls vicidial_call_menu vicidial_call_menu_options vicidial_call_notes vicidial_call_notes_archive vicidial_call_times vicidial_callbacks vicidial_campaign_agents vicidial_campaign_dnc vicidial_campaign_hotkeys vicidial_campaign_server_stats vicidial_campaign_stats vicidial_campaign_statuses vicidial_campaigns vicidial_campaigns_list_mix vicidial_conf_templates vicidial_conferences vicidial_custom_cid vicidial_dnc vicidial_drop_rate_groups vicidial_extension_groups vicidial_filter_phone_groups vicidial_filter_phone_numbers vicidial_inbound_dids vicidial_inbound_group_agents vicidial_inbound_groups vicidial_lead_filters vicidial_lead_recycle vicidial_list vicidial_list_alt_phones vicidial_list_pins vicidial_lists vicidial_lists_fields vicidial_live_agents vicidial_live_inbound_agents vicidial_manual_dial_queue vicidial_music_on_hold vicidial_music_on_hold_files vicidial_nanpa_prefix_codes vicidial_override_ids vicidial_pause_codes vicidial_phone_codes vicidial_postal_codes vicidial_process_triggers vicidial_qc_codes vicidial_remote_agents vicidial_scripts vicidial_server_carriers vicidial_server_trunks vicidial_shifts vicidial_state_call_times vicidial_stations vicidial_status_categories vicidial_statuses vicidial_territories vicidial_timeclock_status vicidial_tts_prompts vicidial_user_groups vicidial_user_territories vicidial_users vicidial_voicemail vicidial_xfer_presets vicidial_xfer_stats vtiger_rank_data vtiger_rank_parameters vtiger_vicidial_roles | /bin/gzip > /var/log/astguiclient/archive/temp/172.16.0.17asterisk0.gz
/usr/bin/mysqldump --user=cron --password=1234 --lock-tables --flush-logs --no-data --no-create-db asterisk  call_log call_log_archive callcard_log live_inbound_log park_log recording_log server_performance twoday_call_log twoday_recording_log twoday_vicidial_agent_log twoday_vicidial_closer_log twoday_vicidial_log twoday_vicidial_xfer_log user_call_log vicidial_admin_log vicidial_agent_log vicidial_agent_log_archive vicidial_api_log vicidial_carrier_log vicidial_carrier_log_archive vicidial_closer_log vicidial_cpd_log vicidial_did_log vicidial_grab_call_log vicidial_hopper vicidial_ivr vicidial_lead_search_log vicidial_lead_search_log_archive vicidial_list_update_log vicidial_log vicidial_log_archive vicidial_log_extended vicidial_manager vicidial_process_trigger_log vicidial_remote_agent_log vicidial_timeclock_audit_log vicidial_timeclock_log vicidial_user_closer_log vicidial_user_log vicidial_user_territory_log vicidial_xfer_log web_client_sessions | /bin/gzip > /var/log/astguiclient/archive/temp/LOGS_172.16.0.17asterisk0.gzmysqldump: Got error: 1045: Access denied for user 'cron'@'localhost' (using password: YES) when trying to connect
mysqldump: Got error: 1045: Access denied for user 'cron'@'localhost' (using password: YES) when trying to connect
/bin/tar cf /var/log/astguiclient/archive/temp/172.16.0.17_CONF_0.tar /etc/astguiclient.conf  /etc/dahdi /etc/asterisk
/bin/tar: Removing leading `/' from member names
/bin/tar cf /var/log/astguiclient/archive/temp/172.16.0.17_LINUX_0.tar /etc/crontab_snapshot /etc/hosts /etc/resolv.conf
/bin/tar: Removing leading `/' from member names
/bin/tar cf /var/log/astguiclient/archive/temp/172.16.0.17_WEB_0.tar /var/www
/bin/tar: Removing leading `/' from member names
/bin/tar cf /var/log/astguiclient/archive/temp/172.16.0.17_BIN_0.tar /var/lib/asterisk/agi-bin /usr/share/astguiclient
/bin/tar: Removing leading `/' from member names
/bin/tar cf /var/log/astguiclient/archive/temp/172.16.0.17_SOUNDS_0.tar /var/lib/asterisk/sounds
/bin/tar: Removing leading `/' from member names
/bin/tar cf /var/log/astguiclient/archive/temp/172.16.0.17_VOICEMAIL_0.tar /var/spool/asterisk/voicemail
/bin/tar: Removing leading `/' from member names
/bin/tar cf /var/log/astguiclient/archive/172.16.0.17_ALL_0.tar /var/log/astguiclient/archive/temp
/bin/tar: Removing leading `/' from member names
rm -f /var/log/astguiclient/archive/172.16.0.17_ALL_0.tar.gz
/bin/gzip -9 /var/log/astguiclient/archive/172.16.0.17_ALL_0.tar
rm -fR /var/log/astguiclient/archive/temp
DONE, Exiting...


But im a bit confuse coz i can already access teh Database server from my asterisk using remote mysql client from user cron and root:

mysql -h (Dblocalipaddress) -u cron -p (successfull login to mysql_server) ----> I run this on Asterisk/vici accessing teh Separate Databased Server

Any idea guys..? Thanks

PostPosted: Sun Apr 01, 2012 9:56 am
by ruben23
Also im seeing here it mention on the process localhost, should it be reading my astguiclient.conf..?

Code: Select all
error: 1045: Access denied for user 'cron'@'localhost' (using password: YES) when trying to connect


But my astguiclient.conf is:



Code: Select all
# Database connection information
VARDB_server => 172.16.0.18
VARDB_database => asterisk
VARDB_user => cron
VARDB_pass => 1234
VARDB_custom_user => custom
VARDB_custom_pass => custom1234
VARDB_port => 3306

VARserver_ip => 172.16.0.17


Any idea on this

PostPosted: Mon Apr 02, 2012 3:28 am
by DomeDan
maybe permissions for the database, take a look at it by login to mysql as root and check the mysql.db-table:
Code: Select all
mysql> select * from mysql.db where user = 'cron';

or login as root in phpmyadmin and click on privileges.

You said that you could login remotely, can you login on the local machine?
if not then i guess you got a row in mysql.db-table that says "localhost","cron" that does not have the same permissions as "%","cron" (% is any host)

PostPosted: Mon Apr 02, 2012 3:33 am
by ruben23
@DomeDan Thanks for reply,

The remotely mean locally on teh asterisk/vici server;

Code: Select all
mysql> select * from mysql.db where user = 'cron';
+-----------+----------+------+-------------+-------------+-------------+-------------+-------------+-----------+------------+-----                                            ------------+------------+------------+-----------------------+------------------+------------------+----------------+-------------                                            --------+--------------------+--------------+------------+--------------+
| Host      | Db       | User | Select_priv | Insert_priv | Update_priv | Delete_priv | Create_priv | Drop_priv | Grant_priv | Refe                                            rences_priv | Index_priv | Alter_priv | Create_tmp_table_priv | Lock_tables_priv | Create_view_priv | Show_view_priv | Create_routi                                            ne_priv | Alter_routine_priv | Execute_priv | Event_priv | Trigger_priv |
+-----------+----------+------+-------------+-------------+-------------+-------------+-------------+-----------+------------+-----                                            ------------+------------+------------+-----------------------+------------------+------------------+----------------+-------------                                            --------+--------------------+--------------+------------+--------------+
| %         | asterisk | cron | Y           | Y           | Y           | Y           | N           | N         | N          | N                                                           | N          | N          | N                     | Y                | N                | N              | N                                                               | N                  | N            | N          | N            |
| localhost | asterisk | cron | Y           | Y           | Y           | Y           | N           | N         | N          | N                                                           | N          | N          | N                     | Y                | N                | N              | N                                                               | N                  | N            | N          | N            |
+-----------+----------+------+-------------+-------------+-------------+-------------+-------------+-----------+------------+-----                                            ------------+------------+------------+-----------------------+------------------+------------------+----------------+-------------                                            --------+--------------------+--------------+------------+--------------+
2 rows in set (0.01 sec)


hope this helps.

PostPosted: Mon Apr 02, 2012 3:46 am
by DomeDan
looks ok.
and if you check the user-table
select * from mysql.user where user = 'cron';

maybe the password-hash for localhost is different from %
dont post the password-hash.

If they differ then you need to set the password manually for localhost, or remove it and only keep %

PostPosted: Mon Apr 02, 2012 3:56 am
by ruben23
@DomeDan

i tried the select * from mysql.user where user = 'cron';

and the password hash are all the same; i see 3 host:
%
localhost
192.168.1.4

PostPosted: Mon Apr 02, 2012 4:06 am
by DomeDan
and the different permissions are the same?

I know I've been struggling with this kind of problem once, but in my case I think it was the password...
Well in the end I removed localhost and only kept %, I did it in phpmyadmin.
I'm not in need for different permissions for different hosts.
If your gonna try it, remember to do "flush privileges;" when your done to make the changes go live.

PostPosted: Mon Apr 02, 2012 4:13 am
by ruben23
see this:

Code: Select all
Database changed
mysql> select * from mysql.user where user = 'cron';
+-------------+------+-------------------------------------------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+--------------+------------+-----------------------+------------------+--------------+-----------------+------------------+------------------+----------------+---------------------+--------------------+------------------+------------+--------------+----------+------------+-------------+--------------+---------------+-------------+-----------------+----------------------+
| Host        | User | Password                                  | Select_priv | Insert_priv | Update_priv | Delete_priv | Create_priv | Drop_priv | Reload_priv | Shutdown_priv | Process_priv | File_priv | Grant_priv | References_priv | Index_priv | Alter_priv | Show_db_priv | Super_priv | Create_tmp_table_priv | Lock_tables_priv | Execute_priv | Repl_slave_priv | Repl_client_priv | Create_view_priv | Show_view_priv | Create_routine_priv | Alter_routine_priv | Create_user_priv | Event_priv | Trigger_priv | ssl_type | ssl_cipher | x509_issuer | x509_subject | max_questions | max_updates | max_connections | max_user_connections |
+-------------+------+-------------------------------------------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+--------------+------------+-----------------------+------------------+--------------+-----------------+------------------+------------------+----------------+---------------------+--------------------+------------------+------------+--------------+----------+------------+-------------+--------------+---------------+-------------+-----------------+----------------------+
| %           | cron | *xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx | N           | N           | N           | N           | N           | N         | Y           | N             | N            | N         | N          | N               | N          | N          | N            | N          | N                     | N                | N            | N               | N                | N                | N              | N                   | N                  | N                | N          | N            |          |            |             |              |             0 |           0 |               0 |                    0 |
| localhost   | cron | *xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx | N           | N           | N           | N           | N           | N         | Y           | N             | N            | N         | N          | N               | N          | N          | N            | N          | N                     | N                | N            | N               | N                | N                | N              | N                   | N                  | N                | N          | N            |          |            |             |              |             0 |           0 |               0 |                    0 |
| 192.168.1.4 | cron | *xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx | Y           | Y           | Y           | Y           | Y           | Y         | Y           | Y             | Y            | Y         | N          | Y               | Y          | Y          | Y            | Y          | Y                     | Y                | Y            | Y               | Y                | Y                | Y              | Y                   | Y                  | Y                | Y          | Y            |          |            |             |              |             0 |           0 |               0 |                    0 |
+-------------+------+-------------------------------------------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+--------------+------------+-----------------------+------------------+--------------+-----------------+------------------+------------------+----------------+---------------------+--------------------+------------------+------------+--------------+----------+------------+-------------+--------------+---------------+-------------+-----------------+----------------------+
3 rows in set (0.00 sec)



can you relay me teh procedure how to do it on my Phpmyadmin..? would it not create any issue on Database if its being remove..?

PostPosted: Mon Apr 02, 2012 4:28 am
by DomeDan
I dont think so, as long as there is a host that fits the host your connecting from.

192.168.1.4 got full privileges. I dont think it should look like that. but of what i can see it should work anyway.

I dont remember if phpmyadmin is installed by default, but if it is then simply: http://your_ip_to_vicidial/phpMyAdmin and login as root and take a look under privileges

PostPosted: Tue Apr 03, 2012 7:45 pm
by ruben23
Hi guys is this a Bug of the new VICidial trunk..?

PostPosted: Wed Apr 04, 2012 12:42 am
by DomeDan
Did you find the problem?