Where to start First steps track · 15 stages
Linux Labs

Error → fix

Errors and symptoms: 952. Find yours and go to the fix in the article.

Terminal messages

  • nginx rejects the configuration nginx: configuration file … test failed nginx -t prints the full error with the file and the line number. nginx — web server and reverse proxy
  • No permission for the file or directory permission denied Check the owner and mode with ls -l, and use sudo when root is required. chmod / chown — permissions and ownership
  • systemd does not know this unit could not be found Check the name with systemctl list-units --type=service; a changed file needs daemon-reload. systemctl — managing systemd services
  • Command not found command not found Check for a typo and the path with which or type. The package may be absent. which / type / whereis — where a command lives
  • No such file or directory no such file or directory Check the path with ls and pwd. A relative path starts from the current directory. Basic file commands
  • The service failed to start job for … failed because The reason is in systemctl status <service> and journalctl -u <service> -n 50. journalctl — reading the systemd journal
  • The port is already in use address already in use ss -tlnp shows who holds the port. Stop it or take another port. ss — sockets and ports
  • No space left on the device no space left on device df -h shows free space, du -xh --max-depth=1 / shows the big directories. Disk space: df, du, inode
  • mount does not recognise the file system wrong fs type Most often the device has no file system yet, and lsblk -f shows an empty FSTYPE. Mount the partition, not the whole disk. Mounting and fstab
  • The disk has no partition table unrecognised disk label This is how a new disk looks. parted mklabel creates the table and erases any old one, so check the disk name with lsblk. fdisk and parted — partition a disk
  • The file was not attached as a loop device failed to set … loop device Only root can attach loop devices, so run it with sudo. losetup -a shows what is already attached. Loop device — a file as a disk
  • No access to the Docker service permission denied while trying to connect to the docker The Docker socket is open to root and the docker group. Run the command as sudo docker …. Docker — containers: running, ports, volumes, networks
  • The Docker service is not running cannot connect to the docker daemon Start it with sudo systemctl enable --now docker; systemctl status docker shows its state. Docker — containers: running, ports, volumes, networks
  • The host port is already taken port is already allocated sudo ss -tlnp shows who holds the port. The container was already created — remove it with docker rm and start again with another left-hand port in -p. Docker — containers: running, ports, volumes, networks
  • The old Docker builder runs the build legacy builder is deprecated It is a warning; the build goes on. The error, if any, is in the last lines of the output. Dockerfile — an image recipe and docker build
  • The image has no such program to run executable file not found in $path A common cause is an exec-form CMD written as one string. Split the words — ["httpd", "-f"] — and check that the image has the program. Dockerfile — an image recipe and docker build
  • The kernel buffer is closed to regular users read kernel buffer failed Ubuntu sets kernel.dmesg_restrict = 1 — read sudo dmesg -T or sudo journalctl -k. dmesg — kernel messages: OOM, disk and filesystem errors, segfaults
  • The process hit its open files limit too many open files Compare Max open files in /proc/<PID>/limits with the files in /proc/<PID>/fd; a service gets a higher limit from LimitNOFILE in a drop-in. ulimit and process limits: open files, processes, core
  • The kernel parameter was not changed — root is required permission denied on key The line with the new value was printed, but the value is unchanged. Repeat with sudo and check sysctl <name>. sysctl — kernel parameters at runtime
  • Any user can read the swap file insecure permissions Swap turns on, but narrow the permissions — sudo chmod 600 <file>. Memory and swap: free, available and the page cache
  • strace cannot attach to the process attach: ptrace On Ubuntu only your own children can be traced without root — sudo strace -p <PID>. strace — which system calls a process makes
  • systemd skipped a unit line unknown key name The key is in the wrong section or misspelt — check systemd-analyze verify <unit>. systemd
  • The new password failed the quality check bad password: The reason follows the colon (length, character classes, dictionary); pwscore helps pick a password first. PAM: login checks, password policy and lockout
  • The password was not changed — no tries left have exhausted maximum number of retries The quality check rejected every try (retry=3). Read the BAD PASSWORD reasons above and check a password with pwscore. PAM: login checks, password policy and lockout
  • The account is locked after failed logins the account is locked due to See the counter with sudo faillock --user <name>; lift the lock with --reset or wait for unlock_time. PAM: login checks, password policy and lockout
  • pam-auth-update leaves hand-edited files alone local modifications to /etc/pam.d The profile is not enabled. --force rebuilds common-* and wipes manual lines — add them again afterwards. PAM: login checks, password policy and lockout
  • sudo does not work inside a service with NoNewPrivileges "no new privileges" flag is set The no_new_privs flag forbids raising rights. Give the service what it needs through User=, a group or a capability. Service hardening: User=, ProtectSystem, NoNewPrivileges
  • The service did not start — the User= user does not exist status=217/user Create the user with useradd --system or set DynamicUser=yes. Service hardening: User=, ProtectSystem, NoNewPrivileges
  • setcap ran without root unable to set cap_setfcap Only root can give capabilities to files — repeat with sudo. Capabilities: root split into parts
  • This scan type requires root scan type which requires root SYN, UDP and OS scans send raw packets — run with sudo or keep the plain scan without -sS. nmap: which ports are visible from outside
  • nmap thinks the host is down host seems down The host did not answer the discovery probes. Check the address and repeat with -Pn to scan ports without the check. nmap: which ports are visible from outside
  • AppArmor denied the program access apparmor="denied" The line names the profile (profile), the path (name) and what was missing (denied_mask). Add the rule to the profile's local file. AppArmor
  • The PostgreSQL setting applies only after a restart cannot be changed without restarting the server After reload the old value stays (pending_restart = t). Run sudo systemctl restart postgresql. PostgreSQL — access, pg_hba.conf, dump and restore
  • Another user's crontab needs root must be privileged to use -u crontab -u <user> works only with sudo: sudo crontab -l -u <user>. Cron — the task scheduler
  • apt waits for the scheduled update to finish (unattended-upgr) unattended-upgrade holds the dpkg lock. Wait for it (systemctl status apt-daily-upgrade); do not kill it. unattended-upgrades: security updates with no one at the keyboard
  • The boot has not finished yet bootup is not yet finished Some boot job is still running — systemctl list-jobs shows which. systemd-analyze: what slows the boot and what is wrong in a unit
  • Units wait for each other in a circle transaction order is cyclic Two units have After= on each other — the journal shows Found ordering cycle; remove the extra After=. systemd-analyze: what slows the boot and what is wrong in a unit
  • The machine booted into emergency mode you are in emergency mode Most often an /etc/fstab line with a missing device. The cause is in journalctl -xb. Boot targets: default, multi-user, rescue and emergency
  • chronyc cannot reach chronyd 506 cannot talk to daemon The service is not running — systemctl status chrony. chrony: time synchronization over NTP
  • This chronyc command is for root only 501 not authorised makestep, burst, reload sources change the service — run them with sudo. chrony: time synchronization over NTP
  • The time cannot be set by hand while sync is on automatic time synchronization is enabled First sudo timedatectl set-ntp false, after the experiment — set-ntp true. timedatectl — time, time zone, and synchronization
  • systemd-timesyncd is not running org.freedesktop.timesync1 If chrony is installed, timesyncd is removed — chronyc tracking shows the state. chrony: time synchronization over NTP
  • The repository belongs to another user detected dubious ownership For a root-owned repository use sudo git. git: change history, undo and a remote repository
  • git has no author name and email author identity unknown Set them in the repository — git config user.name and git config user.email (with sudo for a root-owned one). git: change history, undo and a remote repository
  • pull refused because of a local change would be overwritten by merge Commit the change or shelve it with git stash, then git pull and git stash pop. git: change history, undo and a remote repository
  • push rejected — the remote has commits you do not (fetch first) … [rejected] git pull first, then git push again. git: change history, undo and a remote repository
  • The branches diverged, git does not know how to reconcile them reconcile divergent branches Merge with a merge commit — git pull --no-rebase. git: change history, undo and a remote repository
  • A conflict — both sides changed the same lines conflict (content) Keep what is needed between the <<<<<<</>>>>>>> markers, remove the markers and run git add <file>. git: change history, undo and a remote repository
  • The inventory has no such machines could not match supplied host pattern The inventory was not read or lacks the group from hosts: — check the -i path and --list-hosts. ansible-playbook: running a playbook
  • Ansible cannot find the module couldn't resolve module/action A typo in the module name — ansible-doc <module> shows whether it exists. ansible-playbook: running a playbook
  • notify calls a handler that does not exist the requested handler … was not found The name in notify must match the handler's name letter for letter. ansible-playbook: running a playbook
  • A template or task uses a variable that does not exist ansibleundefinedvariable Set it in vars:, the inventory or -e, or add | default(...). ansible-playbook: running a playbook
  • Ansible could not connect to the machine over SSH unreachable! … failed to connect to the host via ssh The cause is the ssh text in msg; check by hand with ssh <machine> true as the same user. Ansible: inventory, modules and one-off commands
  • The module lacks the rights destination … not writable The module is not running as root — add -b or become: true. Ansible: inventory, modules and one-off commands
  • systemd dropped a job to break a cycle deleted to break ordering cycle Two units wait for each other through After= — one service does not start. Jobs are in systemctl list-jobs. systemd-analyze: what slows the boot and what is wrong in a unit

Basic commands

Files and directories

Text and search

Users and permissions

Processes

Services and systemd

Network

Storage and file systems

Logs and audit

Boot

Packages

Security

Automation

Containers

Nothing found. Try a shorter query.

Loading…