Tag Archives: development language

How to Solve Hyperf Failed to Start Error After Aliyun ACM Installed

Today, try installing the hyperf microservice framework

Alibaba cloud ACM is selected when installing the service

The console keeps making such mistakes

[ERROR] Client error: `GET http://139.196.135.144:8080/diamond-server/config.co?tenant=&dataId=&group=DEFAULT_GROUP` resulted in a `404 Not Found` response:
config data not exist

[line:113] in /www/hyperf/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php

Solution:

Modify the configuration in hyperf/config/autoload/config_center.php in the project root directory

return [
    'enable' => (bool) env('CONFIG_CENTER_ENABLE', false), // set to false
    'driver' => env('CONFIG_CENTER_DRIVER', 'aliyun_acm'),
    'mode' => env('CONFIG_CENTER_MODE', Mode::PROCESS),
    'drivers' => [
        'aliyun_acm' => [
            'driver' => Hyperf\ConfigAliyunAcm\AliyunAcmDriver::class,
            'interval' => 5,
            'endpoint' => env('ALIYUN_ACM_ENDPOINT', 'acm.aliyun.com'),
            'namespace' => env('ALIYUN_ACM_NAMESPACE', ''),
            'data_id' => env('ALIYUN_ACM_DATA_ID', ''),
            'group' => env('ALIYUN_ACM_GROUP', 'DEFAULT_GROUP'),
            'access_key' => env('ALIYUN_ACM_AK', ''),
            'secret_key' => env('ALIYUN_ACM_SK', ''),
            'ecs_ram_role' => env('ALIYUN_ACM_RAM_ROLE', ''),
        ],
    ],
];

Or the zone applies for Alibaba cloud ACM, and it is OK to fill in the relevant configuration successfully. It is recommended to close it in the development stage

[Solved] Spring Boot Error: org.springframework.jdbc.datasource.embedded.EmbeddedData

Record the spring boot error solution once,

If spring boot reports an error during Druid integration, and the following errors are reported:

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'dataSource': Unsatisfied dependency expressed through field 'basicProperties'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'spring.datasource-org.springframework.boot.autoconfigure.jdbc.DataSourceProperties': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.autoconfigure.jdbc.DataSourceProperties]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseType
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:596)
	at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:90)
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:374)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1411)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:592)
	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.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:849)
	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 org.learn.SpringBootLearnApplication.main(SpringBootLearnApplication.java:23)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'spring.datasource-org.springframework.boot.autoconfigure.jdbc.DataSourceProperties': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.autoconfigure.jdbc.DataSourceProperties]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseType
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1303)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1197)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)
	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.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.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:277)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1247)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1167)
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:593)
	... 19 common frames omitted
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.autoconfigure.jdbc.DataSourceProperties]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseType
	at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:184)
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:87)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1295)
	... 30 common frames omitted
Caused by: java.lang.NoClassDefFoundError: org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseType
	at org.springframework.boot.jdbc.EmbeddedDatabaseConnection.<clinit>(EmbeddedDatabaseConnection.java:50)
	at org.springframework.boot.autoconfigure.jdbc.DataSourceProperties.<init>(DataSourceProperties.java:152)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:172)
	... 32 common frames omitted
Caused by: java.lang.ClassNotFoundException: org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 39 common frames omitted

The reason is that the JDBC related jar package is missing,

Solution: import spring-jdbc package

<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-jdbc</artifactId>
</dependency>

[Solved] Uncaught SyntaxError: Invalid Unicode escape sequence

Page error encountered today: Uncaught SyntaxError: Invalid Unicode escape sequence

The parameter in the button click method is a software path, and an error will be reported when passing the parameter. The main reason is that the backslash in JS is caused by the escape character

So just replace the backslash with a double slash to solve the problem: replace(/\\/g,”/”)

Redis: DENIED Redis is running in protected mode [How to Solve]

As shown below, the program reports an error when connecting to redis. According to the error information, redis is running in protected mode. It needs to be set under the redis command line: config set protected-mode no.

-DENIED Redis is running in protected mode because protected mode is enabled, no bind address was specified, no authentication password is requested to clients. In this mode connections are only accepted from the loopback interface. If you want to connect from external computers to Redis you may adopt one of the following solutions:

Just disable protected mode sending the command ‘CONFIG SET protected-mode no’ from the loopback interface by connecting to Redis from the same host the server is running, however MAKE SURE Redis is not publicly accessible from internet if you do so. Use CONFIG REWRITE to make this change permanent.

Alternatively you can just disable the protected mode by editing the Redis configuration file, and setting the protected mode option to ‘no’, and then restarting the server.

If you started the server manually just for testing, restart it with the ‘–protected-mode no’ option.

Setup a bind address or an authentication password.

NOTE: You only need to do one of the above things in order for the server to start accepting connections from the outside.

Error message when using pycharm to connect to redis:

Detect redis port 6379 through telnet command

Solution:

Set protected-mode no

Check the redis port 6379 through the telnet command again, and there is no access exception.

Run Python again to connect to redis:

Supplementary knowledge:

When you use telnet (telnet IP port number) to connect to the host under Linux/Unix, you will be prompted “escape character is’ ^] ‘. What does this mean? How to solve it?

Escape character is ‘^]’. Solution

“^” means the Ctrl key!

1. This prompt means that pressing Ctrl +] will call out the command line of Telnet!

2. After the telnet command line comes out, you can execute the telnet command;

3. Exit the telnet command line with the name quit.

Common telnet commands

close closes the current connection

logout forces the remote user to exit and close the connection

display displays the parameters of the current operation

mode attempted to enter command line mode or character mode

open connect to a site

quit exit

telnetsend send special characters

set sets the parameters of the current operation

unset resets the current operating parameters

status print status information

toggle switch operation parameters

slc changes the state of special characters

Auth on/off confirmation function Z suspended

Telnetenviron changes the environment variable and displays help

To sum up, escape character is’ ^] ‘. It is just a prompt that you can call the command line of Telnet using Ctrl +] key.

[Solved] Logstash Error: Logstash – java.lang.IllegalStateException: Logstash stopped processing because of an err

I recently tried to use Elasticsearch and IK in combination with Logstash to link mysql, and tested Logstash with the following error message.

First enter the command: logstash -e ‘input {stdin{}} output {stdout{}}’

D:\myworkspace\es\logstash-6.4.3\bin>logstash -e 'input {stdin{}} output {stdout{}}'

The command is correct, but the result is:

D:\myworkspace\es\logstash-6.4.3\bin>logstash -e 'input {stdin{}} output {stdout{}}'
ERROR: Unknown command '{stdin{}}'

See: 'bin/logstash --help'
[ERROR] 2022-08-23 09:06:42.875 [main] Logstash - java.lang.IllegalStateException: Logstash stopped processing because of an error: (SystemExit) exit

 

Solution:

You should try the following command first:

logstash -e “”

The result was successful:

D:\myworkspace\es\logstash-6.4.3\bin>logstash -e ""
Sending Logstash logs to D:/myworkspace/es/logstash-6.4.3/logs which is now configured via log4j2.properties
[2022-08-23T09:16:16,950][INFO ][logstash.setting.writabledirectory] Creating directory {:setting=>"path.queue", :path=>"D:/myworkspace/es/logstash-6.4.3/data/queue"}
[2022-08-23T09:16:16,958][INFO ][logstash.setting.writabledirectory] Creating directory {:setting=>"path.dead_letter_queue", :path=>"D:/myworkspace/es/logstash-6.4.3/data/dead_letter_queue"}
[2022-08-23T09:16:17,054][WARN ][logstash.config.source.multilocal] Ignoring the 'pipelines.yml' file because modules or command line options are specified
[2022-08-23T09:16:17,164][INFO ][logstash.agent           ] No persistent UUID file found. Generating new UUID {:uuid=>"0777ac0f-9efb-463d-8e2c-874bc1dc9feb", :path=>"D:/myworkspace/es/logstash-6.4.3/data/uuid"}
[2022-08-23T09:16:17,592][INFO ][logstash.runner          ] Starting Logstash {"logstash.version"=>"6.4.3"}
[2022-08-23T09:16:20,129][INFO ][logstash.pipeline        ] Starting pipeline {:pipeline_id=>"main", "pipeline.workers"=>8, "pipeline.batch.size"=>125, "pipeline.batch.delay"=>50}
[2022-08-23T09:16:20,231][INFO ][logstash.pipeline        ] Pipeline started successfully {:pipeline_id=>"main", :thread=>"#<Thread:0x5fba80a0 run>"}
The stdin plugin is now waiting for input:
[2022-08-23T09:16:20,277][INFO ][logstash.agent           ] Pipelines running {:count=>1, :running_pipelines=>[:main], :non_running_pipelines=>[]}
[2022-08-23T09:16:20,611][INFO ][logstash.agent           ] Successfully started Logstash API endpoint {:port=>9600}
[2022-08-23T09:16:43,203][WARN ][logstash.runner          ] SIGINT received. Shutting down.
[2022-08-23T09:16:43,338][INFO ][logstash.pipeline        ] Pipeline has terminated {:pipeline_id=>"main", :thread=>"#<Thread:0x5fba80a0 run>"}
[2022-08-23T09:16:43,340][FATAL][logstash.runner          ] SIGINT received. Terminating immediately.

Decisively replace with the following command:

logstash -e "input { stdin {} }  output {stdout {} }"

Done!

D:\myworkspace\es\logstash-6.4.3\bin>logstash -e "input { stdin {} }  output {stdout {} }"
Sending Logstash logs to D:/myworkspace/es/logstash-6.4.3/logs which is now configured via log4j2.properties
[2022-08-23T09:17:48,125][WARN ][logstash.config.source.multilocal] Ignoring the 'pipelines.yml' file because modules or command line options are specified
[2022-08-23T09:17:48,690][INFO ][logstash.runner          ] Starting Logstash {"logstash.version"=>"6.4.3"}
[2022-08-23T09:17:50,871][INFO ][logstash.pipeline        ] Starting pipeline {:pipeline_id=>"main", "pipeline.workers"=>8, "pipeline.batch.size"=>125, "pipeline.batch.delay"=>50}
[2022-08-23T09:17:50,964][INFO ][logstash.pipeline        ] Pipeline started successfully {:pipeline_id=>"main", :thread=>"#<Thread:0x268e4bb5 run>"}
The stdin plugin is now waiting for input:
[2022-08-23T09:17:51,008][INFO ][logstash.agent           ] Pipelines running {:count=>1, :running_pipelines=>[:main], :non_running_pipelines=>[]}
[2022-08-23T09:17:51,209][INFO ][logstash.agent           ] Successfully started Logstash API endpoint {:port=>9600}

ModuleNotFoundError: No module named ‘requests‘ [How to Solve]

Problem description: After installing the requests module using pip under cmd, I can use import requests, but I can’t import it under Pycharm IDE with the following error: ModuleNotFoundError: No module named ‘requests ‘

Later I found out that my python was installed on E drive, but I installed it on C drive with the install requests command, without switching E drive. I reinstalled it on the E drive

Installation steps

①cmd window: switch to the Scripts file in the python installation directory on disk E

②Install command: pip install requests, but there is a yellow text error

③ Follow the Yellow prompt command and enter: python -m pip install --upgrade pip to complete the installation

④ Prove that the installation is successful: you can enter the command under Python: import requests command does not report an error

Pycharm page

[Solved] Appium Error: InvalidArgumentException: Message: invalid argument: invalid locator

Appium Error:
selenium.common.exceptions.InvalidArgumentException: Message: invalid argument: invalid locator

 

Solution: Add the following two parameters when you create a driver.

desired_caps[‘chromeOptions’] = {‘w3c’:False}
desired_caps[‘showChromedriverLog’] = True

 

Refer:
Fail to locate an web element using “findElement” on Android 9 using Appium 1.15.0 · Issue #13306 · appium/appium · GitHub

[Solved] Error in nextTick: “TypeError: undefined is not iterable

Error in nextTick: “TypeError: undefined is not iterable (cannot read property Symbol(Symbol.iterator))”


The parent component did not pass the corresponding parameter Found:

<label-template
   :image-list="checkImageList"
   :tag-list="tagList"
   @onAllFeatures="onAllFeatures"
   :active-tab="activeTab"
   @next-page="nextPage"
   @previous-page="previousPage"
 />
historicalList.length //The parent component does not pass list, but the child component uses it and gets the length

[Solved] Python Error: socket.error [Errno 9] Bad file descriptor

To learn Python Network programming, I wrote two small programs on the server and the client according to the book, and found that an error was reported:

Traceback (most recent call last):

File “./tsTserv.py”, line 20, in

data = tcpCliSock.recv(BUFSIZ)

File “/usr/lib/python2.6/socket.py”, line 165, in _dummy

raise error(EBADF, ‘Bad file descriptor’)

socket.error: [Errno 9] Bad file descriptor

The source code of the server side is as follows:

while True:
        print 'waiting for connection...'
        tcpCliSock,addr = tcpSerSock.accept()
        print '...connected from:',addr
        while True:
                data = tcpCliSock.recv(BUFSIZ)
                if not data:
                        break
                tcpCliSock.send('[%s] %s' %(ctime(),data))
        tcpCliSock.close()
tcpSerSock.close()

Solution:

tcpCliSock.close() is placed in the second while loop, causing tcpCliSock to be closed after receiving data once, and this statement should be placed in the outer loop

[Solved] No tf data. Actual error: Fixed Frame [world] does not exist

1. No tf data. Actual error: Fixed Frame [world] does not exist

When using rviz to view relevant coordinate information, you may encounter No tf data. Actual error: Fixed Frame [world] does not exist, the main reason is that there is no world coordinate system in the TF tree. The solution is to let rviz know where the world coordinate system is. You can manually publish using the following command

rosrun tf static_transform_publisher 0 0 0 0 0 0 1 map world 5

2. nvalid argument “/world” passed to canTransform argument source_frame in tf2 frame_ids cannot start with a ‘/’ like

After the first problem is solved, another problem may appear Invalid argument "/world" passed to canTransform argument source_frame in tf2 frame_ids cannot start with a '/' like: as shown in the figure:

this problem is mainly because “/ world” is used in the release code and “world” is used in our release It may be good to recompile the code from “/world” to “world”

[Solved] error: invalid operands of types ‘QLabel*‘ and ‘void‘ to binary ‘operator>

Error in QT: invalid operators of types’ qlabel * ‘and’ void ‘to binary’ operator & gt; ‘ Wrong solution.

This kind of error is generally the operation symbol use error

For example:

btnLabel>setFixedSize(menuBtn->width(),menuBtn->height());

Here ‘>’ operation symbol is wrong, changed to ‘->’, it will be OK!

 btnLabel->setFixedSize(menuBtn->width(),menuBtn->height());