Errors and Solutions ๐คฌโก๏ธ๐ฅณ
March 25, 2021โข1,846 words
Common error messages, along with their solutions.
Saves me having to figure the same thing out twice.
Categories
Linux
โ Error running a shell script with systemd: Failed to execute command: Exec format error
โ
Solution:
- Caused by missing shebang at the start of the sh script
- Add the correct hash band identifier, e.g.
#!/bin/bash
โ Error: -bash: '\r': command not founxd
โ
Solution:
- Caused by Windows-style newline character
- Run
dos2unix
over the file
โ Error with pakepkg: Cannot find the fakeroot binary
โ
Install the base-devel package group: sudo pacman -S base-devel
โ Yarn Error: There are no scenarios; must have at least one.
โ
Caused by the wrong yarn being installed, lol. Just remove it and reinstall it
sudo apt remove yarn
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update && sudo apt install yarn
โน๏ธ Sources:
โ FAILED (unknown public key XXXXX) - One or more PGP signatures could not be verified
โ
Solution: Add the PGP public key to your keychain, gpg --recv-key [key ID]
โ Docker, Service failed to build: cgroups: cgroup mountpoint does not exist: unknown
โ
Temporary workaround:
sudo mkdir /sys/fs/cgroup/systemd
sudo mount -t cgroup -o none,name=systemd cgroup /sys/fs/cgroup/systemd
โ Cargo: Failed to parse lock file at: path/to/Cargo.lock
โ
This is often caused by using an older version of Cargo. rustup
can be used to update both Cargo and Rust to their latest versions. So just run: rustup update stable
โ Go: package build constraints exclude all Go files in...
โ
Caused by packages being incorrectly cached, just run: go clean -modcache
โ Pacman: [package-name]: [/usr/share/path/to/pakage@latest/file.compiled] exists in filesystem
This is caused by a file already existing, and Pacman not being intended to replace files. It usually happens when you've installed something manually, or using a third-party package manager, and hence it is not being tracked by Pacman.
โ Solutions:
Update Mirrors
Sometimes this can be fixed by simply updating the mirrors, with:
sudo pacman-mirrors --fasttrack && sudo pacman -Syyu
Move / Remove Conflicting File
If not, then you can identify which packages owns the offending file, with:
pacman -Qo /path/to/file
.
- If the package is managed by Pacman, then you can move is with
pacman -R
. - Or if it's not linked to anything then either move or remove the file manually (renaming the file to
*.backup
will enable you to roll back if needed).
Overwrite Files
Alternatively there's also an --overwrite
option, that will force Pacman to replace any conflicting files. E.g. sudo pacman -S [package-name] --overwrite '*'
. This is useful when your local database has been "lost", causing every single installed package to throw a "conflicts" error.
โน๏ธ For more information, see:
- https://bbs.archlinux.org/viewtopic.php?id=56373
- https://forum.manjaro.org/t/update-or-package-installation-returns-failed-to-commit-transaction-conflicting-files-filename-exists-in-filesystem/3598
A note for preventing this in the future: When using a third-party installer, always specify an alternative installation location, e.g. /home
, /opt
or /usr/local/
. But never install directly under /
or /usr
.
โ Pacman error: failed retrieving file '_' from _ Connection timed out after 10001 milliseconds
โ
Update mirrors: sudo pacman-mirrors --country United_Kingdom
โ Warning: High IOWait. Raspberry Pi 4, booted from a USB running incredibly slowly
โ
Run lsusb -t
if it shows usb-storage
, then UAS is not supported out of the box and you need to either enable it with quirks mode, or use a UAS-compatible drive.
โน๏ธ More Info:
- https://www.raspberrypi.org/forums/viewtopic.php?f=28&t=245931
- https://www.raspberrypi.org/documentation/hardware/raspberrypi/bcm2711_bootloader_config.md
โ Error: Using Powerlevel10k in ZSH on R Pi: gitstatus failed to initialize
โ Solution:
- Caused by the binary for the gitstatusd module (used to show git into by P10K) not being available for the current architecture
- There are two solutions:
- Either manually compile the binary, and set
GITSTATUS_DAEMON=/path/to/gitstatusd
in~/.zshrc
. See: https://github.com/romkatv/gitstatus/blob/master/README.md#compiling - Or, if you don't need git display, then just comment out
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS
from thevcs
section in~/.p10k.zsh
- Either manually compile the binary, and set
โน๏ธ More Info:
- https://github.com/romkatv/gitstatus/issues/73#issuecomment-548046415
- https://github.com/romkatv/powerlevel10k/issues/246#issuecomment-765509082
โ wget: WGETRC points to /home/user/.config/wget/wgetrc, which couldn't be accessed because of error: No such file or directory.
โ
Caused my missing config file, just: mkdir -p ~/.config/wget/ && touch ~/.config/wget/wgetrc
โ ".": Permission denied (os error 13)
โ sudo chown -R $(whoami) ./
โ /usr/lib/libc.so.6: version
GLIBC_2.34' not found`
โ
pacman -S glibc lib32-glibc
โ Running ssh-add shows: Error connecting to agent: Connection refused
โ
Start the SSH Agent, by running: eval "$(ssh-agent)"
โ Git error: only one config file at a time
โ unset GIT_CONFIG
โ Vercel site behind Cloudflare: err_too_many_redirects
โ In Cloudflare dashboard, select your site, and under SSL/TLS, set encryption to "Full"
Web Development
โ Flutter Web: No devices detected.
โ
Run which [browser-name]
, then store the path in CHROME_EXECUTABLE
environmental variable
E.g. in .zshrc: export CHROME_EXECUTABLE="/opt/brave.com/brave/brave-browser"
โ Node Sass does not yet support your current environment: Windows 64-bit with Unsupported runtime (88)
โ
Solution:
- Caused by node-sass's binaries being built for a for a different architecture
- To fix this, just run:
npm rebuild node-sass
โ TypeError: Cannot assign to read only property 'exports' of object '#' error
โ
Solution:
- Caused by using CommonJS syntax instead of ES Modules
- To fix it, just replace
module.exports = myFunc;
withexport default myFunc;
โ Error: Cannot find module './_baseValues'
โ Solution:
- Clearing the cache fixed this:
yarn cache clean
- If the issue persists, remove (
rm -rf node_modules\ yarn.lock
) and reinstall (yarn
) node_modules
โ Error: Gatsby.js randomly decides that it cannot find a certain dependency
- e.g.: No files matching '\x\x\x\node_modules\@gatsbyjs\x\x\x.js' were found.
โ
Solution: Remove the cache and restart. rm -rf .cache && yarn develop
โ 'React' was used before it was defined
โ
Solution: Within .eslintrc under rules
, disable the base rule, and add a TypeScript specific rule
- "no-use-before-define": "off",
- "@typescript-eslint/no-use-before-define": ["error"]
โ Error: Delete 'โ' prettier/prettier
โ
Solution:
- Either change VS Codes end of line sequence from LF to CRLF
- Or add endOfLine: 'auto'
into .prettierrc
โ JSX not allowed in files with extension '.tsx'
โ
In eslintrc
, under the rules
section, add:
- 'react/jsx-filename-extension': [2, { 'extensions': ['.js', '.jsx', '.ts', '.tsx'] }]
โ Start/ end value has mixed support, consider using flex-end instead
โ
When using flexbox layout, replace align-items: end;
with align-items: flex-end;
โ Project published to GitHub pages using GitHub actions shows as a 404 (even though code is correct)
โ
This seems to be a known reliability issues for new sites, and the following things (for some reason) help:
- Ensure that none of your files and sub-folders begin with an
_
, as GitHub / Jekyll ignores these - If you're not using Jekyll, then place a file called
.nojekyll
in your projects root - Remember that URLs are case-sensitive, ensure it's typed correctly, and that you're using
https
- Check an older version is not cached, try clearing your site data, appending a string after
?
in the URL, or use a different browser - Double check that GitHub pages is enabled, pointing to the correct branch, and that there are no errors in the Actions logs
- Ensure your index.html is valid, has a doctype, e.g.
<!DOCTYPE html>
, and doesn't include any non UTF-8 special characters - Push an empty commit to trigger a rebuild:
git commit --allow-empty -m "Trigger rebuild" && git push origin master
- If you bound your domain, before GH pages was deployed, then GitHub caches the broken domain, try removing and re-adding your domain
- Try deleting and re-creating GH Pages branch:
git checkout gh-pages && git push origin --delete gh-pages && git push origin
- Wait for a few hours... Sometimes this issue just fixes itself
- If nothing worked, then open a support ticket. This is a known issue with GitHub pages, and is usually quickly resolved by customer support from their end
โ Npm Install global modules fails: Missing write access in mac to /usr/local/lib/nodemodules
โ
Just update the permissions of global nodemodules
sudo chown -R $USER ~/.npm
sudo chown -R $USER /usr/lib/nodemodules
sudo chown -R $USER /usr/local/lib/nodemodules
โ npm ERR! code UNABLETOGETISSUERCERT_LOCALLY
โ
Run: npm config set registry http://registry.npmjs.org/
โ Yarn Error: unable to get local issuer certificate
โ
yarn config set "strict-ssl" false -g
โ go.mod file not found in current directory or any parent directory
โ
Run: go env -w GO111MODULE=off
Misc
โ Cargo error no such subcommand: 'make'
โ
Just install cargo make: cargo install --no-default-features --force cargo-make
โ Error on Windows: error during connect: This error may indicate that the docker daemon is not running.: Get http://%2F%2F.%2Fpipe%2Fdockerengine/v1.24/containers/json: open //./pipe/dockerengine: The system cannot find the file specified.
โ
Solution:
- Update the security permissions for the docker.exe file, to include "Users" (Right click --> Properties --> Security). This file is usually located in
C:\Program Files/Docker/Docker/
- Then restart Docker: As admin, run
Net stop com.docker.service
andNet start com.docker.service
Also, ensure that you have the latest version of Docker installed, and WSL is set to version 2 (with wsl --set-default-version 2
)
โ Docker inspect throws error on Windows: Template parsing error: template: :1: unclosed action
โ
Double quotes are required for the JSON keys, e.g. docker inspect --format="{{json .State.Health}}" my-container
โ VirtualBox in Windows shows error: VERR_CPUM_RAISE_GP_0 with WSL2
โ
Solution:
- As admin, run:
bcdedit /set hypervisorlaunchtype off
- Then shutdown and restart the PC with
shutdown -s -t 2
โ Ngrok throws an error with react dev server: Invalid Host Header
โ
Add the -host-header flag, e.g. ngrok http 8080 -host-header="localhost:8080"
โ Gimp: Unable to apply Rounded Corners (Filters --> Dรฉcor --> xx)
โ
Solution:
- Some filters cannot be used with an alpha layer.
- Right-click on the current layer, and "Remove Alpha Channel"
โ Ledger: Stuck on "Touch Security Key" using MetaMask on Windows with Ledger Nano X
โ
Solution:
- First, allow contract data in transactions (within the Eth app on the Ledger device)
- Disable Bluetooth, in order confirm transactions over USB (on Ledger's device Settings)
โ Ledger: On Linux, cannot detect device
โ
Solution: Install udev rules
- wget -q -O - https://raw.githubusercontent.com/LedgerHQ/udev-rules/master/add_udev_rules.sh | sudo bash
โ Listed.to - Custom domain does not work, even when DNS records are all correct
โ
Ensure that DNS records are not proxied through Cloudflare's servers
โ Standard Notes Linux - Unable to login, incorrect email and password even when correct
โ
Manually update the app to the latest version
โ Flutter Web - No devices found
โ
If you don't have Chrome installed, then you can use Chromium or any other Chromium-based browser instead. You'll need to set the CHROME_EXECUTABLE
environmental variable to point to it's executable so that Flutter can launch it.
E.g. export CHROME_EXECUTABLE=/usr/bin/brave