Category Archives: How to Fix

Remote connection MySQL error 1045 solution

MySQL remote operation steps:

Method 1:

USE mysql;
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;
FLUSH PRIVILEGES;

Note: the password in the second step is the root login password you want to set. Note that it is not the root password during remote installation. What password you set here, then what is the remote login password
by analogy, other users can do the same
method 2: change the table method

mysql> use mysql; 
mysql> update user set host = '%' where user = 'root'; 
mysql> select host, user from user; 
mysql> flush privileges;

Vue reports an error sasserror: expected newline

I used to be less in Vue. Today I tried sass on a whim, and then the error will be reported when running sasserror: expected newline

After studying for a long time, I found that there is a pit here. You can’t write sass in style if you use sass in Vue

It has to be written as SCSS  

  Change it so that you won’t report an error

 

Add a warehouse in allprojects repositories and report an error

Android studio version:
Android studio arctic fox | 2020.3.1 patch 1
build #ai-203.7717.56.2031.7621141, build on August 8, 2021

Gradle version: 7.0.0

Add a new warehouse under the gradle of the project

An error is reported:
build was configured to prefer settings repositories over project repositories but repository ‘Maven’ was added by build file ‘build. Gradle’

Solution
put the library you want to add into setting.gradle

Error resource Android datalogcornerradius not found

Error: resource Android: attr/dialogcornerradius not found

1. Problem description

Running the Android studio program generates an error error error: resource Android: attr/dialogcornerradius not found

2. Analyze the causes

Compilesdkversion, buildtoolsversion and targetsdkversion do not match

3. Solutions

Set compilesdkversion and buildtoolsversion to high version and targetsdkversion to low version

4. Specific operation steps

Step 1: check the version numbers of compile SDK version, build tools version and targetsdkversion

Step 2: in the project structure interface, select modules and modify the version numbers of compile SDK version and build tools version

Requirement: compile SDK version and build tools version should be higher than targetsdkversion

Step3: Step 2 after modifying the version number, Android studio will automatically update. After the update, run the program again to solve the error problem.

Parsing error name or service not known [How to Solve]

Problem phenomenon

On the node7 node of Alibaba OCP cluster, a domain name cannot be resolved when it is resolved. Error message: name or service not known

Troubleshooting

After testing, it is found that this problem does not only occur in node7 nodes. In all servers in Alibaba cloud East China 2 (Shanghai) zone F, the domain name cannot be resolved (other zones are normal).

Conclusion

After confirming with ALI engineers, the problem is caused by the fact that the self built DNS authoritative server that resolves the domain name does not support EDNS. The DNS community requires that the authoritative server must support EDNS, otherwise the localdns does not have a work around mechanism. However, due to different versions of alicloud’s localdns, it has not been completely upgraded. Therefore, some regions (availability zone f) comply with this Convention and cannot be parsed, while some regions are compatible with this workaround and can be parsed

Solution

(1) The other side creates its own authoritative DNS and turns on EDNS
(2) modify the resolver of ECs to 223.5.5.5 and 223.6.6. The two DNS have not removed the workaround of ends

CDH opens Kerberos and reports an error: ticket expired

I did it with reference to the open Kerberos wizard in the official cloudera documentation. Address: https://docs.cloudera.com/cdp-private-cloud-base/7.1.5/security-kerberos-authentication/topics/cm-security-kerberos-enabling-step4-kerberos-wizard.html

During the startup process, the last step of starting the cluster starts to report errors. The services reporting errors include Kafka, HBase, jobhistory, etc. the relevant logs are as follows:

Kafka, HBase and other logs:

Jobhistory log:

It can be seen from the log that the ticket is expired, so the relevant configurations of krb5.conf and kdc.conf files are checked. The configuration seems to be OK, as follows:

So, I took a CM automatically generated KeyTab (/ var/run/cloudera SCM agent/process/15 HDFS datacode/HDFS. KeyTab) on the server and tried Kinit to see if it really expired, but the results are as follows:

This error seems to indicate that the KeyTab format of this version is not supported. Therefore, it is considered that the Kerberos version is incompatible. Just before, I saw that some people said that the Kerberos version is sometimes incompatible. Link: https://community.cloudera.com/t5/Support-Questions/Kerberos-ticket-expired-kinit-keytab-successfully-java/td-p/80522

The respondents here give such tips:

Therefore, after the version was changed to 1.15.50, the problem was solved. This log hint is still very lame. Kerberos style has always been like this.

Error reporting using PM2 management application

The error contents are as follows:

PM2: unable to load file D: \ software \ node \ node_ Global \ pm2.ps1 because running scripts is prohibited on this system. For more information, see about in HTTPS:/go. Mic
Microsoft. COM/fwlink /?LINKID = 135170_ Execution_ Policies。

resolvent  

Run PowerShell as an administrator, execute the set executionpolicy remotesigned command, and then enter y.

 

 

Springboot plus cross domain annotation @crossorigin startup error

The purpose of this article is to record this error (reducing the version can also solve this problem)


@The crossorigin annotation is used to complete cross domain requests.

In previous versions, it was usually written in the following way to indicate that a session can also support cross domain requests. Multiple requests use one session.

@CrossOrigin(allowCredentials = "true", allowedHeaders = "*")

However, in the latest version of 2.5.2 , running the project in this way will report an error. The error information is as follows:

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2021-08-22 18:18:56.634 ERROR 3840 --- [  restartedMain] o.s.boot.SpringApplication               : Application run failed

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'requestMappingHandlerMapping' defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: When allowCredentials is true, allowedOrigins cannot contain the special value "*" since that cannot be set on the "Access-Control-Allow-Origin" response header. To allow credentials to a set of origins, list them explicitly or consider using "allowedOriginPatterns" instead.
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1786) ~[spring-beans-5.3.8.jar:5.3.8]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:602) ~[spring-beans-5.3.8.jar:5.3.8]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:524) ~[spring-beans-5.3.8.jar:5.3.8]
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.8.jar:5.3.8]
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.8.jar:5.3.8]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.8.jar:5.3.8]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.8.jar:5.3.8]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:944) ~[spring-beans-5.3.8.jar:5.3.8]
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918) ~[spring-context-5.3.8.jar:5.3.8]
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583) ~[spring-context-5.3.8.jar:5.3.8]
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145) ~[spring-boot-2.5.2.jar:2.5.2]
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754) [spring-boot-2.5.2.jar:2.5.2]
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:434) [spring-boot-2.5.2.jar:2.5.2]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:338) [spring-boot-2.5.2.jar:2.5.2]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1343) [spring-boot-2.5.2.jar:2.5.2]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1332) [spring-boot-2.5.2.jar:2.5.2]
	at com.example.shop.ShopApplication.main(ShopApplication.java:12) [classes/:na]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_251]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_251]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_251]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_251]
	at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) [spring-boot-devtools-2.5.2.jar:2.5.2]
