Category Archives: Error

[Solved] org.apache.zookeeper.KeeperException$OperationTimeoutException: KeeperErrorCode = OperationTimeout

New colleagues locally start the project, springboot start reported this error, the original is as follows:

2021-12-10.14:35:02.202 restartedMain INFO ZooKeeper : Client environment:java.io.tmpdir=C:\Users\ADMINI~1\AppData\Local\Temp\
2021-12-10.14:35:02.202 restartedMain INFO ZooKeeper : Client environment:java.compiler=<NA>
2021-12-10.14:35:02.202 restartedMain INFO ZooKeeper : Client environment:os.name=Windows 10
2021-12-10.14:35:02.202 restartedMain INFO ZooKeeper : Client environment:os.arch=amd64
2021-12-10.14:35:02.202 restartedMain INFO ZooKeeper : Client environment:os.version=10.0
2021-12-10.14:35:02.202 restartedMain INFO ZooKeeper : Client environment:user.name=Administrator
2021-12-10.14:35:02.202 restartedMain INFO ZooKeeper : Client environment:user.home=C:\Users\Administrator
2021-12-10.14:35:02.202 restartedMain INFO ZooKeeper : Client environment:user.dir=D:\WorkSpace\league-api
2021-12-10.14:35:02.203 restartedMain INFO ZooKeeper : Initiating client connection, connectString=test-zk01-a.zk.xxx.com:2181 sessionTimeout=600000 watcher=org.apache.curator.ConnectionState@43224f71
2021-12-10.14:35:12.584 Curator-Framework-0 INFO CuratorFrameworkImpl : backgroundOperationsLoop exiting
2021-12-10.14:35:13.651 restartedMain-SendThread(10.20.0.12:2181) INFO ClientCnxn : Opening socket connection to server 10.20.0.12/10.20.0.12:2181. Will not attempt to authenticate using SASL (unknown error)
2021-12-10.14:35:13.677 restartedMain-SendThread(10.20.0.12:2181) INFO ClientCnxn : Socket connection established to 10.20.0.12/10.20.0.12:2181, initiating session
2021-12-10.14:35:14.131 restartedMain-SendThread(10.20.0.12:2181) INFO ClientCnxn : Session establishment complete on server 10.20.0.12/10.20.0.12:2181, sessionid = 0x17af8b923322751, negotiated timeout = 40000
2021-12-10.14:35:14.185 restartedMain INFO ZooKeeper : Session: 0x17af8b923322751 closed
2021-12-10.14:35:14.185 restartedMain-EventThread INFO ClientCnxn : EventThread shut down for session: 0x17af8b923322751
2021-12-10.14:35:14.206 restartedMain WARN AnnotationConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'elasticJobAutoConfiguration': Invocation of init method failed; nested exception is com.dangdang.ddframe.job.reg.exception.RegException: org.apache.zookeeper.KeeperException$OperationTimeoutException: KeeperErrorCode = OperationTimeout
2021-12-10.14:35:14.208 restartedMain INFO StandardService : Stopping service [Tomcat]
2021-12-10.14:35:14.287 restartedMain INFO ConditionEvaluationReportLoggingListener :

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2021-12-10.14:35:14.491 restartedMain ERROR SpringApplication : Application run failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'elasticJobAutoConfiguration': Invocation of init method failed; nested exception is com.dangdang.ddframe.job.reg.exception.RegException: org.apache.zookeeper.KeeperException$OperationTimeoutException: KeeperErrorCode = OperationTimeout
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:160)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:440)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1796)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:620)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:944)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:730)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:412)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:302)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1301)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1290)
at com.yueche.league.LeagueApiApplication.main(LeagueApiApplication.java:8)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)
Caused by: com.dangdang.ddframe.job.reg.exception.RegException: org.apache.zookeeper.KeeperException$OperationTimeoutException: KeeperErrorCode = OperationTimeout
at com.dangdang.ddframe.job.reg.exception.RegExceptionHandler.handleException(RegExceptionHandler.java:52)
at com.dangdang.ddframe.job.reg.zookeeper.ZookeeperRegistryCenter.init(ZookeeperRegistryCenter.java:107)
at com.yueche.league.common.job.ElasticJobAutoConfiguration.initElasticJob(ElasticJobAutoConfiguration.java:40)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:389)
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:333)
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:157)
... 23 common frames omitted
Caused by: org.apache.zookeeper.KeeperException$OperationTimeoutException: KeeperErrorCode = OperationTimeout
at com.dangdang.ddframe.job.reg.zookeeper.ZookeeperRegistryCenter.init(ZookeeperRegistryCenter.java:102)
... 31 common frames omitted

Process finished with exit code 0

The troubleshooting process.
The Internet has said firewall (tried not to); some say zk version (this side or third-party package indirectly dependent, and there are package conflicts, tried to remove a did not work);

Solution:
Modified the timeout time

ZookeeperConfiguration zookeeperConfiguration = new ZookeeperConfiguration(serverList, namespace);
zookeeperConfiguration.setSessionTimeoutMilliseconds(600000);
zookeeperConfiguration.setConnectionTimeoutMilliseconds(600000);
zookeeperConfiguration.setMaxSleepTimeMilliseconds(30000);
zookeeperConfiguration.setBaseSleepTimeMilliseconds(10000);
ZookeeperRegistryCenter regCenter = new ZookeeperRegistryCenter(zookeeperConfiguration);

Local boot OK

[Solved] Error resolving template “XXX”, template might not exist or might not be accessible by any of the

 @RequestMapping("/user/login")
    public String login(@RequestParam("username")String username, @RequestParam("password") String password, Model model, HttpSession session){
        if(username!=null&&password.equals ("123456"))
        {
            session.setAttribute ("loginUser",username);
            return "redirect:/main.html";
        }
        else{
            model.addAttribute ("msg","Incorrect username or password");
            return "/index";
        }
    }

Remove /

 @RequestMapping("/user/login")
    public String login(@RequestParam("username")String username, @RequestParam("password") String password, Model model, HttpSession session){
        if(username!=null&&password.equals ("123456"))
        {
            session.setAttribute ("loginUser",username);
            return "redirect:main.html";
        }
        else{
            model.addAttribute ("msg","Incorrect username or password");
            return "index";
        }
    }

[Solved] MySQL Error: Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggre

Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column ‘a_id’ which is not functionally
dependent on columns in GROUP BY clause;this is incompatible with sql_mode=only_full_group_by

Solution:

Firstly Use SQL to find:

select @@global.sql_mode

Remove only_FULL_GROUP_By, and then reset the value (fill in the cropped string in quotation marks)

set @@global.sql_mode='';
The values you find is the below:

ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

[Solved] docker info Check Error: WARNING: No swap limit support

Docker can limit the maximum physical memory and swap that can be used by the container by starting the command. However, the warning “warning: no swap limit support” is often encountered when using these commands

The general meaning is that the swap memory limit is not supported. Therefore, this warning is reported when testing on Tencent cloud and Alibaba cloud servers in China.

Limit the maximum memory usage of docker container

Parameter: – M 64M — memory swap = 128M

-M 64M limits the maximum physical memory that can be used by the container for operation to 64M, – memory swap = 128M limits the maximum virtual memory that can be used by the container to 128M. These two parameters are invalid when the warning: no swap limit support warning appears.

Solution:

1. Edit the/etc/default/grub file.

At grub_CMDLINE_Linux = “”, and add CGroup_enable=memory swapaccount=1

yang@master:~$ cat  /etc/default/grub
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#   info -f grub -n 'Simple configuration'

GRUB_DEFAULT=0
GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT=0
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="maybe-ubiquity"
GRUB_CMDLINE_LINUX="cgroup_enable=memory swapaccount=1"

Note: if grub_CMDLINE_Linux = content, remember not to delete, just add CGroup later_Enable = memory swapaccount = 1 and separate it from the previous content with a space.

2. Save, update

yang@master:~$  sudo update-grub

3. Restart the server

yang@master:~$ sudo reboot

4. Check

yang@master:~$ docker info
Client:
 Context:    default
 Debug Mode: false
 Plugins:
.....
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

Gitlab Docker Auto Deploy Error: /bin/bash: line 118: docker: command not found

The reason is that we can’t find the docker. We need to bind the docker

List all gitlab runner configuration files

find/| grep config.toml

[root@izwz99pke7zxkpm7l51t8jz ~]# find/| grep config.toml
/srv/gitlab-runner/config/config.toml
/var/lib/docker/volumes/gitlab-runner-config/_data/config.toml
/var/lib/docker/overlay2/b06ff5242ee208ee1eaa4b205801ed5daa193056526c0a01ced53dd821d28f8a/diff/etc/gitlab-runner/config.toml
/var/lib/docker/overlay2/7e84218ced6b73451784136503a22c51af06aa417e78c5ba7c29239046e9b985/merged/etc/gitlab-runner/config.toml

Volumes “/usr/bin/docker:/usr/bin/docker”, “/var/run/docker.sock:/var/run/docker.sock”

vim /srv/gitlab-runner/config/config.toml

[root@izwz99pke7zxkpm7l51t8jz ~]# vim /srv/gitlab-runner/config/config.toml
volumes = ["/cache","/usr/bin/docker:/usr/bin/docker", "/var/run/docker.sock:/var/run/docker.sock"]

[Solved] This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)

Prompt when running MySQL: [Err] 1418-This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)
reason:
This is when we turn on bin-log, we must specify whether our function is
1 DETERMINISTIC uncertain
2 NO SQL has no SQl statement, and of course it will not modify the data
3 READS SQL DATA only reads the data, of course it will not modify the data
4 MODIFIES SQL DATA To modify the data
5 CONTAINS SQL contains SQL statements
Among them, in function, only DETERMINISTIC, NO SQL and READS SQL DATA are supported. If we enable bin-log, we must specify a parameter for our function.

Solution:
SQL code
mysql> show variables like 'log_bin_trust_function_creators';
+---------------------------------+-------+
| Variable_name          | Value |
+---------------------------------+-------+
| log_bin_trust_function_creators | OFF  |
+---------------------------------+-------+
mysql> set global log_bin_trust_function_creators=1;
mysql> show variables like 'log_bin_trust_function_creators';
+---------------------------------+-------+
| Variable_name          | Value |
+---------------------------------+-------+
| log_bin_trust_function_creators | ON  |

After adding the parameter in this way, if mysqld restarts, that parameter will disappear again, so remember to add in the my.cnf configuration file:
log_bin_trust_function_creators=1

docker “mongo:systemctl start mongod.service” Error: mongod.service: New main PID 1390 does not belong to service, and PID file is not owned by root. Refusing.

Platform: Feiteng server + docker

 

 

Add parameters in docker run:

-v /sys/fs/cgroup:/sys/fs/cgroup

 

After docker exec into the container

chown -R mongodb:mongodb /var/lib/mongodb

 

[Solved] UnicodeDecodeError: ‘gbk’ codec can’t decode byte 0x80 in position 128: illegal multibyte sequence

An error is reported when odoo starts: Unicode decodeerror: ‘GBK’ codec can’t decode byte 0x80 in position 128: illegal multibyte sequence

The reason is that odoo.exe is resolved when the service starts Error decoding conf configuration file.

Solution: open the root directory of odoo project/odoo/tools/config Py (you can also directly click the error log on the console to find the error reporting place), in line 583

p.read([self.rcfile])

Change to

p.read([self.rcfile],‘utf-8‘)

Just restart.

[Solved] antD table Componet Error: warning.js?2149:7 Warning: [antdv: Each record in table should have a unique `key` prop,or set `rowKey` to an unique primary key.]

report errors:

From the perspective of error reporting, you can add constraints on the primary key and table attributes.

Solution:

 <a-table :columns="columns"
               :row-key="record => record.id"
               :data-source="ebooks1"
               :pagination="pagination"
               :loading="loading"
      >

These dependencies were not found: * throttle-debounce/debounce in ./node_modules/element-ui/lib/tooltip.js * throttle-debounce/throttle in ./node_modules/element-ui/lib/element-ui.common.js

Error when Vue item in vscode starts:

These dependencies were not found:

* throttle-debounce/debounce in ./ node_ modules/element-ui/lib/tooltip. js
* throttle-debounce/throttle in ./ node_ modules/element-ui/lib/element-ui. common. js

To install them, you can run: npm install –save throttle-debounce/debounce throttle-debounce/throttle

According to the prompts, there is still an error after installation. After changing the path, it can run normally. It seems that there is a difference in the resource introduction path between the idea editor and the vscode editor.

Follow the prompts in the error report to find the relevant file tooltip JS and common JS, where the path is:

 

Change the path to:

module. exports = require(“element-ui/node_modules/throttle-debounce”);

Find all the places that need to be changed, and then run the project after modification.