Author Archives: Robins

[Solved] HttpServlet Error: A child container failed during start

This mistake almost drove me crazy. When using httpservlet, an error is reported in the process of deploying to Tomcat.

Direct solution:

1. Close the project under deployment before deploying to Tomcat.

2.1 @WebServlet(urlPatterns = {"/tiger2","/tiger3"})

Note that when setting the access path here, do not forget to write the slash “/”.

Solve the above problems.

 

Apache : Error: Apache shutdown unexpectedly [How to Solve]

Apache: error: Apache shutdown unexpectedly (share my solution here)

-Error Description:

This error is usually that port 443 or port 80 is occupied, so the service cannot be started.


-Solution (1):

1. Use the command line to view the port occupation

netstat -ano

You can view the occupied port 80 or 443 according to the local address, and then find the corresponding PID

2. Use the PID just found to find the corresponding process in the task manager

3. Just finish the process

Note: since the process of each person occupying the port is different, it may also be the process of the system. Don’t end the process blindly here. It is suggested that Baidu take a look at what this process does


-Solution (2):

1. Open xampp and click config

Select service and port settings

Then change the main port and SSL port to the port number that is not occupied

2. Modify Apache configuration file

Open httpd Conf file

Find listen 80 and replace it with the port number of the main port modified above

Find servername localhost: 80 and replace 80 with the port number of the main port modified above

Then open httpd SSL conf

Find listen 443 and replace it with the port number of the SSL port modified above

Finally, close xampp, reopen it and start it again

[Solved] Hadoop Error: ERROR: Cannot set priority of namenode process

hadoop start error:
Starting namenodes on [733ec62951d5]
733ec62951d5: ERROR: Cannot set priority of namenode process 868
Starting datanodes
localhost: ERROR: Cannot set priority of datanode process 974
2022-01-15 13:56:41,689 ERROR conf.Configuration: error parsing conf core-site.xml

It was noticed that it was caused by an error in the core-site.xml configuration file. After modification, the correct core-site.xml configuration file is as follows.

?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!--
  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License. See accompanying LICENSE file.
-->

<!-- Put site-specific property overrides in this file. -->
<configuration>
<property>
        <name>fs.defaultFS</name>
        <value>hdfs://172.17.0.3:9000</value>
</property>
</configuration>

Correct HDFS site The XML configuration file is as follows:

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!--
  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License. See accompanying LICENSE file.
-->

<!-- Put site-specific property overrides in this file. -->
<configuration>
<property>
    <name>dfs.replication</name>
    <value>1</value>
</property>
</configuration>

[Solved] Ubuntu 18.04 Compile opencv-3.4.16 Error: “c++: internal compiler error: Killed (program cc1plus)”

Ubuntu 18.04 compiles opencv-3.4.16 with the command “make – J” and encounters the error “C + +: internal compiler error: killed (program cc1plus)”. In the system, there are 8 CPUs and 32GB memory, and 83 cc1plus processes are found. Check the help information of make, “- j [n], — jobs [= n] allow n jobs at once; infinite jobs with no arg.”, If there are no parameters, an unlimited number of worker processes are used. The previous command “make – J” can be compiled successfully on a 128GB server.

According to the following commands provided by C + +: internal compiler error, increase the switching space to 8GB. The same problem still exists.

#The size of count is the size of the increased swap space, 1M is the block size, so the space size is bs*count=8192MB
sudo dd if=/dev/zero of=/swapfile bs=1M count=8192 
# format the space into swap format just now
sudo mkswap /swapfile 
chmod 0600 /swapfile  
#Use the swap space you just created
sudo swapon /swapfile

After increasing the size of swap space, the space of KIB swap listed by the top command increases.

~/proj/slam$ top
top - 11:25:12 up 23:59,  7 users,  load average: 24.55, 70.32, 66.93
Tasks: 495 total,  19 running, 400 sleeping,   0 stopped,   0 zombie
%Cpu(s): 95.5 us,  4.4 sy,  0.1 ni,  0.0 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
KiB Mem : 32760356 total, 28245364 free,  3986600 used,   528392 buff/cache
KiB Swap:  9392120 total,  8107088 free,  1285032 used. 28321152 avail Mem

Then use the command “make – J 16” to recompile and complete the task successfully.

Some information in case of error is as follows:

