Node.js/err
来自康健生活
< Node.js
引言
- UnhandledPromiseRejectionWarning: TypeError: Converting circular structure to JSON
- 定位问题
process.on('unhandledRejection', (reason, p) => { console.log('Unhandled Rejection at: Promise', p, 'reason:', reason); // application specific logging, throwing an error, or other logic here });
- property 'socket' -> object with constructor 'Socket'
- Cannot set headers after they are sent to the client
- verbose stack spawn ENOENT
- Error: ENOSPC: no space left on device, write
- 磁盘空间不足
- 检查
[jian@kang /home/kangkk]$
df -hT
Filesystem Type Size Used Avail Use% Mounted on /dev/sda1 ext4 99G 94G 0 100% / devtmpfs devtmpfs 1.9G 0 1.9G 0% /dev tmpfs tmpfs 1.9G 0 1.9G 0% /dev/shm tmpfs tmpfs 1.9G 8.4M 1.9G 1% /run tmpfs tmpfs 1.9G 0 1.9G 0% /sys/fs/cgroup tmpfs tmpfs 379M 0 379M 0% /run/user/58964
[jian@kang /home/kangkk]$
df -i
Filesystem Inodes IUsed IFree IUse% Mounted on /dev/sda1 6553600 182345 6371255 3% / devtmpfs 482405 336 482069 1% /dev tmpfs 485051 1 485050 1% /dev/shm tmpfs 485051 382 484669 1% /run tmpfs 485051 16 485035 1% /sys/fs/cgroup tmpfs 485051 1 485050 1% /run/user/58964
- 排查文件
[jian@kang /home/kangkk]$
find / -type d -size +10M |xargs ls -lhddrwx------ 2 kangjian kangjian 4.0K Jan 30 12:09 .
du -sh *命令可以查看当前目录所有文件和文件夹的大小[jian@kang /home/kangkk]$
du -sh *
0 bin 256M boot 4.0K command 0 dev 37M etc 91G home 0 lib 0 lib64 16K lost+found 4.0K media 4.0K mnt 4.0K opt 2.1M package du: cannot access ‘proc/5722/task/5722/fd/4’: No such file or directory du: cannot access ‘proc/5722/task/5722/fdinfo/4’: No such file or directory du: cannot access ‘proc/5722/fd/4’: No such file or directory du: cannot access ‘proc/5722/fdinfo/4’: No such file or directory 0 proc 38M root 8.4M run 0 sbin 4.0K service 4.0K srv 0 sys 24K tmp 2.0G usr 1.4G var
- 查看保留块
[jian@kang /home/kangkk]$
tune2fs -l /dev/sda1
tune2fs 1.42.9 (28-Dec-2013) Filesystem volume name: <none> Last mounted on: / Filesystem UUID: a1003f9f-2f89-4a7d-baea-d7e2d6b5088a Filesystem magic number: 0xEF53 Filesystem revision #: 1 (dynamic) Filesystem features: has_journal ext_attr resize_inode dir_index filetype needs_recovery extent 64bit flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize Filesystem flags: signed_directory_hash Default mount options: user_xattr acl Filesystem state: clean Errors behavior: Continue Filesystem OS type: Linux Inode count: 6553600 Block count: 26213807 Reserved block count: 1179598 Free blocks: 1181495 Free inodes: 6371300 First block: 0 Block size: 4096 Fragment size: 4096 Group descriptor size: 64 Reserved GDT blocks: 1018 Blocks per group: 32768 Fragments per group: 32768 Inodes per group: 8192 Inode blocks per group: 512 Flex block group size: 16 Filesystem created: Mon Aug 10 18:04:59 2015 Last mount time: Mon Jan 31 09:33:58 2022 Last write time: Mon Jan 31 09:33:55 2022 Mount count: 45 Maximum mount count: -1 Last checked: Mon Aug 10 18:04:59 2015 Check interval: 0 (<none>) Lifetime writes: 502 GB Reserved blocks uid: 0 (user root) Reserved blocks gid: 0 (group root) First inode: 11 Inode size: 256 Required extra isize: 28 Desired extra isize: 28 Journal inode: 8 Default directory hash: half_md4 Directory Hash Seed: 29b7f2d7-e0aa-43ed-989f-57e15e5d1dca Journal backup: inode blocks
- 释放保留块
[jian@kang /home/kangkk]$
tune2fs -m 0 /dev/sda1Setting reserved blocks percentage to 0% (0 blocks)
[jian@kang /home/kangkk]$
tune2fs -l /dev/sda1
tune2fs 1.42.9 (28-Dec-2013) Filesystem volume name: <none> Last mounted on: / Filesystem UUID: a1003f9f-2f89-4a7d-baea-d7e2d6b5088a Filesystem magic number: 0xEF53 Filesystem revision #: 1 (dynamic) Filesystem features: has_journal ext_attr resize_inode dir_index filetype needs_recovery extent 64bit flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize Filesystem flags: signed_directory_hash Default mount options: user_xattr acl Filesystem state: clean Errors behavior: Continue Filesystem OS type: Linux Inode count: 6553600 Block count: 26213807 Reserved block count: 0 Free blocks: 1181495 Free inodes: 6371300 First block: 0 Block size: 4096 Fragment size: 4096 Group descriptor size: 64 Reserved GDT blocks: 1018 Blocks per group: 32768 Fragments per group: 32768 Inodes per group: 8192 Inode blocks per group: 512 Flex block group size: 16 Filesystem created: Mon Aug 10 18:04:59 2015 Last mount time: Mon Jan 31 09:33:58 2022 Last write time: Mon Jan 31 10:05:46 2022 Mount count: 45 Maximum mount count: -1 Last checked: Mon Aug 10 18:04:59 2015 Check interval: 0 (<none>) Lifetime writes: 502 GB Reserved blocks uid: 0 (user root) Reserved blocks gid: 0 (group root) First inode: 11 Inode size: 256 Required extra isize: 28 Desired extra isize: 28 Journal inode: 8 Default directory hash: half_md4 Directory Hash Seed: 29b7f2d7-e0aa-43ed-989f-57e15e5d1dca Journal backup: inode blocks
No categories