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.

Warning: session_write_close(): write failed: No space left

Discussion in 'General Discussion' started by A_1, Mar 17, 2007.

  1. A_1

    A_1 Active Member

    Joined:
    Jan 5, 2007
    Messages:
    35
    Likes Received:
    0
    Trophy Points:
    6
    Hello,

    in my cpanel i got that error when i want open phpmyadmin

    error is:


    Warning: session_write_close(): write failed: No space left on device (28) in /usr/local/cpanel/base/3rdparty/phpMyAdmin/index.php on line 44

    Warning: session_write_close(): Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in /usr/local/cpanel/base/3rdparty/phpMyAdmin/index.php on line 44



    Please Help
     
  2. mctDarren

    mctDarren Well-Known Member

    Joined:
    Jan 6, 2004
    Messages:
    664
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    New Jersey
    cPanel Access Level:
    Root Administrator
    You need to clean out your /tmp directory. Remove some old session vars from in there and you'll be good. :)
     
  3. A_1

    A_1 Active Member

    Joined:
    Jan 5, 2007
    Messages:
    35
    Likes Received:
    0
    Trophy Points:
    6
    Thanks for ur reply ,

    but how i can do that ? :eek:
     
  4. mctDarren

    mctDarren Well-Known Member

    Joined:
    Jan 6, 2004
    Messages:
    664
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    New Jersey
    cPanel Access Level:
    Root Administrator
    Is this your server? If not contact your host. If so, google for "clean tmp".
     
  5. FeeL

    FeeL Well-Known Member

    Joined:
    Apr 17, 2004
    Messages:
    135
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Rio de janeiro
    cPanel Access Level:
    Reseller Owner
    phpmyadmin space problem?

    Same error here.

    Warning: session_write_close() [function.session-write-close]: write failed: No space left on device (28) in /usr/local/cpanel/base/3rdparty/phpMyAdmin/index.php on line 44

    Warning: session_write_close() [function.session-write-close]: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in /usr/local/cpanel/base/3rdparty/phpMyAdmin/index.php on line 44

    Warning: Cannot modify header information - headers already sent by (output started at /usr/local/cpanel/base/3rdparty/phpMyAdmin/index.php:44) in /usr/local/cpanel/base/3rdparty/phpMyAdmin/index.php on line 101

    ----

    My disk space is ok!

    Swap Used 0.40 %
    Disk /dev/hda3 (/) DMA+ 76 %
    Disk /dev/hda1 (/boot) DMA+ 12 %

    What should I do? Clean tmp??

    :eek:

    Thank you!
     
  6. AlexV.

    AlexV. Well-Known Member

    Joined:
    Jun 15, 2006
    Messages:
    212
    Likes Received:
    1
    Trophy Points:
    16
    Feel:

    What is the ouput from:
    df -h /tmp
     
  7. FeeL

    FeeL Well-Known Member

    Joined:
    Apr 17, 2004
    Messages:
    135
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Rio de janeiro
    cPanel Access Level:
    Reseller Owner
    tmp space

    Thanks for the quick (and smart) answer, Alex.

    You are right about the way to look at the space.

    df -h /tmp
    Filesystem Size Used Avail Use% Mounted on
    /usr/tmpDSK 243M 242M 0 100% /tmp

    It is really full!

    My point now is..
    Do I have to enlarge TMP space, or clean it up?
    If cleaning, witch is the safest qay to do it?

    Thank you all again...
    :rolleyes:
     
  8. FeeL

    FeeL Well-Known Member

    Joined:
    Apr 17, 2004
    Messages:
    135
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Rio de janeiro
    cPanel Access Level:
    Reseller Owner
    tmp clean script

    is this script worthy?

    TMPWATCH="/usr/sbin/tmpwatch"
    PORTAGE_TMPDIR="$(portageq envvar PORTAGE_TMPDIR)/portage"
    DISTDIR="$(portageq distdir)"

    if [[ -d /tmp ]]; then
    ${TMPWATCH} --atime 168 /tmp
    fi

    if [[ -d ${PORTAGE_TMPDIR:-/var/tmp/portage} ]]; then
    ${TMPWATCH} --mtime --all 336 ${PORTAGE_TMPDIR:-/var/tmp/portage}
    fi

    if [[ -d ${DISTDIR:-/usr/portage/distfiles} ]]; then
    ${TMPWATCH} --atime --fuser 4320 ${DISTDIR:-/usr/portage/distfiles}
    fi

    :cool:
     
  9. AndyReed

    AndyReed Well-Known Member
    PartnerNOC

    Joined:
    May 29, 2004
    Messages:
    2,222
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Minneapolis, MN
    It is likely that your /usr/tmpDSK is corrupted. You should stop all processes that have files open on /tmp such as MySQL and other applications using:

    /usr/sbin/lsof /tmp

    Delete all un-necessary files and then run the following command:

    /scripts/securetmp

    If that doesn't help, contact us.
     
    #9 AndyReed, May 7, 2007
    Last edited: Nov 19, 2008
  10. FeeL

    FeeL Well-Known Member

    Joined:
    Apr 17, 2004
    Messages:
    135
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Rio de janeiro
    cPanel Access Level:
    Reseller Owner
    bad /tmp!

    Bealtifull!

    Tnx alot! :D
     
  11. Arjay

    Arjay Registered

    Joined:
    Mar 22, 2007
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    how i do increase the /tmp size? :)
     
  12. mctDarren

    mctDarren Well-Known Member

    Joined:
    Jan 6, 2004
    Messages:
    664
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    New Jersey
    cPanel Access Level:
    Root Administrator
    It depends on if your tmp is a virtually created directory or an actual partition set up for you. If the latter, contact your provider and see if they offer a service to run a partition manager for you at the machine. If it's virtual you can use the technique from servertune above to trash the current tmp directory and create another.

    If you want to increase your tmp dir size above normal, edit the /scripts/securetmp file and look for the line:
    Code:
    my $tmpdsksize     = 512000;
    Increase the value here to as large as you would like tmp to be. Note, though, that you don't want to make it _too_ large. A much better practice is to clean out tmp regularly using a script like tmpwatch to keep it to a controllable size. Here's a script I use (in /scripts/cleantmp) that runs via cron every so often on our boxes to weed out useless and older tmp files:
    Code:
    # This script cleans out /tmp of empty, root, cpanel and nobody session files in /tmp
    
    # if --test is passed, we just show the results
    if [ "$1" == "--test" ]
    then
            CMD="-exec ls -la"
            echo "$0: test mode"
    else
            CMD="-exec rm -rf"
    fi
    
    # remove empty session files that are over 2 hours old
    find /tmp -name "sess*" -empty -mmin +120 -maxdepth 1 $CMD {}  \;
    
    # remove root owned session files
    find /tmp -name "sess*" -user root -maxdepth 1 $CMD {} \;
    
    # remove nobody session files
    find /tmp -name "*sess*" -user nobody -maxdepth 1 $CMD {} \;
    
    # remove cpanel owned session files
    find /tmp -name "sess*" -user cpanel -maxdepth 1 $CMD {} \;
    
    # remove any session file over 4 hours old
    find /tmp -name "sess*" -mmin +240 -maxdepth 1 $CMD {} \;
    
    # remove any spamassassin file over 4 hours old
    find /tmp -name ".spamassassin*" -mmin +240 -maxdepth 1 $CMD {} \;
    
    Run it with "--test" after and it will just show you all the files it would delete when running for real. This will give you an idea of what it's cleaning out. The comments show you what line does what within the script. Hope this helps!
     
  13. foussa

    foussa Member

    Joined:
    Jun 1, 2006
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    ServerTune very thanks

    @ ServerTune good job

    very thanks
     
  14. gmagana

    gmagana Active Member

    Joined:
    May 18, 2005
    Messages:
    41
    Likes Received:
    0
    Trophy Points:
    6
    THANKS! This post should be a sticky, it took too long to find and it fixed the problem immediately!
     
  15. SilverBullet85

    SilverBullet85 Registered

    Joined:
    Aug 18, 2009
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    This error occurred only once for me and it is working fine now. when I checked the /tmp size there is still 26% of memory remaining i.e nearly 64 GB. So I donot understand why this error has occurred in the first place when there is sufficient memory in /tmp.....I am trying to find the root cause of the problem....does anyone have any more ideas
     
Loading...

Share This Page