Errors and Solutions 🀬➑️πŸ₯³

Published by Alicia's Notes πŸš€, View original

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