Author Archives: Robins

[Solved] ERROR: child process failed, exited with error number 100To see additional information in this …

The error below occurs when mongodb is started. Check the log file and find:

exception in initAndListen std::exception: listen: Address already in use, terminating,

 

Possible errors:

1. Your conf file is incorrectly written, format or code, etc

2. Bindip binds both the localhost and the internal and external addresses of the server

Solution: check and write the file format, and pay attention to yaml format. Then, bindip directly accesses 0.0.0.0, allowing all access. It should be OK.

If viewing the log is this error:

Failed to set up listener: SocketException: Address already in use

ps aux | grep mongod
sudo kill -9 {port-number}

[Solved] Tensorflow Error: NameError: name ‘layers‘ is not defined

Error code:

 import tensorflow as tf
 net = layers.Dense(10)
 net.build((4, 10))
 net.kernel

NameError: name ‘layers’ is not defined

Error reason: TensorFlow does not load layers
Solution:

import tensorflow as tf
from tensorflow.keras import datasets, layers,optimizers
net = layers.Dense(10)
net.build((4, 10))
net.kernel

Operation results:

<tf.Variable 'kernel:0' shape=(10, 10) dtype=float32, numpy=
array([[ 0.22973484,  0.00857711, -0.21515384, -0.5346802 , -0.2584985 ,
         0.03767496,  0.22262502,  0.10832614,  0.12043941,  0.3197981 ],
       [ 0.12034583,  0.01719284, -0.37415868,  0.22801459,  0.49012756,
        -0.01656079, -0.02581853,  0.22888458, -0.3193212 , -0.23586014],
       [-0.50331104, -0.18943703,  0.47028244, -0.33412236,  0.04251152,
        -0.54133296,  0.23136115,  0.02571291, -0.36819634,  0.5134926 ],
       [-0.06907243,  0.33713734,  0.34277046,  0.24761981,  0.50419617,
        -0.20183799, -0.27459818, -0.34057558, -0.23564544,  0.34107167],
       [-0.51874346,  0.30625004,  0.07017416,  0.4792788 , -0.08462432,
         0.1762883 ,  0.47576356, -0.08242992,  0.0560475 ,  0.5385151 ],
       [-0.02134383,  0.02438915, -0.11708987,  0.26330394, -0.4951692 ,
         0.19778156, -0.1931901 , -0.41975048,  0.0376184 ,  0.23603398],
       [-0.20051709, -0.46164495,  0.15974921, -0.05227134,  0.14756906,
         0.12185448, -0.5285519 , -0.5298273 ,  0.14063555,  0.02481627],
       [-0.35953748,  0.30639488, -0.02970898, -0.5232449 , -0.10309196,
        -0.3557127 , -0.19765031,  0.3171267 ,  0.34930962, -0.15071085],
       [ 0.20013565,  0.11569405, -0.46884173, -0.40876222,  0.36319625,
         0.33609563,  0.2721032 , -0.04006624,  0.09699225,  0.20260221],
       [-0.03152204, -0.48894358,  0.3079273 , -0.5283493 , -0.44822672,
        -0.34838638,  0.41896552, -0.34962398, -0.24334553,  0.38500214]],
      dtype=float32)>

Problem solved.

TomcatJSON parse error: Invalid UTF-8 [How to Solve]

After deployment on the server, it is found that many places report 400 error, which has a unified feature of transmitting Chinese to the back-end interface

Solution:

1. configure the Tomcat server transmission encoding format specification:

Edit the tomcat/conf/server.xml file and add the encoding attribute: URIEncoding=”UTF-8″ to the Connector tag

2. Edit the tocmat/bin/catalina.bat file and add the following attribute: set JAVA_OPTS=%JAVA_OPTS% -Dfile.encoding=UTF-8

3. the most important step is to restart through shutdown and startup under the bin directory of Tomcat

Error: env [NODE_ENV] is not set (How to Solve)

Error: env [NODE_ENV] is not set

Encountered problem: running project reports error: env [node_env] is not set

Screenshot of the problem:

Solution idea, env in NODE_ENV is not set, resulting in process failure, so you can set the value of this NODE_ENV can be solved. Because it is someone else’s project, I took it over directly, so I searched NODE_ENV globally and found that NODE_ENV=development, so just set NODE_ENV to development.

Implementation method:

1. For Linux:

NODE_ENV=development node foo.js

2. For Windows

SET NODE_ENV=development
node foo.js

Write node foo according to the actual needs of the project JS, some projects can not be written

tips:

It is possible that in addition to the property NODE_ENV is not set, there are other values that are not set, for the same reason, you can set the corresponding value for this value

[Solved] Oracle 18C RAC Install Error: Error in invoking target ‘irman ioracle idrdactl idrdalsnr idrdaproc‘ of makefile

When installing 18C RAC, the GI installation is completed, and an error occurs when installing RDBMS:

Error in invoking target ‘irman ioracle idrdactl idrdalsnr idrdaproc’ of makefile ‘/u01/app/oracle/product/18.0.0.0/dbhome_1/rdbms/lib/ins_rdbms.mk’.

View the installation log:

18 -lctx18 -lzx18 -lgx18 -lctx18 -lzx18 -lgx18 -lordimt -lclscest18 -loevm -lclsra18 -ldbcfg18 -lhasgen18 -lskgxn2 -lnnzst18 -lzt18 -lxml18 -lgeneric18 -locr18 -locrb18 -locrutl18 -lhasgen18 -lskgxn2 -lnnzst18 -lzt18 -lxml18 -lgeneric18  -lgeneric18 -lorazip -loraz -llzopro5 -lorabz2 -lipp_z -lipp_bz2 -lippdcemerged -lippsemerged -lippdcmerged  -lippsmerged -lippcore  -lippcpemerged -lippcpmerged  -lsnls18 -lnls18  -lcore18 -lsnls18 -lnls18 -lcore18 -lsnls18 -lnls18 -lxml18 -lcore18 -lunls18 -lsnls18 -lnls1
INFO: 
8 -lcore18 -lnls18 -lsnls18 -lunls18  -lsnls18 -lnls18  -lcore18 -lsnls18 -lnls18 -lcore18 -lsnls18 -lnls18 -lxml18 -lcore18 -lunls18 -lsnls18 -lnls18 -lcore18 -lnls18 -lasmclnt18 -lcommon18 -lcore18  -ledtn18 -laio -lons  -lfthread18   `cat /u01/app/oracle/product/18.0.0.0/dbhome_1/lib/sysliblist` -Wl,-rpath,/u01/app/oracle/product/18.0.0.0/dbhome_1/lib -lm    `cat /u01/app/oracle/product/18.0.0.0/dbhome_1/lib/sysliblist` -ldl -lm   -L/u01/app/oracle/product/18.0.0.0/dbhome_1/lib `test -x /usr/bin/hugeedit
INFO: 
 -a -r /usr/lib64/libhugetlbfs.so && test -r /u01/app/oracle/product/18.0.0.0/dbhome_1/rdbms/lib/shugetlbfs.o && echo -Wl,-zcommon-page-size=2097152 -Wl,-zmax-page-size=2097152 -lhugetlbfs`


报错原因:
↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
***INFO: 
/usr/bin/ld:/u01/app/oracle/product/18.0.0.0/dbhome_1/lib//libodm18.so: file format not recognized; treating as linker script
/usr/bin/ld:/u01/app/oracle/product/18.0.0.0/dbhome_1/lib//libodm18.so:1: syntax error***

INFO: 
make: *** [/u01/app/oracle/product/18.0.0.0/dbhome_1/rdbms/lib/oracle] Error 1

INFO: End output from spawned process.
INFO: ----------------------------------
INFO: Exception thrown from action: make
Exception Name: MakefileException
Exception String: Error in invoking target 'irman ioracle idrdactl idrdalsnr idrdaproc' of makefile '/u01/app/oracle/product/18.0.0.0/dbhome_1/rdbms/lib/ins_rdbms.mk'. See '/u01/app/oraInventory/logs/InstallActions2022-08-11_03-59-03PM/installActions2022-08-11_03-59-03PM.log' for details.
Exception Severity: 1

