Category Archives: Linux

[Solved] Web server failed to start. Port 8080 was already in use.

An error occurs when starting the jar package on the Linux server, as follows:

Description:
Web server failed to start. Port 8080 was already in use.
action:
identify and stop the process that’s listening on port 8080 or configure this application to listen on another port.
indicates that the web server failed to start and port 8080 is already in use. Check whether the last started task stopped

Solution steps:

1. Enter the bin directory
CD/usr/local/Tomcat/bin

2. Check whether Tomcat is closed
PS – EF | grep Java

3. Use the Tomcat shutdown command
./shutdown.sh (use with caution)
if you want to kill Tomcat directly, you can use the kill command to kill the process directly
kill – 9 7010

[Solved] Clone Linux Code Error: server certificate verification failed. CAfile: none CRLfile: none

The following error occurs in Git clone Linux source code:

Solution:

Enter in the terminal:

git config –global http.sslverify false
git config –global https.sslverify false

xport GIT_SSL_NO_VERIFY=1

Then the download is normal

Es Container Error: too many open files [How to Solve]

Phenomenon

Previously, a middleware was started with k8s cluster, which internally relies on ES for data storage. Looking at the log, we found that ES reported an error "too many open files

Solution:

Enter the container and execute ulimit - a to view the file handle limit of the current user. If it is found that it meets the requirements, the problem may only occur on the host machine. Execute cat/etc/sysctl.Conf to view the handle count configuration, as follows:

[root@test-node-01 ~]# cat /etc/sysctl.conf
vm.max_map_count=262144
fs.file-max=65536

65536 is much smaller than 104857 with log errors. The next step is to modify the number of handles of the host. There are two ways to modify: one is to modify the file of a single process, and the other is to modify the system configuration

Modify the number of file handles of a single process
to view the number of file handles that a process can open, you can use cat/proc/<pid>/Limits view. To dynamically modify the limits of a process, you can use the prlimit command. The specific usage is: prlimit -- PID ${PID} -- nofile = 102400:102400 the number of files can be defined by yourself.
for my es container, you can execute PS - EF | grep elasticsearch to find the PID of the ES process, My process PID is 23571 . Execute prlimit -- PID 23571 -- nofile = 104857 to modify the number of file handles of the 23571 process to 104857 modify the system configuration
modify the fs.file-max parameter under the/etc/sysctl.conf file, and execute the sysctl - P command to take effect, or modify the /etc/security/limits.conf configuration file

cat  /etc/security/limits.conf
*                soft    nproc          655350
*                hard    nproc          655350
*                soft    nofile         655350
*                hard    nofile         655350

How much should this value be set
priority (open file descriptors):
soft limit & lthard limit < kernel< the limit caused by the data structure used to achieve the maximum number of file descriptors
in fact, there is no specific limit on this value, but if the allocated value is too large, it will affect the system performance, so it should be balanced according to the specific application/etc/security/limits.conf is the limit on the number of handles at the user level, and /etc/sysctl. Conf is the kernel parameter at the system level

Petalinux-boot –jtag error [How to Solve]

petalinux-boot –jtag –u-boot –hw_server-url TCP:ubuntu:3121
Using the command as above will report an error similar to the one below.

Solution:
Set the compatibility of the virtual machine’s USB device to USB3.1, because the physical USB port my computer is connected to is USB3.1.

INFO: Sourcing build tools
INFO: Launching XSDB for file download and boot.
INFO: This may take a few minutes, depending on the size of your image.
rlwrap: warning: your KaTeX parse error: Expected ‘EOF’, got ‘#’ at position 170: … “name =~ “arm*#̲0″”. available …params(filter)”. available targets:$target_list””
(procedure “targets” line 177)
invoked from within
“targets -set -nocase -filter {name =~ “arm*#0”}”
(file “/tmp/tmp.tUZ8sEM2Wm” line 3)
INFO: The XSDB log is as follows

[Solved] Decompression error: tar: Error is not recoverable: exiting now

Tar: error is not recoverable: exiting now

[root@node04 soft]# tar -zxvf apache-tomcat-8.0.53-x64.tar.gz

Error message:

gzip: stdin has more than one entry–rest ignored tar: Child returned status 2 tar: Error is not recoverable: exiting now

Solution 1: remove the Z parameter and use tar – xvf to decompress

Find or report an error.

Solution 2: use the unzip command.

Problem-solving.

If you cannot use the unzip command, first follow:

yum install -y unzip zip

[Solved] error LNK2005: ___pInvalidArgHandler Already defined in libcmtd.lib(invarg.obj)

Started generation...
1>------ has been started: Project: Bosch_EDC7, Configuration: Debug Win32 ------
1>edc7.lib(Bosch_EDC7.obj) : MSIL .netmodule or module compiled with /GL found; link is being restarted with /LTCG; adding /LTCG to link command line to improve linker performance
1>LINK : warning LNK4075: ignore "/INCREMENTAL" (due to "/LTCG" specification)
1>Bosch_EDC7.obj : warning LNK4075: ignore "/EDITANDCONTINUE" (due to "/OPT:ICF" specification)
1>LIBCMT.lib(invarg.obj) : error LNK2005: ___pInvalidArgHandler has been defined in libcmtd.lib(invarg.obj)
1>LIBCMT.lib(invarg.obj) : error LNK2005: __initp_misc_invarg has been defined in libcmtd.lib(invarg.obj)
1>LIBCMT.lib(invarg.obj) : error LNK2005: __call_reportfault has been defined in libcmtd.lib(invarg.obj)
1>LIBCMT.lib(invarg.obj) : error LNK2005: __set_invalid_parameter_handler has been defined in libcmtd.lib(invarg.obj)
1>LIBCMT.lib(invarg.obj) : error LNK2005: __get_invalid_parameter_handler has been defined in libcmtd.lib(invarg.obj)
1>LIBCMT.lib(invarg.obj) : error LNK2005: __invoke_watson has been defined in libcmtd.lib(invarg.obj)
1>LIBCMT.lib(invarg.obj) : error LNK2005: "void __cdecl _invoke_watson(unsigned short const *,unsigned short const *,unsigned short const *, unsigned int,unsigned int)" (? _invoke_watson@@YAXPBG00II@Z) is already defined in libcmtd.lib(invarg.obj)
1>LIBCMT.lib(invarg.obj) : error LNK2005: __invalid_parameter has been defined in libcmtd.lib(invarg.obj)
1>LIBCMT.lib(invarg.obj) : error LNK2005: "void __cdecl _invalid_parameter(unsigned short const *,unsigned short const *,unsigned short const *, unsigned int,unsigned int)" (? _invalid_parameter@@YAXPBG00II@Z) is already defined in libcmtd.lib(invarg.obj)
1>nafxcw.lib(objcore.obj) : error LNK2005: "public: static struct CRuntimeClass const CObject::classCObject" (?classCObject@CObject@@ 2UCRuntimeClass@@B) is already defined in nafxcwd.lib(objcore.obj)
1>nafxcw.lib(objcore.obj) : error LNK2005: "public: virtual struct CRuntimeClass * __thiscall CObject::GetRuntimeClass(void)const " (? GetRuntimeClass@CObject@@UBEPAUCRuntimeClass@@XZ) already defined in nafxcwd.lib(objcore.obj)
1>nafxcw.lib(objcore.obj) : error LNK2005: "public: class CObject * __thiscall CRuntimeClass::CreateObject(void)" (?CreateObject@ CRuntimeClass@@QAEPAVCObject@@XZ) already defined in nafxcwd.lib(objcore.obj)
1>nafxcw.lib(objcore.obj) : error LNK2005: "public: int __thiscall CObject::IsSerializable(void)const " (?IsSerializable@CObject@@QBEHXZ) already defined in nafxcwd.lib(objcore.obj)
1>nafxcw.lib(objcore.obj) : error LNK2005: "public: int __thiscall CRuntimeClass::IsDerivedFrom(struct CRuntimeClass const *)const " (? IsDerivedFrom@CRuntimeClass@@QBEHPBU1@@Z) already defined in nafxcwd.lib(objcore.obj)
1>nafxcw.lib(objcore.obj) : error LNK2005: "public: int __thiscall CObject::IsKindOf(struct CRuntimeClass const *)const " (?IsKindOf@CObject@@@ QBEHPBUCRuntimeClass@@@Z) is already defined in nafxcwd.lib(objcore.obj)
1>nafxcw.lib(objcore.obj) : error LNK2005: "class CObject * __cdecl AfxDynamicDownCast(struct CRuntimeClass *,class CObject *)" (? AfxDynamicDownCast@@YAPAVCObject@@PAUCRuntimeClass@@PAV1@@Z) already defined in nafxcwd.lib(objcore.obj)
1>nafxcw.lib(objcore.obj) : error LNK2005: "void __stdcall AfxClassInit(struct CRuntimeClass *)" (?AfxClassInit@@@YGXPAUCRuntimeClass@@@Z) already defined in nafxcwd.lib(objcore.obj)
1>nafxcw.lib(winmain.obj) : error LNK2005: "class CWinApp * __stdcall AfxGetApp(void)" (?AfxGetApp@@YGPAVCWinApp@@XZ) is already defined in nafxcwd.lib(afxinl2 .obj) is defined in
1>LINK : warning LNK4098: Default library "LIBCMT" conflicts with other libraries; please use /NODEFAULTLIB:library
1>LINK : warning LNK4098: The default library "nafxcw.lib" conflicts with other libraries; please use /NODEFAULTLIB:library
1>D:\A-Working\VS10_Projects\Bosch_EDC7\Bosch_EDC7\Debug\Bosch_EDC7.exe : fatal error LNK1169: One or more multi-defined symbols found
1> The operation to generate the project "Bosch_EDC7.vcxproj" has been completed - failed.
========== Generated: 0 successful, 1 failed, 2 latest, 0 skipped ==========

Solution:
The reason is that in Debug mode, some libraries are used in conflict, we just ignore the conflicting libraries.
Project Project Properties —> Linker —> Input —> Ignore specific default libraries —>

nafxcw.lib;libcmt.lib

[Solved] Linux Error: tar: Error Is Not Recoverable: Exiting Now

Under the Linux operating system, download the xx.tar.gz file and execute tar -zxvf xx.tar.gz. The following errors occur during execution:

xxx.tar.gz: EOF tar with exception in archive file: error is not recoverable: exiting now

There are two solutions.

Solution 1: remove the Z in the decompression parameters and execute the command as tar – xvf xx.tar.gz.

The reason for this scheme is that the downloaded file is not “filtered and archived through gzip”, so adding the parameter Z cannot decompress normally but generally, this problem does not occur when downloading from the official website. Be sure to download the full version from the official website.

If the scheme still fails to decompress normally, try the second scheme.

Solution 2: re download or upload compressed files

this scheme is aimed at downloading compressed files that are not complete, that is, they are not downloaded normally. You can download it again in another way. For example, after downloading through WGet, the above problems occur during execution. You can try to download it directly on other machines, upload it to the target server, and then execute the above decompression command.

Win10 Start Linux error: Error: 0x800701bc WSL 2 [How to Solve]

Error: 0x800701bc WSL 2

Manual installation of wsl

Step 1 - Enable the Windows subsystem for Linux
Step 2 - Check the requirements to run WSL 2
Step 3 - Enable the virtual machine feature
Step 4 - Download the Linux kernel update package
Step 5 - Set WSL 2 as the default version
Step 6 - Install the selected Linux distribution

[Solved] error: ‘QStringLiteral’ was not declared in this scope

The following problem occurs with QT compilation:

error: ‘QStringLiteral’ was not declared in this scope
resmodel->setHorizontalHeaderLabels(QStringList()<<QStringLiteral(Name)<<QStringLiteral(Size));
^
QMetaObject::Connection connRet = QObject::connect(naManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(requestFinished(QNetworkReply*)));
error: ‘connRet’ was not declared in this scope
Q_ASSERT(connRet);
^
/usr/include/qt4/QtCore/qglobal.h:1940:32: note: in definition of macro ‘Q_ASSERT’
define Q_ASSERT(cond) ((!(cond)) ?qt_assert(#cond,FILE,LINE) : qt_noop())
error: ‘class QComboBox’ has no member named ‘setCurrentText’; did you mean ‘setCurrentIndex’?
CombBox->setCurrentText(curX);

There is a situation that is caused by using QT4 to compile code written in QT5 environment, some operating systems have both QT4, QT5, just switch to QT5 is fine
QT Creator “Tools” —- “Options” —- “build&run” – “Build Kit ( kit)”-“qt version” select QT5 on it

[Solved] Linux Error: mipsel-linux-gcc: fatal error: no input files

Error: “:mipsel-linux-gcc -DON_BGIAD_CLIENT -DINET_6 -I./…/include -I./…/common_modules/target/h -I./…/common_modules/gkgeneral/h -I./…/common_modules/gkconfig -I./…/common_modules -I./…/common_modules/msgexchange -I./…/common_modules/libntp/h -I./…/common_modules/libdhcp/h -I./…/common_modules/libppp/h -I./…/common_modules/libipv6/h -I./…/common_modules/libunixcomm -I./…/common_modules/gkmemoryshare -I./…/common_modules/dllist -I./…/app/uart_func -I./…/common_modules/libmqtt -DMY_DEF -D__DEVICE_IAD__ -D_MG6002W_L_ -DMT7628 -DDTU -g -fPIC -fno-builtin -Wall -c -D_GNU_SOURCE -c -o modbus_top.o
mipsel-linux-gcc: fatal error: no input files

Reason: make dep execution report error
Solution:
Re-make dep to check the error
Found that uart_config.h is missing half of the parentheses

[Solved] Jetson Nano catkin_make Error: internal compiler error

When Jetson Nano compiles with catkin_make, if the default is 4 threads (catkin_make -j4), internal compiler error is prone to occur. At this time, you can modify ~/.bashrc to change the number of threads compiled by the system to limit the maximum thread. Thus it compiles smoothly. Proceed as follows:
1. Open terminal

vim ~/.bashrc

2. Add the following command, n is the number of threads you want to set, for example, it is better to set it to 2 or less for Nano:

export ROS_PARALLEL_JOBS=-jn  # Nano n=2

3. Source it to take effect:

source ~/.bashrc

OK, you can experiment happily~