Hudson server always stopped every morning day - linux

I've got this regular problem every morning that my build server (Hudson) is always stopped every morning so I have to manually start it, is there any reason why or any location that I can started to look for the error message?
Here's the error diagnostic that I did:
ascari:~# ps -ef | grep -i hud
root 5959 5944 0 09:00 pts/0 00:00:00 grep -i hud
ascari:~# cd /etc/init.d
ascari:/etc/init.d# ./hudson start
ascari:/etc/init.d# ps -ef | grep -i hud
hudson 6004 1 0 09:00 ? 00:00:00 /usr/bin/daemon --name=hudson -- inherit --env=HUDSON_HOME=/var/lib/hudson --output=/var/log/hudson/hudson.log -- user=hudson --pidfile=/var/run/hudson/hudson.pid -- /usr/bin/java -Xms512m -Xmx1 024m -Dhttp.proxyHost=proxy.domain.com -Dhttp.proxyPort=3128 -Dhttp.nonProxyHo sts="localhost|ascari|*.domain.com" -jar /usr/share/hudson/hudson.war --webroo t=/var/run/hudson/war
hudson 6005 6004 48 09:00 ? 00:00:01 /usr/bin/java -Xms512m -Xmx1024m -Dhttp.proxyHost=proxy.domain.com -Dhttp.proxyPort=3128 -Dhttp.nonProxyHosts= "localhost|ascari|*.domain.com" -jar /usr/share/hudson/hudson.war --webroot=/v ar/run/hudson/war
root 6008 5944 14 09:01 pts/0 00:00:00 grep -i hud
ascari:/etc/init.d# df -k -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 327M 125M 185M 41% /
tmpfs 1.5G 0 1.5G 0% /lib/init/rw
udev 10M 96K 10M 1% /dev
tmpfs 1.5G 0 1.5G 0% /dev/shm
/dev/sda9 4.7G 295M 4.1G 7% /home
/dev/sda8 4.2G 155M 3.8G 4% /tmp
/dev/sda5 4.6G 3.0G 1.4G 69% /usr
/dev/sda6 65G 32G 30G 52% /var
ascari:/etc/init.d# uname -a
Linux ascari 2.6.26-2-686 #1 SMP Sun Jun 21 04:57:38 UTC 2009 i686 GNU/Linux
ascari:/etc/init.d#

Have you checked the logfile (referenced above) and set the --logfile argument (as documented here) ?

Rescheduling the project build solve the problem.
The Hudson process was killed by the Linux kernel due to the memory over consumption.

Related

Paramiko exec_command not working with mkfs?