[ 96%] Building CXX object modules/imgproc/CMakeFiles/opencv_test_imgproc.dir/test/test_resize_bitexact.cpp.o
[ 97%] Building CXX object modules/imgproc/CMakeFiles/opencv_test_imgproc.dir/test/test_smooth_bitexact.cpp.o
[ 97%] Building CXX object modules/imgproc/CMakeFiles/opencv_test_imgproc.dir/test/test_templmatch.cpp.o
[ 97%] Building CXX object modules/imgproc/CMakeFiles/opencv_test_imgproc.dir/test/test_thresh.cpp.o
[ 97%] Building CXX object modules/imgproc/CMakeFiles/opencv_test_imgproc.dir/test/test_subdivision2d.cpp.o
[ 97%] Building CXX object modules/imgproc/CMakeFiles/opencv_test_imgproc.dir/test/test_watershed.cpp.o
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
modules/videoio/CMakeFiles/opencv_test_videoio.dir/build.make:110: recipe for target 'modules/videoio/CMakeFiles/opencv_test_videoio.dir/test/test_ffmpeg.cpp.o' failed
make[2]: *** [modules/videoio/CMakeFiles/opencv_test_videoio.dir/test/test_ffmpeg.cpp.o] Error 4
make[2]: *** Waiting for unfinished jobs....
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
modules/core/CMakeFiles/opencv_perf_core.dir/build.make:590: recipe for target 'modules/core/CMakeFiles/opencv_perf_core.dir/perf/perf_math.cpp.o' failed
make[2]: *** [modules/core/CMakeFiles/opencv_perf_core.dir/perf/perf_math.cpp.o] Error 4
make[2]: *** Waiting for unfinished jobs....
modules/videoio/CMakeFiles/opencv_test_videoio.dir/build.make:62: recipe for target 'modules/videoio/CMakeFiles/opencv_test_videoio.dir/test/test_camera.cpp.o' failed
make[2]: *** [modules/videoio/CMakeFiles/opencv_test_videoio.dir/test/test_camera.cpp.o] Error 4
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
modules/calib3d/CMakeFiles/opencv_test_calib3d.dir/build.make:494: recipe for target 'modules/calib3d/CMakeFiles/opencv_test_calib3d.dir/test/test_fisheye.cpp.o' failed
make[2]: *** [modules/calib3d/CMakeFiles/opencv_test_calib3d.dir/test/test_fisheye.cpp.o] Error 4
make[2]: *** Waiting for unfinished jobs....
modules/objdetect/CMakeFiles/opencv_objdetect.dir/build.make:212: recipe for target 'modules/objdetect/CMakeFiles/opencv_objdetect.dir/src/qrcode.cpp.o' failed
make[2]: *** [modules/objdetect/CMakeFiles/opencv_objdetect.dir/src/qrcode.cpp.o] Error 4
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
CMakeFiles/Makefile2:3434: recipe for target 'modules/objdetect/CMakeFiles/opencv_objdetect.dir/all' failed
make[1]: *** [modules/objdetect/CMakeFiles/opencv_objdetect.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
modules/core/CMakeFiles/opencv_perf_core.dir/build.make:110: recipe for target 'modules/core/CMakeFiles/opencv_perf_core.dir/perf/opencl/perf_bufferpool.cpp.o' failed
make[2]: *** [modules/core/CMakeFiles/opencv_perf_core.dir/perf/opencl/perf_bufferpool.cpp.o] Error 4
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.

java.sql.SQLException: Error; uncategorized SQLException; SQL state [null]; error code [0];

Error Messages:
org.springframework.jdbc.UncategorizedSQLException: Error attempting to get column ‘user_photo’ from result set.  Cause: java.sql.SQLException: Error; uncategorized SQLException; SQL state [null]; error code [0]; Error; nested exception is java.sql.SQLException: Error

at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:89)

Solution:
Add two annotations to the corresponding entity class

//@Data Generate getter,setter ,toString and other functions
//@NoArgsConstructor Generate constructor without parameters
//@AllArgsConstructor //generate full-parameter constructor

Error: exec npm config get prefix ERROR: Command failed: npm config get prefix [How to Solve]

Error: exec NPM config get prefix error: command failed: NPM config get prefix — a solution to NPM error reporting

Directory error: exec NPM config get prefix error: command failed: NPM config get prefix — a solution to NPM error reporting content solution how error reporting occurs

Error content

node:internal/modules/cjs/loader:936
  throw err;
  ^

Error: Cannot find module 'process-nextick-args'
Require stack:
- C:\Users\wh2008112\AppData\Roaming\npm\node_modules\npm\node_modules\readable-stream\lib\_stream_readable.js
      ....

Solution:

Find NPM cache and NPM folder (previous version of NPM cache) in roaming folder

Roaming Directory:

C:\Users\Administrator\AppData\Roaming

