Errors and Solutions ๐Ÿคฌโžก๏ธ๐Ÿฅณ

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:

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:


โŒ 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:

โ„น๏ธ More Info:


โŒ 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: versionGLIBC_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; with export 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 node
modules
sudo chown -R $USER ~/.npm
sudo chown -R $USER /usr/lib/nodemodules
sudo chown -R $USER /usr/local/lib/node
modules


โŒ 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 and Net 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



You'll only receive email when they publish something new.

More from Alicia's Notes ๐Ÿš€
All posts