The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Error messages in e-mail sent by CPanel

Discussion in 'Data Protection' started by SecondSight, Jan 24, 2009.

  1. SecondSight

    SecondSight Well-Known Member

    Joined:
    Jun 30, 2004
    Messages:
    66
    Likes Received:
    0
    Trophy Points:
    6
    Hello ! :)

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

    Do you know why I get this "permission denied" error ?

    Thank you ! :)
     
  2. Voltar

    Voltar Well-Known Member

    Joined:
    Apr 30, 2007
    Messages:
    269
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Bakersfield, California
    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. SecondSight

    SecondSight Well-Known Member

    Joined:
    Jun 30, 2004
    Messages:
    66
    Likes Received:
    0
    Trophy Points:
    6
    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 ! :)
     
  4. SB-Nick

    SB-Nick Well-Known Member

    Joined:
    Aug 26, 2008
    Messages:
    134
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    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.
     
  5. SecondSight

    SecondSight Well-Known Member

    Joined:
    Jun 30, 2004
    Messages:
    66
    Likes Received:
    0
    Trophy Points:
    6
    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...
     
  6. sebby

    sebby Well-Known Member

    Joined:
    Jun 15, 2004
    Messages:
    70
    Likes Received:
    0
    Trophy Points:
    6
    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)
     
    #6 sebby, Jan 25, 2009
    Last edited: Jan 25, 2009
  7. cPanelNick

    cPanelNick Administrator
    Staff Member

    Joined:
    Mar 9, 2015
    Messages:
    3,426
    Likes Received:
    2
    Trophy Points:
    38
    cPanel Access Level:
    DataCenter Provider

    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.
     
  8. sebby

    sebby Well-Known Member

    Joined:
    Jun 15, 2004
    Messages:
    70
    Likes Received:
    0
    Trophy Points:
    6
    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. haxxor23

    haxxor23 Member

    Joined:
    Nov 4, 2008
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    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. kamm

    kamm Active Member

    Joined:
    Jan 17, 2004
    Messages:
    38
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Spain
    cPanel Access Level:
    Root Administrator
    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
    
     
Loading...

Share This Page