From the log file, we know that it is due to a problem with the /u01/app/oracle/product/18.0.0.0/dbhome_1/lib//libodm18.so file, which is usually caused by a problem with the installation package.
According to the file format not recognized; treating as linker script keyword, there are also related articles on mos.
19c Installation Fails with error “libclntsh.so: file format not recognized; treating as linker script” (Doc ID 2631283.1)

Grid Infrastructure Installation Fail in 12.2.0.1 For Standalone And RAC with libodm12.so: file format not recognized; treating as linker script (Doc ID 2373904.1)

Solution:
Redownload the installation media (to be sure, do MD5 verification of the installation media before installation)

[Solved] Error–dubbo Connect zk Error: zookeeper not connected

Error Message:

Error creating bean with name 'dubboBootstrapApplicationListener': Initialization of bean failed; nested exception is java.lang.IllegalStateException: zookeeper not connected

 

Problem:
The project starts with the following error.
IllegalStateException: zookeeper not connected

Reason:
First of all, the default connection timeout for dubbo registration is 5 seconds.
And the zookeeper server I connected to was a little slow to access, which caused the connection to time out.

Solution:
Adjust the default registration time for dubbo to 200 seconds
The default registration timeout is 5 seconds
All others are 1 second
So I increased the timeout for other service calls as well.
If you only need to modify the registration timeout, just add or modify registry.

dubbo:
  registry:
    timeout: 200000
  service:
    timeout: 200000
  consumer: 
    timeout: 200000
  provider:
    timeout: 200000

[Solved] gawk: error while loading shared libraries: libreadline.so.4

While cross-compiling, I encountered gawk: error while loading shared libraries: libreadline.so.4: cannot open shared object file: No such file or directory. The current build environment is x86_64, Ubuntu 20.04, the target runtime environment is mips32. The first thing I thought of when I encountered this problem was to install this lib.

On Ubuntu, we can use the apt-file program to find out where this library is installed. If you don’t have apt-file installed on your system, you need to install apt-file first, and then run it as follows:

$sudo apt-file update
$sudo apt-file search libreadline.so.4   #find no results
$sudo apt-file search libreadline.so    #returns the following
lib32readline-dev: /usr/lib32/libreadline.so

lib32readline8: /lib32/libreadline.so.8

lib32readline8: /lib32/libreadline.so.8.0

libreadline-dev: /usr/lib/x86_64-linux-gnu/libreadline.so

libreadline-gplv2-dev: /usr/lib/x86_64-linux-gnu/libreadline.so

libreadline5: /lib/x86_64-linux-gnu/libreadline.so.5

libreadline5: /lib/x86_64-linux-gnu/libreadline.so.5.2

libreadline5-dbg: /usr/lib/debug/libreadline.so.5

libreadline5-dbg: /usr/lib/debug/libreadline.so.5.2

libreadline8: /lib/x86_64-linux-gnu/libreadline.so.8

libreadline8: /lib/x86_64-linux-gnu/libreadline.so.8.0

libreadline.so.4 is a very old library and is no longer available on Ubuntu’s library sources, but try the later versions. Since the source code is developed and compiled on 32bit centos, choose the 32bit library: lib32readline8.

Run as below:

$sudo apt install lib32readline8

After installation, enter the /lib32 directory and you can see libreadline.so.8 and libreadline.so.8.0.

lrwxrwxrwx 1 root root     18 Feb 25  2020 /lib32/libreadline.so.8 -> libreadline.so.8.0
-rw-r--r-- 1 root root 311884 Feb 25  2020 /lib32/libreadline.so.8.0

Then run:

$ sudo ln -sv /lib32/libreadline.so.8.0 /lib32/libreadline.so.4

In $ls -l you can see that the symbolic link has been created.

However, running the cross-compilation task still reports the same error. After posting this issue on stack overflow, someone left a comment below reminding me to fix not libreadline.so.4, but the gawk version being too old.

I ran $gawk which prompted no such command, so

$sudo apt install gawk

Then Enter $gawk –version to check the other version, and return

GNU Awk 5.0.1, API: 2.0 (GNU MPFR 4.0.2, GNU MP 6.2.0)

Enter $whereis gawk to find its installation path:

