Skip to content

Everyday error and fixesΒΆ

while yarn or npm install if you see python errorΒΆ

Install python version 2.7 and set environment path c:\python

For multiple node version try usingΒΆ

nvm

For errorsΒΆ

gyp verb check python checking for Python executable "python2" in the PATH gyp verbwhichfailed Error: not found: python2

Text Only
npm --add-python-to-path='true' --debug install --global windows-build-tools
npm install --global node-gyp

ReturnsAsync(null) creates a build error when using Moq for unit testΒΆ

There are two ReturnsAsync extension methods in Moq ReturnsExtensions class.They have following parameters: (this IReturns<TMock, Task<TResult>> mock, TResult value) (this IReturns<TMock, Task<TResult>> mock, Func<TResult> valueFunction)

To fix this error you need to help compiler choose correct method overload - cast null to type of task's result (e.g. string): ReturnsAsync((string)null) Or you can pass value which is null string s = null; ... ReturnsAsync(s); Alternatively, ReturnsAsync(default(string)) Or user anonymous function ReturnsAsync(() => null)

docker: Got permission denied while trying to connect to the Docker daemon socket at unixΒΆ

Bash
sudo chmod 666 /var/run/docker.sock

make usre you configure you 'user.name' and 'user.email' in git UbuntuΒΆ

Bash
git config --global user.email "ps@gmail.com"
git config --global user.name "PS"

If you see error while running python in docker tryΒΆ

https://code.visualstudio.com/updates/v1_36#_launch-terminals-with-clean-environments. set terminal.integrated.inheritEnv: false

Error: FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memoryΒΆ

Solution: export NODE_OPTIONS="--max-old-space-size=8192"

Error: Evaluated project metadata file could not be found for service ailgo.webΒΆ

Solution: Delete /obj folder from cs projects

If it doesn't work, sometime auto update in mac install dotnet preview version. So uninstall them or use the right version.

To uninstall

Bash
version="7.0.100-rc.2.22477.23"
sudo rm -rf /usr/local/share/dotnet/sdk/$version
sudo rm -rf /usr/local/share/dotnet/shared/Microsoft.NETCore.App/$version
sudo rm -rf /usr/local/share/dotnet/shared/Microsoft.AspNetCore.All/$version
sudo rm -rf /usr/local/share/dotnet/shared/Microsoft.AspNetCore.App/$version
sudo rm -rf /usr/local/share/dotnet/host/fxr/$version

Error

ERROR [internal] load metadata for docker.io/library

Example when building image on mac with image built on Windows OpenJDK maintained by Microsoft 8, 11, 17

Might need to specify the arch

Bash Session
docker build -t image_name --platform=linux/arm64 .

!!!error ubuntu stuck at Default Kerberos version 5 realm: Here are the two possible ways to set DEBIAN_FRONTEND:

Text Only
1 .Setting it via ARG as this is only available during build:
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get -qq install {your-package}

2. When required, setting it on-the-fly.

RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get -qq install {your-package}

Use DEBIAN_FRONTEND=noninteractive on install command
```console
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y python3 python3-pip curl wget gcc krb5-config libkrb5-dev git
```

!!!error ModuleNotFoundError: No module named: If encounter ModuleNotFoundError from container despite package is installed

Text Only
Add to Dockerfile
```console
ln -s /usr/bin/python3 /usr/bin/python && \
rm -rf /var/lib/apt/lists/*
```

To check if he package is installed
```pip list```

!!!error PSQLException : The connection attempt failed. postgres Solution: somehow hive requires posgres user and user role despite env variables and it keeps restarting during schema initialization. So, Create user and schema manually

Text Only
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/hive/lib/log4j-slf4j-impl-2.17.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/hadoop/share/hadoop/common/lib/slf4j-log4j12-1.7.30.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
Metastore connection URL:        jdbc:postgresql://postgres_db:5432/metastore
Metastore Connection Driver :    org.postgresql.Driver
Metastore connection User:       postgres
org.apache.hadoop.hive.metastore.HiveMetaException: Failed to get schema version.
Underlying cause: org.postgresql.util.PSQLException : The connection attempt failed.
SQL Error code: 0
org.apache.hadoop.hive.metastore.HiveMetaException: Failed to get schema version.
        at org.apache.hadoop.hive.metastore.tools.HiveSchemaHelper.getConnectionToMetastore(HiveSchemaHelper.java:94)
        at org.apache.hive.beeline.HiveSchemaTool.getConnectionToMetastore(HiveSchemaTool.java:169)
        at org.apache.hive.beeline.HiveSchemaTool.testConnectionToMetastore(HiveSchemaTool.java:475)
        at org.apache.hive.beeline.HiveSchemaTool.doInit(HiveSchemaTool.java:581)
        at org.apache.hive.beeline.HiveSchemaTool.doInit(HiveSchemaTool.java:567)
        at org.apache.hive.beeline.HiveSchemaTool.main(HiveSchemaTool.java:1517)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.apache.hadoop.util.RunJar.run(RunJar.java:323)
        at org.apache.hadoop.util.RunJar.main(RunJar.java:236)
Caused by: org.postgresql.util.PSQLException: The connection attempt failed.
        at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:262)
        at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:66)
        at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:215)
        at org.postgresql.Driver.makeConnection(Driver.java:406)
        at org.postgresql.Driver.connect(Driver.java:274)
        at java.sql.DriverManager.getConnection(DriverManager.java:664)
        at java.sql.DriverManager.getConnection(DriverManager.java:247)
        at org.apache.hadoop.hive.metastore.tools.HiveSchemaHelper.getConnectionToMetastore(HiveSchemaHelper.java:88)
        ... 11 more
Caused by: java.net.UnknownHostException: postgres_db
        at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:184)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
        at java.net.Socket.connect(Socket.java:607)
        at org.postgresql.core.PGStream.<init>(PGStream.java:64)
        at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:133)
        ... 18 more