Move NPM cache and NPM folder into nodejs folder

3. Check the NPM version, that is, solve the problem

npm -v

How do errors occur

In the process of NPM install failure, the NPM package was downgraded (down to 3.8, up to now the NPM version is 8.3.X). This problem occurred when upgrading again

It may be caused by the inconsistency between the old version of NPM and the new version of NPM cache directory. So that repeated redoing of nodejs can not be solved. You can only manually move the folder for operation.

[Solved] ImportError: ERROR: recursion is detected during loading of “cv2” binary extensions. Check OpenCV installation.

Error:
pyinstaller package and run exe error: “recursion is detected during loading of “cv2“ binary extensions.”
Traceback (most recent call last):
  File "Sy.py", line 15, in 
  File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
  File "cv2\__init__.py", line 180, in 
    bootstrap()
  File "cv2\__init__.py", line 152, in bootstrap
    native_module = importlib.import_module("cv2")
  File "importlib\__init__.py", line 126, in import_module
  File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
  File "cv2\__init__.py", line 180, in 
    bootstrap()
  File "cv2\__init__.py", line 75, in bootstrap
    raise ImportError('ERROR: recursion is detected during loading of "cv2" binary extensions. Check OpenCV installation.')
ImportError: ERROR: recursion is detected during loading of "cv2" binary extensions. Check OpenCV installation.

========================

Use pip to uninstall opencv, pip uninstall opencv ******* (the name of the specific opencv installation)
Go to the %:\python\Lib\site-packages% path (the path of the python installation) and delete the cv2 folder
Reinstall opencv with pip, pip install opencv****

========================

Solution (you can try in sequence).

1. reinstall cv2. (This is the answer more, most cases useful)

first pip unintall opencv-python , then pip intall opencv-python

2. set the environment variables.

3. lower cv2 version.

There is a compatibility problem between pyinstaller and cv2 version. I use pyinstaller is 4.7 (python3.8.0), cv2 is 4.5.4.58, the result is an error, lower the cv2 version to 4.5.1.48 and then package, it does not report an error.

========================

https://wiki.archlinux.org/index.php/Arch_Linux_Archive#How_to_downgrade_one_package

========================

open cmd and use pip to install a different version:

 pip install opencv-python==4.5.3.56

========================

opencv-python      4.5.5.62

========================

podman wsl2 Report Error After Windows is Restarted: ERRO[0000] error joining network namespace for container

1. error joining network namespace for container

If you restart windows without stopping the container first, there is a great probability that this problem will occur

 

Solution:

Stop the stopped container before starting the exited container You will be prompted that you cannot start, but now you can podman PS or continue to execute podman start to start the container. It’s amazing, isn’t it

podman stop $(podman ps 2>&1 | grep -oE 'for container [a-f0-9]+' | awk '$0=$NF')
podman start $(podman ps --format '{{.Names}}' --filter status=exited)

2. Error refreshing volume

Something like this

$ podman ps -a
ERRO[0000] Error refreshing volume 20115fd77826acd6308a6dceb6318062fcdae8e3626c7b3367de25d328e93a2f: error acquiring lock 1 for volume 20115fd77826acd6308a6dceb6318062fcdae8e3626c7b3367de25d328e93a2f: file exists
ERRO[0000] Error refreshing volume 74d3b3f07e31ce9baabd307ebfea62c0860aa2454babff744c04e828eb571b89: error acquiring lock 2 for volume 74d3b3f07e31ce9baabd307ebfea62c0860aa2454babff744c04e828eb571b89: file exists
ERRO[0000] Error refreshing volume fbbb149df2df1ed1ac1092976de6216e604ea773958ee812e3e24e0d1e635850: error acquiring lock 1 for volume fbbb149df2df1ed1ac1092976de6216e604ea773958ee812e3e24e0d1e635850: file exists
ERRO[0000] Error refreshing volume spec: error acquiring lock 1 for volume spec: file exists
CONTAINER ID  IMAGE   COMMAND  CREATED  STATUS  PORTS   NAMES

Solution

podman system renumber

MYSQL Startup Error: [ERROR] Aria engine is not enabled or did not start. The Aria engine must be enabled to

When using PHP to query MySQL database, the query speed is very slow. So I repeated the MySQL service on the server. As a result, the MySQL link was not available. It took several hours to solve it. Here is a summary of the solution

1. Error reporting

When I input the following startup command to start, I found that it could not be started

service mysqld start

MariaDB/MySQL cannot be started. The following error is reported in the log file:

[ERROR] Aria engine is not enabled or did not start. The Aria engine must be enabled to continue as mysqld was configured with --with-aria-tmp-tables