gawk: /usr/bin/gawk /usr/lib/x86_64-linux-gnu/gawk /usr/share/man/man1/gawk.1.gz

The path is /usr/bin, and running the cross-compile job again still gives the same error, which means that there is another gawk installed in a directory that is called first when running the cross-compile. And this directory is not in the $PATH, or if it is, it is after /usr/bin.

I found the possible installation directory of gawk in the configuration file of the source code to be compiled, cd to that directory, run $gawk, and report the same error, and here it is. Run the following command:

$cp /usr/bin/gawk gawk

Run gawk in the current directory again to confirm that it has been updated to the latest version.

Run cross compilation again without error. The problem has been solved.

[Solved] Resource compilation failed (Failed to compile values resource file…

Resource compilation failed (Failed to compile values resource file /home/fanbin/AndroidStudioProjects/BookTest/app/build/intermediates/incremental/debug/mergeDebugResources/merged.dir/values/values.xml. ]


Resource registered by this uri is not recognized (Settings | Languages & Frameworks | Schemas and DTDs)

Reason: In color.xml, the color resource does not contain “#”, i.e. #FF000000, which causes this compilation error!

as shown in the figure below, the # number is not added to line 6.

Note: there are other situations that may cause this error. 

[Solved] librosa Install Error: ImportError: DLL load failed: Could Not Found

CMD sends an error after executing the command PIP istall librosa:

from numba.core.typeconv import _typeconv
ImportError: DLL load failed: not found

The reason is that the versions of numba, llvmlite and resampy are conflicting and incompatible

Solution:
reinstall the compatible package

pip install llvmlite==0.31.0
pip install numba==0.48.0
pip install resampy== 0.3.0

The final versions of all libraries are shown in the following figure:

[Solved] MongoDB Insert Data Error: OperationFailure: Authentication failed…

pip uninstall pymongo
pip install pymongo==3.6

Enter the password
1. TypeError: ‘Collection’ object is not callable. If you meant to call the ‘authenticate’ method on a ‘Database’ object it is failing because no such method exists.

Can connect to its own mongodb database. I can but cannot insert data to the company server. You can insert data when running on someone else’s computer, so the key is your own environment. Either it is a mongodb version problem or a pymongo version problem.

ret = dbtable.insert_one(student)

2. OperationFailure: Authentication failed., Full error: {‘OK’: 0.0, ‘errmsg’: ‘authentication failed.’, ‘code’: 18, ‘codename’: ‘authenticationfailed.}
MongoDB inserts an error in data and authentication fails.

Solution:

Delete the latest version of pymongo. My MongoDB is also version 3.6

pip uninstall pymongo
pip install pymongo==3.6

[Solved] error: password authentication failed for user “postgres”

password authentication failed for user “postgres” with docker

Steps:

    1. 1. run the instruction to create a docker container.

docker run --rm --name test-postgres -p 5432:5432 -e POSTGRES_PASSWORD=pw -d postgres

    1. 2. run the following command in node code to connect to the database:
import pg from 'pg'
const { Pool } = pg
pool = new Pool({
   database: 'postgres',
   user: 'postgres',
   password: 'pw',
   port: 5432
})

The following error is thrown:
error: password authentication failed for user “postgres”

 

Cause analysis

Because Postgres has been installed locally, Postgres is automatically started when the system is started by default. When connecting to the database, the locally installed Postgres service is preferentially connected, so the connection fails.

 

Solution:

Open Window Task Manager, under Services you will see a postgres service running. Right-click to turn off the postgres service, open the Service window and double-click on the postgres service to set the Startup Type to Manual.
then


Other troubleshooting methods

Open the Terminal of the container

  1. Enter the following two commands to see if there is a problem with local host permissions.
    cd var/lib/postgresql/data
    cat pg_hba.conf
  2. To see if the default user is postgres.
    psql -U postgres -x -c "select * from current_user;"
  3. Check the password expiration date. rolvaliduntil no value means no expiration date.
    psql -h 127.0.0.1 -U postgres -d postgres
    SELECT * FROM pg_roles WHERE rolname='postgres';
  4. Try clearing docker’s columns and containers, and restarting docker