DB Optimization Cron Job Permission Problems After Upgrade

Support for IntegraMOD 141

Moderator: Integra Moderator

DB Optimization Cron Job Permission Problems After Upgrade

PostAuthor: jast » Mon Nov 26, 2007 12:46 pm

Your phpBB Version: 2.0.22
phpBB Type: phpBB / IMPortal
MODs: No
Your knowledge: Basic Knowledge
Board URL: http://homeworld.homelinux.com/portal/

PHP Version:
MySQL Version:


What was done before the problem appeared?
I upgraded from the 141 release to 141d.


What was done to try to solve the problem?
Checked file ownership.



De.scription and Message

I had an operational site running IM141 and then applied the 141d update to get all of the CTracker fixes at once. After copying all of the files over my old site, I now get the following error whenever the DB Optimization cron job runs. It appears that the cron job is now trying to run with the permissions of the web server instead of the permissions of the portal database.

Code: Select all
 Warning]: Access denied for user 'www-data'@'localhost' (using password: NO) in /var/www/portal/includes/optimize_database_cron.php on line 65  Warning: mysql_list_tables() [function.mysql-list-tables]: A link to the server could not be established in /var/www/portal/includes/optimize_database_cron.php on line 65  Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in /var/www/portal/db/mysqli.php on line 354  Warning: Cannot modify header information - headers already sent by (output started at /var/www/portal/includes/optimize_database_cron.php:65) in /var/www/portal/includes/sessions.php on line 421  Warning: Cannot modify header information - headers already sent by (output started at /var/www/portal/includes/optimize_database_cron.php:65) in /var/www/portal/includes/sessions.php on line 422  Warning: Cannot modify header information - headers already sent by (output started at /var/www/portal/includes/optimize_database_cron.php:65) in /var/www/portal/includes/page_header.php on line 1156  Warning: Cannot modify header information - headers already sent by (output started at /var/www/portal/includes/optimize_database_cron.php:65) in /var/www/portal/includes/page_header.php on line 1158  Warning: Cannot modify header information - headers already sent by (output started at /var/www/portal/includes/optimize_database_cron.php:65) in /var/www/portal/includes/page_header.php on line 1159


How do I get the cron job to run under the proper database user account?
Last edited by jast on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.

jast
Newbie
Newbie
 
Posts: 8
Likes: 0 post
Liked in: 0 post
Joined: Thu Aug 31, 2006 12:28 pm
Cash on hand: 0.00
Location: Stuttgart, Germany

Re: DB Optimization Cron Job Permission Problems After Upgra

PostAuthor: CaNNon » Mon Nov 26, 2007 12:58 pm

Think they all fall back to line 65 and
Access denied for user 'www-data'@'localhost' (using password: NO)

You should check the password
Last edited by CaNNon on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
Image
Image
User avatar
CaNNon
Sr Integra Member
Sr Integra Member
 
Posts: 750
Likes: 0 post
Liked in: 0 post
Joined: Thu Apr 19, 2007 12:15 pm
Cash on hand: 0.00

Re: DB Optimization Cron Job Permission Problems After Upgra

PostAuthor: jast » Mon Nov 26, 2007 1:03 pm

Yeah, I know. The thing is, it never ran the cron job under the www-data (webserver) account before I upgraded to 141d. I believe it always ran the cron job under the MySQL user account I created for the portal. The www-data account doesn't have any permissions to the database.
Last edited by jast on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.

jast
Newbie
Newbie
 
Posts: 8
Likes: 0 post
Liked in: 0 post
Joined: Thu Aug 31, 2006 12:28 pm
Cash on hand: 0.00
Location: Stuttgart, Germany

Re: DB Optimization Cron Job Permission Problems After Upgra

PostAuthor: jast » Wed Nov 28, 2007 11:18 pm

:ping:

Anyone else have an idea why the cron job is trying to run under the web server user account instead of the portal user account? It never did this before...my cron job count was always incrementing and I never got any errors in my logs.
Last edited by jast on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.

jast
Newbie
Newbie
 