Caused by: java.lang.IllegalArgumentException: When allowCredentials is true, allowedOrigins cannot contain the special value "*" since that cannot be set on the "Access-Control-Allow-Origin" response header. To allow credentials to a set of origins, list them explicitly or consider using "allowedOriginPatterns" instead.
	at org.springframework.web.cors.CorsConfiguration.validateAllowCredentials(CorsConfiguration.java:473) ~[spring-web-5.3.8.jar:5.3.8]
	at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping$MappingRegistry.register(AbstractHandlerMethodMapping.java:644) ~[spring-webmvc-5.3.8.jar:5.3.8]
	at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.registerHandlerMethod(AbstractHandlerMethodMapping.java:328) ~[spring-webmvc-5.3.8.jar:5.3.8]
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping.registerHandlerMethod(RequestMappingHandlerMapping.java:395) ~[spring-webmvc-5.3.8.jar:5.3.8]
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping.registerHandlerMethod(RequestMappingHandlerMapping.java:76) ~[spring-webmvc-5.3.8.jar:5.3.8]
	at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.lambda$detectHandlerMethods$2(AbstractHandlerMethodMapping.java:298) ~[spring-webmvc-5.3.8.jar:5.3.8]
	at java.util.LinkedHashMap.forEach(LinkedHashMap.java:684) ~[na:1.8.0_251]
	at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.detectHandlerMethods(AbstractHandlerMethodMapping.java:296) ~[spring-webmvc-5.3.8.jar:5.3.8]
	at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.processCandidateBean(AbstractHandlerMethodMapping.java:265) ~[spring-webmvc-5.3.8.jar:5.3.8]
	at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.initHandlerMethods(AbstractHandlerMethodMapping.java:224) ~[spring-webmvc-5.3.8.jar:5.3.8]
	at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.afterPropertiesSet(AbstractHandlerMethodMapping.java:212) ~[spring-webmvc-5.3.8.jar:5.3.8]
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping.afterPropertiesSet(RequestMappingHandlerMapping.java:206) ~[spring-webmvc-5.3.8.jar:5.3.8]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1845) ~[spring-beans-5.3.8.jar:5.3.8]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1782) ~[spring-beans-5.3.8.jar:5.3.8]
	... 21 common frames omitted

From the error message, we find the most critical sentence:

When allowCredentials is true, allowedOrigins cannot contain the special value "*" since that cannot be set on the "Access-Control-Allow-Origin" response header.

Carefully read the error report. After allowcredentials = “true” is used, the origin cannot be set to * (i.e. the default state).

The solution is also relatively simple. Just add a domain name to the parameters

@CrossOrigin(origins = "http://localhost:63342",allowCredentials = "true", allowedHeaders = "*")

This port number is my front-end running with webstron, and the front-end will run on a local port. My one is 63343

If I use idea, click the browser in the floating window to open the front-end page, and the port number on the pop-up page is the port number of the domain name in the @ crossorigin note.


Some students didn’t report an error after starting, but the session still can’t be accessed across domains. It may be that you didn’t add it in the front page

xhrFields:{withCredentials:true},

Troubleshooting of samba error in Linux configuration startup

Troubleshooting of samba error in Linux configuration startup

    systemctl start SMB indicates an error and the firewall needs to be closed. Set SELinux to disabled through sudo VI/etc/SELinux/config, and systemctl start SMB succeeds again. Windows connects to Linux through samba and prompts an error. You need to turn off the firewall through sudo systemctl stop firewalld. Then, connect again and succeed

    Configuring Samba login users

    Sudo smbpasswd – a username
    sudo smbpasswd – A to add a user, the user to be added must already be a system user
    sudo smbpasswd – D to freeze the user so that the user can no longer log in
    sudo smbpasswd – e to restore the user, so that the frozen user can use
    sudo smbpasswd – n to set the user’s password to null again

Tomcat starts front-end engineering error [How to Solve]

I tried all the methods mentioned on the Internet and asked my colleagues, but they didn’t solve them. Finally, I inadvertently remembered to delete the target and out directories, and the results were good… Is there a great God to explain?

At the same time, note that the default band should be deleted and only a backslash should be retained

Cmake error when configuring OpenGL [How to Solve]

Refer to the problem encountered when compiling and installing cmake glut_ Xmu_ Library (Advanced)
system environment: Ubuntu 16.04
cmake reports an error when building a program in KDevelop. The error information is as follows:



    CMake Error: The following variables are used in this project, but they are set to NOTFOUND.

    Please set them or make sure they are set and tested correctly in the CMake files:

    GLUT_Xmu_LIBRARY (ADVANCED)

    linked by target "openglsupport" in directory {$PATH}
     

    -- Configuring incomplete, errors occurred!

Solution:

sudo apt-get install libxmu-dev