Some issue executing the following bash with Paramiko:
def format_disk(self, device, size, dformat, mount, name):
stdin_, stdout_, stderr_ = self.client.exec_command(f"pvcreate {device};" \
f"vgcreate {name}-vg {device};" \
f"lvcreate -L {size} --name {name}-lv {name}-vg;" \
f"mkfs.{dformat} /dev/{name}-vg/{name}-lv;" \
f"mkdir {mount};" \
f"echo '/dev/{name}-vg/{name}-lv {mount} {dformat} defaults 0 0' >> /etc/fstab")
print(f"mkfs.{dformat} /dev/{name}-vg/{name}-lv;")
Print statement outputs: mkfs.ext4 /dev/first_try-vg/first_try-lv; If I copy and paste this exact command on the server there are no errors and it formats the disk as expected.
Troubleshooting steps
Server before running python script:
ls: cannot access /first_try: No such file or directory
[root#localhost ~]# vgs
[root#localhost ~]# lvs
[root#localhost ~]# cat /etc/fstab
#
# /etc/fstab
# Created by anaconda on Thu Feb 25 07:32:51 2021
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
UUID=38b7e96a-71e5-4089-a348-bd23828f9dc8 / xfs defaults 0 0
UUID=72fd2a6a-85db-4596-9fc2-6604d0d865a3 /boot xfs defaults 0 0
Server after running python script:
[root#localhost ~]# ls /first_try/
[root#localhost ~]# vgs
VG #PV #LV #SN Attr VSize VFree
first_try-vg 1 1 0 wz--n- <20.00g <15.00g
[root#localhost ~]# lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
first_try-lv first_try-vg -wi-a----- 5.00g
[root#localhost ~]# cat /etc/fstab
#
# /etc/fstab
# Created by anaconda on Thu Feb 25 07:32:51 2021
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
UUID=38b7e96a-71e5-4089-a348-bd23828f9dc8 / xfs defaults 0 0
UUID=72fd2a6a-85db-4596-9fc2-6604d0d865a3 /boot xfs defaults 0 0
/dev/first_try-vg/first_try-lv /first_try ext4 defaults 0 0
[root#localhost ~]# mount -a
mount: wrong fs type, bad option, bad superblock on /dev/mapper/first_try--vg-first_try--lv,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so.
The error from mount -a indicates that the disk is not formatted.
If I format the disk manually and run mount -a it works.
Example:
[root#localhost ~]# mkfs.ext4 /dev/first_try-vg/first_try-lv
mke2fs 1.42.9 (28-Dec-2013)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
327680 inodes, 1310720 blocks
65536 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=1342177280
40 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736
Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): mdone
Writing superblocks and filesystem accounting information: done
[root#localhost ~]# mount -a
[root#localhost ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 18G 4.7G 14G 27% /
devtmpfs 471M 0 471M 0% /dev
tmpfs 487M 0 487M 0% /dev/shm
tmpfs 487M 8.4M 478M 2% /run
tmpfs 487M 0 487M 0% /sys/fs/cgroup
/dev/sda1 297M 147M 151M 50% /boot
tmpfs 98M 12K 98M 1% /run/user/42
tmpfs 98M 0 98M 0% /run/user/0
/dev/mapper/first_try--vg-first_try--lv 4.8G 20M 4.6G 1% /first_try
Pariminko could not handle the output from mkfs. I changed the command to use the -q quiet flag and was able to get the script to run successfully.
New commmand mkfs -q -t {dformat} /dev/{name}-vg/{name}-lv

How to increase available filesystem size in /dev/root in Linux Centos 7.7 (AltArch)?

I am running a fresh installation of CentOS 7.7. on my Raspberry Pi 3 and unfortunatly I am running out of size when installing yum packages:
[root#centos7 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/root 1.4G 1.3G 104M 93% /
devtmpfs 459M 0 459M 0% /dev
tmpfs 464M 0 464M 0% /dev/shm
tmpfs 464M 12M 452M 3% /run
tmpfs 464M 0 464M 0% /sys/fs/cgroup
/dev/mmcblk0p1 286M 57M 230M 20% /boot
tmpfs 93M 0 93M 0% /run/user/0
The OS is installed on a 16gb SD card, so in principle I should have more than enough space:
Device Boot Start End Blocks Id System
/dev/mmcblk0p1 * 8192 593919 292864 c W95 FAT32 (LBA)
/dev/mmcblk0p2 593920 1593343 499712 82 Linux swap / Solaris
/dev/mmcblk0p3 1593344 4524031 1465344 83 Linux
I figured that I should be able to increase the size of the file system with growpart or resize2fs but I am not sure how to do this exactly and I don't want to break anything. What would be the best way to do this? Thanks!
You are on the right track. This is what I did for my Pi4 on a 64GB SD card:
[root#localhost ~]# df -h | head -n 2
Filesystem Size Used Avail Use% Mounted on
/dev/root 1.7G 1.4G 199M 88% /
[root#localhost ~]# fdisk -l
...
Device Boot Start End Blocks Id System
/dev/mmcblk0p1 * 8192 593919 292864 c W95 FAT32 (LBA)
/dev/mmcblk0p2 593920 1593343 499712 82 Linux swap / Solaris
/dev/mmcblk0p3 1593344 5109759 1758208 83 Linux
[root#localhost ~]# growpart /dev/mmcblk0 3
CHANGED: partition=3 start=1593344 old: size=3516416 end=5109760 new: size=120041439 end=121634783
[root#localhost ~]# fdisk -l
...
Device Boot Start End Blocks Id System
/dev/mmcblk0p1 * 8192 593919 292864 c W95 FAT32 (LBA)
/dev/mmcblk0p2 593920 1593343 499712 82 Linux swap / Solaris
/dev/mmcblk0p3 1593344 121634782 60020719+ 83 Linux
[root#localhost ~]# resize2fs /dev/mmcblk0p3
resize2fs 1.42.9 (28-Dec-2013)
Filesystem at /dev/mmcblk0p3 is mounted on /; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 8
The filesystem on /dev/mmcblk0p3 is now 15005179 blocks long.
[root#localhost ~]# df -h | head -n 2
Filesystem Size Used Avail Use% Mounted on
/dev/root 57G 1.4G 55G 3% /
Well, this is an easy thing to do. I share with you my script to extend the /, https://github.com/sbaiidrissiyoussef/STORAGE/blob/master/extend_slash.sh
Upvote if this helps you.

/dev/vda1 is full but cannot find why

I have a server running Centos 7. This is the result of df -h
Filesystem Size Used Avail Use% Mounted on
udev 7.4G 0 7.4G 0% /dev
tmpfs 1.5G 139M 1.4G 10% /run
/dev/vda1 46G 44G 0 100% /
tmpfs 7.4G 0 7.4G 0% /dev/shm
tmpfs 7.4G 0 7.4G 0% /sys/fs/cgroup
/dev/vda15 99M 3.6M 95M 4% /boot/efi
/dev/mapper/LVMVolGroup-DATA_VOLUME 138G 17G 114G 13% /mnt/data
tmpfs 1.5G 0 1.5G 0% /run/user/0
Even if there are 2GB of free space on / , it shows that the filesystem is at 100% of usage, and I can't install new packages because it tells me there's no space left on device.
Besides, if I type sudo du -sh /* | sort -rh | head -15
the result is:
17G /mnt
1.1G /usr
292M /var
208M /root
139M /run
49M /boot
48M /tmp
32M /etc
28K /home
16K /lost+found
12K /anaconda-post.log
4.0K /srv
4.0K /opt
4.0K /media
0 /sys
So it seems that there are no big files filling up the disk, and the sum of the sizes of the directories is not even equal to 44GB.
Additional info: the only service running on the server is Jenkins, but its home is under /mnt/data/jenkins.
How can I solve the problem?
Found the solution.
The problem was related to some deleted files kept open by Jenkins.
Restarting the service the problem was solved.
The problem was related to the system cache/temp storage. Linux system created the cache files and its archive from time to time, especially when some long option is run like DB import or crone job etc.. or sometimes server up from sines long.
Restarting the service or server
so due to that, the cache/ temp files were deleted and the problem was solved.
even in windows, we faced that kind of performance issue when RAM is low, and restarting the system is the primary solution for that.

/media directory not working anymore

I can't automount USB sticks on my linux because I have several problems with /media directory.
Here is my ls -al result on / (I just kept the media and mnt directories for you) :
total 116
drwxr-xr-x 25 root root 4096 juin 13 09:39 .
drwxr-xr-x 25 root root 4096 juin 13 09:39 ..
drwx------ 8 acarbonaro acarbonaro 8192 janv. 1 1970 media
drwxr-xr-x 2 root root 4096 avril 11 2014 mnt
This already seems strange as for other users it is often owned by root.
When I try to sudo chown root:root media it says permission denied.
When I try to sudo chown 755 media it doesn't say anything but when I ls -l after nothing has changed.
The other problem : I don't know why but the media directory is empty I can't find the user directory that used to be in it.
When I plug a USB flash drive, it cannot auto mount. I have to mount it manually in another directory, which is not impossible but clearly not handy.
Thank you for your help.
EDIT:
Here is my df -T result :
Sys. de fichiers Type blocs de 1K Utilisé Disponible Uti% Monté sur
udev devtmpfs 4015584 8 4015576 1% /dev
tmpfs tmpfs 805680 1212 804468 1% /run
/dev/sda1 ext4 115214888 9815468 99523708 9% /
none tmpfs 4 0 4 0% /sys/fs/cgroup
none tmpfs 5120 0 5120 0% /run/lock
none tmpfs 4028392 522580 3505812 13% /run/shm
none tmpfs 102400 600 101800 1% /run/user
/dev/sda2 ext4 130654772 18532260 105462572 15% /home
/dev/sdb2 vfat 14938864 218480 14720384 2% /media
EDIT:
I don't know the answer to my problem, but rebooting reset the /media directory as it was before and it works agian.
I assume the problem was that you have yanked the USB stick out of port without unmounting. UNIX is not very keen to parts of its FS disappearing. Next time, umount it first, then remove.

AWS EC2 ERROR: -bash: cannot create temp file for here-document: No space left on device

I'm getting following error while doing tab. And unable to change the files, can open the files but not able to save the files. It looks like the server is working fine and long scripts are continuously executing and never ending.
ubuntu#ip-172-31-49-89:~$ cat /etc/issue.net
Ubuntu 14.04.4 LTS
ubuntu#ip-172-31-49-89:~$ uname -a
Linux ip-172-31-49-89 3.13.0-74-generic #118-Ubuntu SMP Thu Dec 17 22:52:10
UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
ubuntu#ip-172-31-49-89:~$ df -h
Filesystem Size Used Avail Use% Mounted on
udev 492M 12K 492M 1% /dev
tmpfs 100M 376K 99M 1% /run
/dev/xvda1 50G 47G 0 100% /
none 4.0K 0 4.0K 0% /sys/fs/cgroup
none 5.0M 0 5.0M 0% /run/lock
none 497M 0 497M 0% /run/shm
none 100M 0 100M 0% /run/user
ubuntu#ip-172-31-49-89:~$ df -i
Filesystem Inodes IUsed IFree IUse% Mounted on
udev 125803 387 125416 1% /dev
tmpfs 127040 315 126725 1% /run
/dev/xvda1 3276800 134435 3142365 5% /
none 127040 2 127038 1% /sys/fs/cgroup
none 127040 1 127039 1% /run/lock
none 127040 1 127039 1% /run/shm
none 127040 2 127038 1% /run/user
ubuntu#ip-172-31-49-89:~$ cd new
-bash: cannot create temp file for here-document: No space left on device
What should I do now? I just deleted my unnecessary founders and files. Still the same error after some time.
I tried solving this issue and my tmp and log files are smaller:
ubuntu#ip-172-31-49-89:~$ du -sh /tmp
1.3M /tmp
ubuntu#ip-172-31-49-89:~$ du -sh /var/log
6.2M /var/log
Well, you said it yourself: you disk is full:
/dev/xvda1 50G 47G 0 100% /
Start investigating where you disk space is gone from the root folder:
du -hs /* | sort -h
That should give a pretty good idea what's occupying most of the disk drive.

Resources