Posts: 8
Likes: 0 post
Liked in: 0 post
Joined: Thu Aug 31, 2006 12:28 pm
Cash on hand: 0.00
Location: Stuttgart, Germany

PostAuthor: jast » Mon Dec 10, 2007 11:59 am

:ping:

Still looking for help on this one. Something between 1.4.1 and 1.4.1d changed the user that cron job was running under. Does anyone know where this is controlled?
Last edited by jast on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.

jast
Newbie
Newbie
 
Posts: 8
Likes: 0 post
Liked in: 0 post
Joined: Thu Aug 31, 2006 12:28 pm
Cash on hand: 0.00
Location: Stuttgart, Germany

Re: DB Optimization Cron Job Permission Problems After Upgra

PostAuthor: Helter » Mon Dec 10, 2007 3:30 pm

the only thing I can think of is that you originally uploaded the files as an ftp user and the update as the root user. 141 to 141d only includes tested bugfixes and none are related to your problem.
in your ftp client, or cpanel file manager, check file ownership. Generally speaking, if the files are owned by root, they will not be accessible to anyone else.
Last edited by Helter on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
"Success is getting what you want. Happiness is wanting what you get." - Dale Carnegie
User avatar
Helter
Administrator
Administrator
 
Posts: 4554
Likes: 40 posts
Liked in: 116 posts
Images: 0
Joined: Sat Mar 11, 2006 4:46 pm
Cash on hand: 1,959.15
Location: Seattle Wa
IntegraMOD version: phpBB2x

Re: DB Optimization Cron Job Permission Problems After Upgra

PostAuthor: jast » Mon Dec 10, 2007 11:12 pm

Helter,
Thanks for the tip. I did the upgrade locally on my server, and I think I did use my admin account. However, I always do a "chown -R www-data:www-data" on the portal directory to make the files are owned by the Apache user account. This is the same thing I've done for every other install. I just checked in the config.php file and made sure that the username and password were set correctly for the integramod database and it is set correctly to portal_user.

All I can think of is that optimize_database_cron.php is being executed by the www-data user, as it should be, but it is trying to access the database as www-data instead of portal_user like the rest of the .php files are doing. I don't get a permissions error when I try to do a post, so I know portal_user has access to the database. Is there something different in optimize_database_cron.php as far as how the database is being accessed?
Last edited by jast on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.

jast
Newbie
Newbie
 
Posts: 8
Likes: 0 post
Liked in: 0 post
Joined: Thu Aug 31, 2006 12:28 pm
Cash on hand: 0.00
Location: Stuttgart, Germany

Re: DB Optimization Cron Job Permission Problems After Upgra

PostAuthor: Helter » Tue Dec 11, 2007 12:25 am

i have no idea why your forum would be trying to use 2 separate accounts. You could check to ses if that is the case by adding the www-data user, as a user to your forum db.
Last edited by Helter on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
"Success is getting what you want. Happiness is wanting what you get." - Dale Carnegie
User avatar
Helter
Administrator
Administrator
 
Posts: 4554
Likes: 40 posts
Liked in: 116 posts
Images: 0
Joined: Sat Mar 11, 2006 4:46 pm
Cash on hand: 1,959.15
Location: Seattle Wa
IntegraMOD version: phpBB2x

Re: DB Optimization Cron Job Permission Problems After Upgra

PostAuthor: jast » Tue Dec 11, 2007 1:54 pm

I created a database user www-data and gave it SELECT, INSERT, UPDATE, DELETE, EXECUTE privileges. I also assigned a password to the user. I then set the cron job to run every 20 seconds and received the same error message as in the previous post. I then deleted the password and received the following error message.

[code]Warning]

So, it appears the www-data user is connecting to the database, but there is still a problem somewhere.
Last edited by jast on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.

jast
Newbie
Newbie
 
Posts: 8
Likes: 0 post
Liked in: 0 post
Joined: Thu Aug 31, 2006 12:28 pm
Cash on hand: 0.00
Location: Stuttgart, Germany


Return to IntegraMOD 141

Who is online

Registered users: App360MonitorBot, Bing [Bot], Google [Bot]