Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

PostgreSql backup failure

Discussion in 'General Discussion' started by serg, Jan 25, 2008.

  1. serg

    serg Member

    May 30, 2003
    Likes Received:
    Trophy Points:
    OS: FreeBSD 6.2
    WHM 11.15.0 cPanel 11.17.0-R19434
    Previous releases have absolutely the same issue.

    /scripts/pkgacct generate an account backup,
    however, as I find out, there is a problem with postgresql databases backups

    Here is an error message logged:
    pg_dump: [tar archiver] could not generate temporary file name: Permission denied

    This happen because of incorrect user switching.

    pg_dump called by pgsql user but within domain USER environment.
    In that case TMPDIR variable is set to /HOME/USER/tmp but the USER is the only one who is granted to write there, therefore pg_dump unable to create tmpfile inside this directory.

    Possible fixes:
    1. run pg_dump as USER
    2. export TMPDIR variable with proper value, /tmp for example.

    2nd choise is quite easy to be implemented by the end user untill cpanel fix this issue.

    You just need to do following:
    1. mv /usr/local/bin/pg_dump /usr/local/bin/pg_dump_real
    2. create new file /usr/local/bin/pg_dump with following contect
    export TMPDIR=/tmp ; pg_dump_real $@
    3. set this file to be executable, i.e. chmod a+x /usr/local/bin/pg_dump
  2. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Apr 7, 2006
    Likes Received:
    Trophy Points:
    cPanel Access Level:
    Root Administrator
    Thanks for the report. The developers have been informed of this matter.
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. serg

    serg Member

    May 30, 2003
    Likes Received:
    Trophy Points:
    Another issue related to database restoration.

    Ownerships/permissions are not restored properly.

    Here is how to reproduce it:
    1. Create postgres database via cpanel
    2. Create user
    3. assign user to database
    4. login to postgres as this user
    5. create a table - this user will be the owner of it.
    6. transfer account to different host.

    all tables/objects will be owned by "domainadmin" account instead of right postgres account.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice