Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 10 of 10
  1. #1
    Member
    Join Date
    Jun 2004
    Posts
    50

    Default Error messages in e-mail sent by CPanel

    Hello !

    I'm making a backup every day and CPanel sends me an e-mail. Today, in the e-mail, I found this line :

    Copying homedir..../bin/gtar: ./public_html/uploads/uploads/av-325.gif: Cannot open: Permission denied
    /bin/gtar: ./public_html/uploads/av-378.jpg: Cannot open: Permission denied
    /bin/gtar: Error exit delayed from previous errors
    Done
    Do you know why I get this "permission denied" error ?

    Thank you !
    SecondSight
    *-*-*-*-*-*-*-*-*-*-**
    Want to learn !

  2. #2
    Member
    Join Date
    Apr 2007
    Location
    Bakersfield, California
    Posts
    270

    Default

    I'm going to take a shot and say that you're using FreeBSD since it shows gtar in the error message. Have you checked the permissions of the file(s) in question? Also, you might want to check out the owner and group of the file(s).

  3. #3
    Member
    Join Date
    Jun 2004
    Posts
    50

    Default

    Hello !

    I've had a look at the two files inside my uploads directory.

    I noticed that for the files, the owner and group could be :
    root root
    or
    myaccount myaccount

    The two files, which had been uploaded on the 19th of June 2004, are chmoded 444 (the other files are all chmoded 777, 755 or 644) and for both files owner and group are : root

    In another directory I used for backing the files, I see that the files are chmoded 777 and the user isn't root but myaccount.

    The question I'm asking myself is : why do I get this error message today ?... I suppose the software I used (Invision Power board) is linked to the problem ?

    Thank you !
    SecondSight
    *-*-*-*-*-*-*-*-*-*-**
    Want to learn !

  4. #4
    Member SB-Nick's Avatar
    Join Date
    Aug 2008
    Posts
    110

    Default

    Greetings,

    Did you try to chmod both files to 644 and re issue a backup run?
    Do you have more files inside that folder? Give it a quick look at the folder permission and see if everything is correct.
    :: Server Buddies ::

    Server Management & Monitoring

    .Dedicated Server Solutions At Affordable Rates.

  5. #5
    Member
    Join Date
    Jun 2004
    Posts
    50

    Default

    Hello !

    Yes, I have many other files in the directory and they are all chmoded 777, 755 or 644.

    I tried chmoding one of the two files using SmartFTP and I got this error :
    550 Could not change perms on av-325.gif: Permission denied
    Then I used WinSCP to do it, but it froze and when I connected again the file no longer appeared. It looks like it has been deleted...
    SecondSight
    *-*-*-*-*-*-*-*-*-*-**
    Want to learn !

  6. #6
    Member
    Join Date
    Jun 2004
    Posts
    66

    Default

    I can confirm that I get these errors as well on a couple of backup files since Cpanel update 11.24.4-RELEASE_33609 released yesterday (obviously a new verbose feature - can cPanel confirm this as their logchanges is not up to date?).

    At first glance it appears that the files being denied access to are mostly files owned by the user nobody (Apache - it's a non suPHP environment).

    Since the cpbackup script is running as root, what do the dir/files permissions/ownership have to do with it?

    Thank you for your support.

    Sebby
    (Running CentOS 5.x)

    EDIT 1: I confirm that the files being excluded are indeed nobody.nobody files with perm 600 generated by a CMS (Moodle) without any file mask option... A daily cron changing the perms or suPHP could fix this but isn't cpbackup supppose to include all these files anyway as it (i.e backup process) is owned by root?

    EDIT 2: What is the impact of those files being ignored... Are the rest of the homedir files being backed up properly? (as far as I can see the answer is yes but I'd appreciate a confirmation from cPanel staff)
    Last edited by sebby; 01-25-2009 at 12:10 PM. Reason: Further details

  7. #7
    cPanel Staff cpanelnick's Avatar
    Join Date
    Feb 2003
    Location
    Houston, TX
    Posts
    4,597

    Default

    Quote Originally Posted by sebby View Post
    I can confirm that I get these errors as well on a couple of backup files since Cpanel update 11.24.4-RELEASE_33609 released yesterday (obviously a new verbose feature - can cPanel confirm this as their logchanges is not up to date?).

    At first glance it appears that the files being denied access to are mostly files owned by the user nobody (Apache - it's a non suPHP environment).

    Since the cpbackup script is running as root, what do the dir/files permissions/ownership have to do with it?

    Thank you for your support.

    Sebby
    (Running CentOS 5.x)

    EDIT 1: I confirm that the files being excluded are indeed nobody.nobody files with perm 600 generated by a CMS (Moodle) without any file mask option... A daily cron changing the perms or suPHP could fix this but isn't cpbackup supppose to include all these files anyway as it (i.e backup process) is owned by root?

    EDIT 2: What is the impact of those files being ignored... Are the rest of the homedir files being backed up properly? (as far as I can see the answer is yes but I'd appreciate a confirmation from cPanel staff)

    The backup process runs as the user for security reasons (ie we don't want someone creating a link to /etc/shadow and getting in their backup)

    Previous versions never told you about backup errors, it silently just didn't b ackup the files it could not read. These files will just be ignored and the backup will continue to work.
    -Nick
    cPanel Inc.

    Need support? Submit a request here. Complimentary support is available to all license holders regardless of where you purchased your license.
    Need a complimentary support account? Create one here.

  8. #8
    Member
    Join Date
    Jun 2004
    Posts
    66

    Default

    Quote Originally Posted by cpanelnick View Post
    The backup process runs as the user for security reasons (ie we don't want someone creating a link to /etc/shadow and getting in their backup)

    Previous versions never told you about backup errors, it silently just didn't b ackup the files it could not read. These files will just be ignored and the backup will continue to work.
    Totally make sense! Thank you Nick for these explanations. I will craft a cron changing the ownership of these files (safe CMS related stuff) just before cpbackup. Is there anything like postupcp but to be executed just before cpbackup?

    sebby

  9. #9
    Member
    Join Date
    Nov 2008
    Posts
    11

    Default

    hmmm, seems like many people have this issue... what this means is that many files were actually missing from our backups without us actually knowing it!

    good thing I didn't have a crash and needed to restore!

    anyway, im using this script, and running it as a cron prior to the cpbackup job. it automatically change file ownerships to the correct user:

    (i've copied it here with the credit to it's original author)

    #!/bin/bash
    # chownfixer2 - Ultimate tool for setting proper CHOWN values
    # Created by Harzem @ WHT :P
    x=0
    cd /var/cpanel/users
    for user in *
    do
    chown -R $user.$user /home/$user/public_html/*
    x=$(($x + 1))
    done
    cd ~
    # version 1.0
    # DEV_DATE: August 9th, 2007

    place this into a file, say like chownfix.sh, change permissions on this file to make it executable (chmod 755), then place it in your crontab, eg:

    0 1 * * * /scripts/chownfix.sh > /dev/null 2>&1

  10. #10
    Member
    Join Date
    Jan 2004
    Posts
    22

    Default

    How can I amend this script to include...
    /home/user/temp_sess/*
    ... but only if it exists?

    I'm doing this and it works, but not all users have the temp_sess directory, so I'd like to make it conditional...

    Code:
    #!/bin/bash
    # chownfixer2 - Ultimate tool for setting proper CHOWN values
    # Created by Harzem @ WHT :P
    x=0
    cd /var/cpanel/users
    for user in *
    do
    chown -R $user.$user /home/$user/temp_sess/*
    chown -R $user.$user /home/$user/public_html/*
    x=$(($x + 1))
    done
    cd ~
    # version 1.0
    # DEV_DATE: August 9th, 2007

Similar Threads & Tags
Similar threads

  1. SMTP error messages, returned outgoing mail
    By Calgrrl in forum New User Questions
    Replies: 1
    Last Post: 01-27-2010, 04:34 AM
  2. Replies: 1
    Last Post: 05-08-2009, 09:33 AM
  3. Cpanel Error log messages
    By mickalo in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 11-20-2006, 08:18 AM
  4. Cpanel Backup error messages
    By fuzioneer in forum cPanel and WHM Discussions
    Replies: 10
    Last Post: 09-15-2006, 12:10 AM
  5. mail error messages
    By magin in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 02-06-2005, 07:20 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube