Category Archives: Error

Max virtual memory areas vm.max_map_count [65530] is too low, increase to at least 

[2021-05-03T11:54:49,018][INFO ][o.e.p.PluginsService     ] [search-node1] loaded plugin [ingest-geoip]
[2021-05-03T11:54:49,018][INFO ][o.e.p.PluginsService     ] [search-node1] loaded plugin [ingest-user-agent]
[2021-05-03T11:54:52,096][INFO ][o.e.x.s.a.s.FileRolesStore] [search-node1] parsed [0] roles from file [/usr/share/elasticsearch/config/roles.yml]
[2021-05-03T11:54:52,684][INFO ][o.e.x.m.p.l.CppLogMessageHandler] [search-node1] [controller/89] [Main.cc@109] controller (64 bit): Version 6.6.1 (Build a033f1b9679cab) Copyright (c) 2019 Elasticsearch BV
[2021-05-03T11:54:53,296][INFO ][o.e.d.DiscoveryModule    ] [search-node1] using discovery type [zen] and host providers [settings]
[2021-05-03T11:54:53,875][INFO ][o.e.n.Node               ] [search-node1] initialized
[2021-05-03T11:54:53,875][INFO ][o.e.n.Node               ] [search-node1] starting ...
[2021-05-03T11:54:54,067][INFO ][o.e.t.TransportService   ] [search-node1] publish_address {192.168.0.108:9300}, bound_addresses {0.0.0.0:9300}
[2021-05-03T11:54:54,091][INFO ][o.e.b.BootstrapChecks    ] [search-node1] bound or publishing to a non-loopback address, enforcing bootstrap checks
ERROR: [1] bootstrap checks failed
[1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
[2021-05-03T11:54:54,115][INFO ][o.e.n.Node               ] [search-node1] stopping ...
[2021-05-03T11:54:54,140][INFO ][o.e.n.Node               ] [search-node1] stopped
[2021-05-03T11:54:54,140][INFO ][o.e.n.Node               ] [search-node1] closing ...
[2021-05-03T11:54:54,154][INFO ][o.e.n.Node               ] [search-node1] closed
[2021-05-03T11:54:54,156][INFO ][o.e.x.m.p.NativeController] [search-node1] Native controller process has stopped - no new native processes can be started

ERROR: [1] bootstrap checks failed
[1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least

 

Solution.

Add a line to the end of the /etc/sysctl.conf file
vm.max_map_count=262144
Run /sbin/sysctl -p to take effect immediately

Qt error: no matching function for call to ‘MainWindow::connect(QAction*&, void (QAction::*)

Error in QT compilation:

error: no matching function for call to 'MainWindow::connect(QAction*&, void (QAction::*)(bool), MainWindow* const, MainWindow::MainWindow(QWidget*)::__lambda0)'});

Error reason: QT software version is too low, lower than qt5.4.

Solution: add code to. Pro file:

CONFIG   += C++11

Problem solving.

ImportError: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.23‘ not found

ImportError: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.23’ not found (required by /data/ty19/miniconda3/envs/casrel/lib/python3.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so)

Reason: The current version of python is 3.7
Solution: lower the python version – use conda create -n py36 python=3.6.8 to create a new virtual environment

Springboot Run Error: java.lang.NoClassDefFoundError: org/eclipse/jetty/server/Handler

1. Problem description


Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
[APP_IS_UNDEFINED:10.164.194.116:0000] [,,,] 2021-05-05 10:08:54.933 ERROR 18128 [main] org.springframework.boot.SpringApplication Application run failed

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'xxlJobExecutor' defined in class path resource [com/haiercash/marketcontrol/schedule/config/XxlJobConfig.class]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/eclipse/jetty/server/Handler
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1778)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:593)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515)
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
	at org.springframework.beans.factory.support.AbstractBeanFactory$$Lambda$168/331510866.getObject(Unknown Source)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:843)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:877)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549)
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:142)
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775)
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:316)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248)
	at com.haiercash.marketcontrol.schedule.ScheduleApplication.main(ScheduleApplication.java:27)
	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:497)
	at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
	at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
	at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
	at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51)
Caused by: java.lang.NoClassDefFoundError: org/eclipse/jetty/server/Handler
	at com.xxl.job.core.rpc.netcom.jetty.server.JettyServer.start(JettyServer.java:23)
	at com.xxl.job.core.rpc.netcom.NetComServerFactory.start(NetComServerFactory.java:25)
	at com.xxl.job.core.executor.XxlJobExecutor.start(XxlJobExecutor.java:60)
	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:497)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1903)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1846)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1774)
	... 25 common frames omitted
Caused by: java.lang.ClassNotFoundException: org.eclipse.jetty.server.Handler
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:93)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 35 common frames omitted

[APP_IS_UNDEFINED:10.164.194.116:0000] [,,,] 2021-05-05 10:09:07.905 INFO 29248 [AsyncResolver-bootstrap-executor-0] com.netflix.discovery.shared.resolver.aws.ConfigClusterResolver Resolving eureka endpoints via configuration
[APP_IS_UNDEFINED:10.164.194.116:0000] [,,,] 2021-05-05 10:09:22.905 INFO 29248 [AsyncResolver-bootstrap-executor-0] com.netflix.discovery.shared.resolver.aws.ConfigClusterResolver Resolving eureka endpoints via configuration
^Z
[3]+  Stopped                 tail -f detail.2021-05-05.0.log

2. Solutions

gradle

// https://mvnrepository.com/artifact/org.eclipse.jetty/jetty-servlet
implementation group: 'org.eclipse.jetty', name: 'jetty-servlet', version: '9.4.35.v20201120'

maven

<!-- https://mvnrepository.com/artifact/org.eclipse.jetty/jetty-servlet -->
<dependency>
    <groupId>org.eclipse.jetty</groupId>
    <artifactId>jetty-servlet</artifactId>
    <version>9.4.35.v20201120</version>
</dependency>

Clion new method shows undefined reference to solution

Clion new method shows undefined reference to solution

Problem solving

problem

"D:\cSoftware\CLion 2019.1.4\bin\cmake\win\bin\cmake.exe" --build D:\site\c\sm2\cmake-build-debug --target sm2 -- -j 4
-- Configuring done
-- Generating done
-- Build files have been written to: D:/site/c/sm2/cmake-build-debug
Scanning dependencies of target sm2
[ 50%] Linking C executable sm2.exe
d:/csoftware/mingw/mingw/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\sm2.dir/objects.a(main.c.obj): in function `main':
D:/site/c/sm2/main.c:6: undefined reference to `add'
collect2.exe: error: ld returned 1 exit status
mingw32-make.exe[3]: *** [CMakeFiles\sm2.dir\build.make:85: sm2.exe] Error 1
mingw32-make.exe[2]: *** [CMakeFiles\Makefile2:72: CMakeFiles/sm2.dir/all] Error 2
mingw32-make.exe[1]: *** [CMakeFiles\Makefile2:84: CMakeFiles/sm2.dir/rule] Error 2
mingw32-make.exe: *** [Makefile:130: sm2] Error 2

File addfunction. H

#include <stdio.h>
int add(int a,int b);

File addfunction. C

#include <stdio.h>
#include "addfunction.h"

int add(int a,int b){
    return a+b;
}

main.c

#include <stdio.h>
#include "addfunction.h"

int main() {
    int a = 1,b =2;
    int c = add(a,b);   //Here is a call to the add function in function.c
    printf("c=%d",c);
    return 0;
}

terms of settlement

Modify cmakelists.txt
and add_ Library and target_ link_ libraries

cmake_minimum_required(VERSION 3.14)
project(sm2 C)

set(CMAKE_C_STANDARD 99)

add_library(sm2lib addfunction.h addfunction.c)
add_executable(sm2 main.c)
target_link_libraries(sm2 sm2lib)

g++: internal compiler error: Killed (program cc1plus) Please submit a full bug report, with preprocess

In./build.py   When I met a mistake:


G + +: internal compiler error: program cc1plus please submit a full bug report, with preprocessed source if appropriate

See < file:///usr/share/doc/gcc-7/README.Bugs> for instructions.   Waf: Leaving directory `/home/d/tarballs/ns-allinone-3.28/ns-3.28/build’


The reason is that there is not enough memory. After reading many problems solved by inputting the command line, we failed to solve them. Later, we found that it is OK to directly expand the memory outside the virtual machine

1. Open virtual machine settings

2. This virtual machine needs more memory

3. Then open the virtual machine build

How to Solve Error: Module did not self-register

1. Error description

[scss/sass] 14:56:38.373 internal/modules/cjs/loader.js:717
[scss/sass] 14:56:38.373   return process.dlopen(module, path.toNamespacedPath(filename));
[scss/sass] 14:56:38.373                  ^
[scss/sass] 14:56:38.373 Error: Module did not self-register.
[scss/sass] 14:56:38.373     at Object.Module._extensions..node (internal/modules/cjs/loader.js:717:18)
[scss/sass] 14:56:38.373     at Module.load (internal/modules/cjs/loader.js:598:32)
[scss/sass] 14:56:38.373     at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
[scss/sass] 14:56:38.373     at Function.Module._load (internal/modules/cjs/loader.js:529:3)
[scss/sass] 14:56:38.373     at Module.require (internal/modules/cjs/loader.js:636:17)
[scss/sass] 14:56:38.373     at require (internal/modules/cjs/helpers.js:20:18)
[scss/sass] 14:56:38.373     at module.exports (G:\HBuilderX\plugins\compile-node-sass\node_modules\node-sass-china\lib\binding.js:19:10)
[scss/sass] 14:56:38.373     at Object.<anonymous> (G:\HBuilderX\plugins\compile-node-sass\node_modules\node-sass-china\lib\index.js:14:35)
[scss/sass] 14:56:38.373     at Module._compile (internal/modules/cjs/loader.js:688:30)
[scss/sass] 14:56:38.373     at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)

2. Error reason
The error message is that the module is not registered and installed with NPM Install, but the result is still an error, indicating that the module has not been successfully installed

G:\HBuilderX\plugins\compile-node-sass\node_modules\node-sass-china\vendor\win32
-x64-64>npm install

> [email protected] install G:\HBuilderX\plugins\compile-node-sass\node_modu
les\node-sass-china
> node scripts/install.js

node-sass build Binary found at G:\HBuilderX\plugins\compile-node-sass\node_modu
les\node-sass-china\vendor\win32-x64-64\binding.node

> [email protected] postinstall G:\HBuilderX\plugins\compile-node-sass\node_
modules\node-sass-china
> node scripts/build.js

Binary found at G:\HBuilderX\plugins\compile-node-sass\node_modules\node-sass-ch
ina\vendor\win32-x64-64\binding.node
Testing binary
Binary has a problem: Error: \\?\G:\HBuilderX\plugins\compile-node-sass\node_mod
ules\node-sass-china\vendor\win32-x64-64\binding.node is not a valid Win32 appli
cation.
\\?\G:\HBuilderX\plugins\compile-node-sass\node_modules\node-sass-china\vendor\w
in32-x64-64\binding.node
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:717:18)
    at Module.load (internal/modules/cjs/loader.js:598:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
    at Function.Module._load (internal/modules/cjs/loader.js:529:3)
    at Module.require (internal/modules/cjs/loader.js:636:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at module.exports (G:\HBuilderX\plugins\compile-node-sass\node_modules\node-
sass-china\lib\binding.js:19:10)
    at Object.<anonymous> (G:\HBuilderX\plugins\compile-node-sass\node_modules\n
ode-sass-china\lib\index.js:14:35)
    at Module._compile (internal/modules/cjs/loader.js:688:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
Building the binary locally
Building: F:\nodejs\node.exe G:\HBuilderX\plugins\compile-node-sass\node_modules
\node-sass-china\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsa
ss_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [ 'F:\\nodejs\\node.exe',
gyp verb cli   'G:\\HBuilderX\\plugins\\compile-node-sass\\node_modules\\node-sa
ss-china\\node_modules\\node-gyp\\bin\\node-gyp.js',
gyp verb cli   'rebuild',
gyp verb cli   '--verbose',
gyp verb cli   '--libsass_ext=',
gyp verb cli   '--libsass_cflags=',
gyp verb cli   '--libsass_ldflags=',
gyp verb cli   '--libsass_library=' ]
gyp info using [email protected]
gyp info using [email protected] | win32 | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` failed Error: not found: python2
gyp verb `which` failed     at getNotFoundError (G:\HBuilderX\plugins\compile-no
de-sass\node_modules\node-sass-china\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (G:\HBuilderX\plugins\compile-node-sass\node_mo
dules\node-sass-china\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (G:\HBuilderX\plugins\compile-node-sass\node_mo
dules\node-sass-china\node_modules\which\which.js:80:29)
gyp verb `which` failed     at G:\HBuilderX\plugins\compile-node-sass\node_modul
es\node-sass-china\node_modules\which\which.js:89:16
gyp verb `which` failed     at G:\HBuilderX\plugins\compile-node-sass\node_modul
es\node-sass-china\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at G:\HBuilderX\plugins\compile-node-sass\node_modul
es\node-sass-china\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:154:21)
gyp verb `which` failed  python2 { Error: not found: python2
gyp verb `which` failed     at getNotFoundError (G:\HBuilderX\plugins\compile-no
de-sass\node_modules\node-sass-china\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (G:\HBuilderX\plugins\compile-node-sass\node_mo
dules\node-sass-china\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (G:\HBuilderX\plugins\compile-node-sass\node_mo
dules\node-sass-china\node_modules\which\which.js:80:29)
gyp verb `which` failed     at G:\HBuilderX\plugins\compile-node-sass\node_modul
es\node-sass-china\node_modules\which\which.js:89:16
gyp verb `which` failed     at G:\HBuilderX\plugins\compile-node-sass\node_modul
es\node-sass-china\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at G:\HBuilderX\plugins\compile-node-sass\node_modul
es\node-sass-china\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:154:21)
gyp verb `which` failed   stack:
gyp verb `which` failed    'Error: not found: python2\n    at getNotFoundError (
G:\\HBuilderX\\plugins\\compile-node-sass\\node_modules\\node-sass-china\\node_m
odules\\which\\which.js:13:12)\n    at F (G:\\HBuilderX\\plugins\\compile-node-s
ass\\node_modules\\node-sass-china\\node_modules\\which\\which.js:68:19)\n    at
 E (G:\\HBuilderX\\plugins\\compile-node-sass\\node_modules\\node-sass-china\\no
de_modules\\which\\which.js:80:29)\n    at G:\\HBuilderX\\plugins\\compile-node-
sass\\node_modules\\node-sass-china\\node_modules\\which\\which.js:89:16\n    at
 G:\\HBuilderX\\plugins\\compile-node-sass\\node_modules\\node-sass-china\\node_
modules\\isexe\\index.js:42:5\n    at G:\\HBuilderX\\plugins\\compile-node-sass\
\node_modules\\node-sass-china\\node_modules\\isexe\\windows.js:36:5\n    at FSR
eqWrap.oncomplete (fs.js:154:21)',
gyp verb `which` failed   code: 'ENOENT' }
gyp verb check python checking for Python executable "python" in the PATH
gyp verb `which` succeeded python E:\Python\Python36\python.EXE
gyp ERR! configure error
gyp ERR! stack Error: Command failed: E:\Python\Python36\python.EXE -c import sy
s; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack   File "<string>", line 1
gyp ERR! stack     import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack                                ^
gyp ERR! stack SyntaxError: invalid syntax
gyp ERR! stack
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:289:12)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at maybeClose (internal/child_process.js:962:16)
gyp ERR! stack     at Socket.stream.socket.on (internal/child_process.js:381:11)

gyp ERR! stack     at Socket.emit (events.js:182:13)
gyp ERR! stack     at Pipe._handle.close (net.js:606:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "F:\\nodejs\\node.exe" "G:\\HBuilderX\\plugins\\compile-node-sa
ss\\node_modules\\node-sass-china\\node_modules\\node-gyp\\bin\\node-gyp.js" "re
build" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--
libsass_library="
gyp ERR! cwd G:\HBuilderX\plugins\compile-node-sass\node_modules\node-sass-china

gyp ERR! node -v v10.13.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Build failed with error code: 1
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional log
ging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     F:\nodejs\node_cache\_logs\2019-01-10T07_40_54_700Z-debug.log

G:\HBuilderX\plugins\compile-node-sass\node_modules\node-sass-china\vendor\win32
-x64-64>

3. Solutions
Uninstall and reinstall Sass related modules

C:\Users\Administrator.USER-0GUONPPBHK>npm uninstall node-sass -D
npm WARN Administrator.USER-0GUONPPBHK No repository field.
npm WARN Administrator.USER-0GUONPPBHK No license field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fse
vents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@
1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}
)

added 33 packages from 16 contributors, removed 22 packages and updated 340 pack
ages in 26.067s

C:\Users\Administrator.USER-0GUONPPBHK>npm install node-sass -D

> [email protected] install C:\Users\Administrator.USER-0GUONPPBHK\node_modules\n
ode-sass
> node scripts/install.js

Cached binary found at F:\nodejs\node_cache\node-sass\4.11.0\win32-x64-64_bindin
g.node

> [email protected] postinstall C:\Users\Administrator.USER-0GUONPPBHK\node_modul
es\node-sass
> node scripts/build.js

Binary found at C:\Users\Administrator.USER-0GUONPPBHK\node_modules\node-sass\ve
ndor\win32-x64-64\binding.node
Testing binary
Binary is fine
npm WARN [email protected] requires a peer of vue@^2.5.2 but none is installed. Y
ou must install peer dependencies yourself.
npm WARN [email protected] requires a peer of vue@^2.5.0 but none is installed.
 You must install peer dependencies yourself.
npm WARN Administrator.USER-0GUONPPBHK No repository field.
npm WARN Administrator.USER-0GUONPPBHK No license field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fse
vents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@
1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}
)

+ [email protected]
added 110 packages from 118 contributors in 26.774s

C:\Users\Administrator.USER-0GUONPPBHK>

 

Node.js operation mysql error Cannot enqueue Handshake after invoking quit

Error Background:
When the database operation is performed for the first time, it is successful. The second time a database operation is performed, an error is reported as shown in the title.
The reason:
This is because after we close the connection with the.end() method, we need to re-call createConnection to recreate a connection.
Solutions:
For example, the following encapsulates a method that operates on database queries and additions. Each time a new connection is created using mysql.createconnection () before the database operation is performed, instead of putting it directly to the outermost layer.

var mysql  = require('mysql');  
exports.find=function(findSql,callback){
    var connection = mysql.createConnection({     
        host     : 'localhost',       
        user     : 'root',              
        password : '123456', 
        port: '3306',                   
        database: 'namesharing',
    });
    connection.connect();
    connection.query(findSql,function (err, result) {
        if(err){
          console.log('[SELECT ERROR] - ',err.message);
          return;
        }
        connection.end();
        callback(result)
    });
}


exports.insert=function(addSql,addSqlParams,callback){
    var connection = mysql.createConnection({     
        host     : 'localhost',       
        user     : 'root',              
        password : '123456',       
        port: '3306',                   
        database: 'namesharing',
    });
    connection.connect();
    connection.query(addSql,addSqlParams,function (err, result) {
        if(err){
            console.log('[INSERT ERROR] - ',err.message);
            return;
        }
        connection.end();
        // console.log('INSERT ID:',result);  
        callback(result)
    });
}

 

[Android Error] java.lang.RuntimeException: An error occurred while executing doInBackground()

Recently, a bug was added to the task list to be resolved in this sprint. The stack information of the bug is as follows:

Fatal Exception: java.lang.RuntimeException: An error occurred while executing doInBackground()
       at android.os.AsyncTask$3.done(AsyncTask.java:353)
       at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383)
       at java.util.concurrent.FutureTask.setException(FutureTask.java:252)
       at java.util.concurrent.FutureTask.run(FutureTask.java:271)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
       at java.lang.Thread.run(Thread.java:764)
Caused by java.lang.SecurityException: Caller no longer running, last stopped +25s437ms because: timed out while starting
       at android.os.Parcel.readException(Parcel.java:1942)
       at android.os.Parcel.readException(Parcel.java:1888)
       at android.app.job.IJobCallback$Stub$Proxy.dequeueWork(IJobCallback.java:191)
       at android.app.job.JobParameters.dequeueWork(JobParameters.java:196)
       at android.support.v4.app.JobIntentService$JobServiceEngineImpl.dequeueWork(JobIntentService.java:309)
       at android.support.v4.app.JobIntentService.dequeueWork(JobIntentService.java:627)
       at android.support.v4.app.JobIntentService$CommandProcessor.doInBackground(JobIntentService.java:384)
       at android.support.v4.app.JobIntentService$CommandProcessor.doInBackground(JobIntentService.java:377)
       at android.os.AsyncTask$2.call(AsyncTask.java:333)
       at java.util.concurrent.FutureTask.run(FutureTask.java:266)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
       at java.lang.Thread.run(Thread.java:764)

According to the above bug information, it can be known that the system JobIntentService, AsyncTask doInBackground is called, while doInBackground calls dequeueWork. The following is the source code (source code of androidx 1.1.0) :

final class CommandProcessor extends AsyncTask<Void, Void, Void> {
    @Override
    protected Void doInBackground(Void... params) {
        GenericWorkItem work;

        if (DEBUG) Log.d(TAG, "Starting to dequeue work...");

        while ((work = dequeueWork()) != null) {
            if (DEBUG) Log.d(TAG, "Processing next work: " + work);
            onHandleWork(work.getIntent());
            if (DEBUG) Log.d(TAG, "Completing work: " + work);
            work.complete();
        }

        if (DEBUG) Log.d(TAG, "Done processing work!");

        return null;
    }

dequeueWork() source code is as follows, let’s focus on mJobImpl! = null part, will enter mjobimpl.dequeuework () part:


    GenericWorkItem dequeueWork() {
        if (mJobImpl != null) {
            return mJobImpl.dequeueWork();
        } else {
            synchronized (mCompatQueue) {
                if (mCompatQueue.size() > 0) {
                    return mCompatQueue.remove(0);
                } else {
                    return null;
                }
            }
        }
    }

mJobImpl is actually a , CompatJobEngine, source code and is the implementation class JobServiceEngineImpl as follows:

	interface CompatJobEngine {
   		 IBinder compatGetBinder();
    	GenericWorkItem dequeueWork();
    }

	@RequiresApi(26)
	 static final class JobServiceEngineImpl extends JobServiceEngine
        implements JobIntentService.CompatJobEngine {
	 @Override
        public JobIntentService.GenericWorkItem dequeueWork() {
            JobWorkItem work;
            synchronized (mLock) {
                if (mParams == null) {
                    return null;
                }
                work = mParams.dequeueWork();
            }
            if (work != null) {
                work.getIntent().setExtrasClassLoader(mService.getClassLoader());
                return new WrapperWorkItem(work);
            } else {
                return null;
            }
        }
    }

As you can see from the bug information at the beginning of the article, it goes to mparams.dequeuework (); Binder, then enter the Binder mechanism, the source code is as follows, so we can conclude that there is a problem here, throwing an exception, but because this is part of the source code, it should not be our responsibility.

	public @Nullable JobWorkItem dequeueWork() {
    try {
        return getCallback().dequeueWork(getJobId());
    } catch (RemoteException e) {
        throw e.rethrowFromSystemServer();
    }
}
		/** @hide */
    @UnsupportedAppUsage
    public IJobCallback getCallback() {
        return IJobCallback.Stub.asInterface(callback);
    }

After query source, found that the problem appeared in the framework layer, and there are already online issue of the problem: https://github.com/evernote/android-job/issues/255

https://issuetracker.google.com/issues/63622293 online encounter this kind of problem a lot of a lot of people, but so far, I have checked the latest Google androidx library ("androidx.core:core-ktx:1.2.0-rc01") and still haven’t solved this problem. App . In this package, a new class SafeJobIntentService</code b> is inserted into the JobIntentService. The reason for this is that the dequeueWork() method is not public. We have to write in the same package to override its methods and fix bugs.

@RestrictTo({Scope.LIBRARY})
public abstract class SafeJobIntentService extends JobIntentService {
    public SafeJobIntentService() {
    }

    GenericWorkItem dequeueWork() {
        try {
            return super.dequeueWork();//1 Here we do a try/catch operation on this method
        } catch (SecurityException var2) {
            var2.printStackTrace();
            return null;
        }
    }

    public void onCreate() {
        super.onCreate();
        if (VERSION.SDK_INT >= 26) {
            this.mJobImpl = new SafeJobServiceEngineImpl(this);
        } else {
            this.mJobImpl = null;
        }
    }
}

@RequiresApi(26)
public class SafeJobServiceEngineImpl extends JobServiceEngine implements CompatJobEngine {
    static final String TAG = "JobServiceEngineImpl";
    static final boolean DEBUG = false;
    final JobIntentService mService;
    final Object mLock = new Object();
    JobParameters mParams;

    SafeJobServiceEngineImpl(JobIntentService service) {
        super(service);
        this.mService = service;
    }

    public IBinder compatGetBinder() {
        return this.getBinder();
    }

    public boolean onStartJob(JobParameters params) {
        this.mParams = params;
        this.mService.ensureProcessorRunningLocked(false);
        return true;
    }

    public boolean onStopJob(JobParameters params) {
        boolean result = this.mService.doStopCurrentWork();
        synchronized(this.mLock) {
            this.mParams = null;
            return result;
        }
    }

    public GenericWorkItem dequeueWork() {
        JobWorkItem work = null;
        synchronized(this.mLock) {
            if (this.mParams == null) {
                return null;
            }

            try {
                work = this.mParams.dequeueWork();
            } catch (SecurityException var5) {
                var5.printStackTrace();
            }
        }

        if (work != null) {
            work.getIntent().setExtrasClassLoader(this.mService.getClassLoader());
            return new SafeJobServiceEngineImpl.WrapperWorkItem(work);
        } else {
            return null;
        }
    }

    final class WrapperWorkItem implements GenericWorkItem {
        final JobWorkItem mJobWork;

        WrapperWorkItem(JobWorkItem jobWork) {
            this.mJobWork = jobWork;
        }

        public Intent getIntent() {
            return this.mJobWork.getIntent();
        }

        public void complete() {
            synchronized(SafeJobServiceEngineImpl.this.mLock) {
                if (SafeJobServiceEngineImpl.this.mParams != null) {
                    try {
                        SafeJobServiceEngineImpl.this.mParams.completeWork(this.mJobWork);
                    } catch (SecurityException  | IllegalArgumentException var4) {
                    // 2 Here we also perform a try/catch operation on the completeWork
                        var4.printStackTrace();
                    }
                }
            }
        }
    }
}

On the basis of the source code, the above code only handles Exception at 1 and 2</code b>. The rest of the code does not change, so we can compare the source code to see the comparison. If you have a three-party library in your project that has introduced this SafeJobIntentService class, but because you can't use this class of them, and you refer to such as implementation 'com.evernote:android-job:1.4.2' library, duplicate class found in the module. If this problem occurs, we can rename the class and follow the above code to deal with it. Hopefully Google will add a solution to this problem in future libraries.
JSON has three methods for parsing data

How to Solve mount error(6): No such device or address

Error:

mount error(6): No such device or address
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)

Samba server Settings:
[root@test1 ~]#cat /etc/samba/smb.conf
Global Settings:
[global]

    workgroup = test
    server string = Samba Server Version %v
    #log files split per-machine:
    log file = /var/log/samba/log.%m
    #maximum size of 50KB per log file, then rotate:
    max log size = 50
    security = user
    passdb backend = tdbsam
    load printers = no
    cups options = raw

The home Settings
[homes]

    comment = Home Directories
    browseable = no
    writable = yes
    create mode = 0664
    directory =0755

Projects

    comment = smbuser's home
    path    = /share
    browseable = yes
    writable = yes
    write list = @users

3 . font – family: tahoma; mso – bidi – font – family: tahoma;从/etc/samba/smb.Load smb configuration file conf
rlimit_max: increase rlimit_max(1024) to the minimum window limit (16384)
Process section “[homes]”
Processing section “[project]”
Loaded service file OK.
Server role:ROLE_STANDALONE
View service definition dumps by enter
# global parameters
(Global)

    server string = Samba Server Version %v
    workgroup = TEST
    log file = /var/log/samba/log.%m
    max log size = 50
    load printers = No
    security = USER
    idmap config * : backend = tdb
    cups options = raw

(home)

    comment = Home Directories
    path = 0755
    browseable = No
    create mask = 0664
    read only = No

(project)

    comment = smbuser's home
    path = /share
    read only = No
    write list = @users

Client mount
[root@test2 ~]# mount -t cifs //2.2.1.2/user1/mnt-o username=user1,password=4321
Retrying with upper case share name
mount error(6): No such device or address
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)


Check found an error setting for the server:
Solution: Change directory = 0755 in the home directory to Directory Mode = 0755
[homes]

    comment = Home Directories
    browseable = no
    writable = yes
    create mode = 0664
    directory **mode** = 0755

Testparm didn’t detect a problem, so it took a long time. The key is carefulness, carefulness!