[ERROR] Aria engine is not enabled or did not start. The Aria engine must be enabled to continue as mysqld was configured with –with-aria-tmp-tables
Error Messages:

2. Reason

PLESK Upgrade Error,mysql Connect the database Error:


ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
...
Trying to start service mysql... failed
...
server.example.com systemd[1]: mariadb.service: main process exited, code=exited, status=1/FAILURE
server.example.com systemd[1]: Failed to start MariaDB 10.2.13 database server.
server.example.com systemd[1]: Unit mariadb.service entered failed state.
server.example.com systemd[1]: mariadb.service failed.

3. Solution

SSH connect to the server and enter the data directory, you can usually set the save path in my.cnf, and you can find centos7 9 + MariaDB path is /etc/MySQL/MariaDB conf.d/server.cnf):

Remove Aria_log_Control file:

cd /var/lib/mysql/
# Please replace aria_log_control, in case to report an error when you delete it.
mv aria_log_control aria_log_control.old
# restart
service mysqld restart 

If you can start, you can ignore the following commands and update Plesk:

plesk installer --select-release-current --reinstall-patch --upgrade-installed-components

[Solved] Docker Port Mapping or Container Startup Error: Error response from daemon: driver failed programming external connectivity on endpoint quirky_allen

Error Messages:
[root@localhost ~]# docker run -d -p 9000:80 centos:httpd /bin/sh -c /usr/local/bin/start.sh
d5b2bd5a7bc4895a973fe61efd051847047d26385f65c278aaa09e4fa31c4d76
docker: Error response from daemon: driver failed programming external connectivity on endpoint quirky_allen (6bda693d1143657e46bee0300276aa05820da2b21a3d89441e820d1a274c48b6): (iptables failed: iptables –wait -t nat -A DOCKER -p tcp -d 0/0 –dport 9000 -j DNAT –to-destination 172.17.0.2:80 ! -i docker0: iptables: No chain/target/match by that name.
(exit status 1)).
[root@localhost ~]# docker start d5b2bd5a7bc4
Error response from daemon: driver failed programming external connectivity on endpoint quirky_allen (4127da7466709fd45695a1fbe98e13c2ac30c2a554e18fb902ef5a03ba308438): (iptables failed: iptables –wait -t nat -A DOCKER -p tcp -d 0/0 –dport 9000 -j DNAT –to-destination 172.17.0.2:80 ! -i docker0: iptables: No chain/target/match by that name.
(exit status 1))
Error: failed to start containers: d5b2bd5a7bc4

 

Reason:

The custom chain DOCKER defined at the start of the docker service is cleared for some reason
Restart the docker service and regenerate the custom chain DOCKERs
Chain PREROUTING (policy ACCEPT)
target     prot opt source               destination
DOCKER     all  —  0.0.0.0/0            0.0.0.0/0            ADDRTYPE match dst-type LOCAL

Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
DOCKER     all  —  0.0.0.0/0           !127.0.0.0/8          ADDRTYPE match dst-type LOCAL

Chain POSTROUTING (policy ACCEPT)
target     prot opt source               destination
MASQUERADE  all  —  172.17.0.0/16        0.0.0.0/0
MASQUERADE  tcp  —  172.17.0.2           172.17.0.2           tcp dpt:8080

Chain DOCKER (2 references)
target     prot opt source               destination
RETURN     all  —  0.0.0.0/0            0.0.0.0/0
DNAT       tcp  —  0.0.0.0/0            0.0.0.0/0            tcp dpt:8888 to:172.17.0.2:8080
root@router:playbook#iptables -t nat -nL
Chain PREROUTING (policy ACCEPT)
target     prot opt source               destination
DOCKER     all  —  0.0.0.0/0            0.0.0.0/0            ADDRTYPE match dst-type LOCAL

Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
DOCKER     all  —  0.0.0.0/0           !127.0.0.0/8          ADDRTYPE match dst-type LOCAL

Chain POSTROUTING (policy ACCEPT)
target     prot opt source               destination
MASQUERADE  all  —  172.17.0.0/16        0.0.0.0/0
MASQUERADE  tcp  —  172.17.0.2           172.17.0.2           tcp dpt:8080

Chain DOCKER (2 references)
target     prot opt source               destination
RETURN     all  —  0.0.0.0/0            0.0.0.0/0
DNAT       tcp  —  0.0.0.0/0            0.0.0.0/0            tcp dpt:8888 to:172.17.0.2:8080

Solution:

Restart the docker service and then start the container
systemctl restart docker
docker start foo