Author Archives: Robins

wget Error: ERROR: cannot verify nih.at’s certificate, issued by “/C=US/O=Let‘s Encrypt/CN=R3”

Error Message:

--2022-06-20 16:06:37--  https://nih.at/libzip/libzip-1.2.0.tar.gz
Resolving nih.at... 5.2.73.210, 2a04:52c0:101:2e6::de6c
Connecting to nih.at|5.2.73.210|:443... connected.
ERROR: cannot verify nih.at’s certificate, issued by “/C=US/O=Let's Encrypt/CN=R3”:
  Issued certificate has expired.
To connect to nih.at insecurely, use ‘--no-check-certificate’

 

Solution:

Step 1:
It is recommended to run this command first (if it reports an error you can skip it and try running step 2 directly).

sudo yum install -y ca-certificates

Step 2:
Replace the previous wget https://xxxxx command with the following command, –no-check-certificate is the last line of the error message
wget –no-check-certificate https://xxxxx

Perfect solution

[Solved] Error: Cannot find module ‘webpack/lib/RequestShortener’

Error Messages:

Error: Cannot find module ‘webpack/lib/RequestShortener’

at Function.Module._resolveFilename (module.js:548:15)

at Function.Module._load (module.js:475:25)

at Module.require (module.js:597:17)

at require (internal/module.js:11:18)

at Object.

(C:UsersjoshtDevelopmentkaraoke-butlerkaraokeclientnode_modulesterser-webpack-plugindistindex.js:19:25)

at Module._compile (module.js:653:30)

at Object.Module._extensions…js (module.js:664:10)

at Module.load (module.js:566:32)

at tryModuleLoad (module.js:506:12)

at Function.Module._load (module.js:498:3)

npm ERR! code ELIFECYCLE

npm ERR! errno 1

npm ERR! [email protected] build: react-scripts build

npm ERR! Exit status 1

npm ERR!

npm ERR! Failed at the [email protected] build script.

npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

 

Solution:

Delete package-lock.json and node_modules , then execute npm install globally.

SpringBoot Access Clickhouse Error: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘jdbcConverter’ defined in class path resource [***.class]

1 Dependency information

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.example</groupId>
    <artifactId>gmall-publisher</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>gmall-publisher</name>
    <description>gmall-publisher</description>
 
    <properties>
        <java.version>1.8</java.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <spring-boot.version>2.3.7.RELEASE</spring-boot.version>
    </properties>
 
    <dependencies>
<!--        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jdbc</artifactId>
        </dependency>-->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.mybatis.spring.boot</groupId>
            <artifactId>mybatis-spring-boot-starter</artifactId>
            <version>2.1.4</version>
        </dependency>
 
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <optional>true</optional>
        </dependency>
 
        <! --test dependencies are not imported if they are not used You need to remove src/test/java/com/example/gmallpublisher/GmallPublisherApplicationTests.java
        So the writes are under the java/com/example/gmallpublisher package -->
<!--        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.junit.vintage</groupId>
                    <artifactId>junit-vintage-engine</artifactId>
                </exclusion>
            </exclusions>
        </dependency>-->
 
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>3.11</version>
        </dependency>
 
        <dependency>
            <groupId>ru.yandex.clickhouse</groupId>
            <artifactId>clickhouse-jdbc</artifactId>
            <version>0.1.55</version>
        </dependency>
    </dependencies>
 
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-dependencies</artifactId>
                <version>${spring-boot.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>
 
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <version>2.3.7.RELEASE</version>
                <configuration>
                    <mainClass>com.example.gmallpublisher.GmallPublisherApplication</mainClass>
                </configuration>
                <executions>
                    <execution>
                        <id>repackage</id>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
 
</project>

 

2 Error Messages:

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2022-10-03 17:16:36.206 ERROR 28880 --- [           main] o.s.boot.SpringApplication               : Application run failed
 
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'jdbcConverter' defined in class path resource [org/springframework/boot/autoconfigure/data/jdbc/JdbcRepositoriesAutoConfiguration$SpringBootJdbcConfiguration.class]: Unsatisfied dependency expressed through method 'jdbcConverter' parameter 4; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jdbcDialect' defined in class path resource [org/springframework/boot/autoconfigure/data/jdbc/JdbcRepositoriesAutoConfiguration$SpringBootJdbcConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.data.relational.core.dialect.Dialect]: Factory method 'jdbcDialect' threw exception; nested exception is org.springframework.data.jdbc.repository.config.DialectResolver$NoDialectException: Cannot determine a dialect for org.springframework.jdbc.core.JdbcTemplate@1aa6e3c0. Please provide a Dialect.
  at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:799) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
  at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:540) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1336) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1176) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:556) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
  at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
  at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
  at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
  at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
  at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:897) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
  at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:879) ~[spring-context-5.2.12.RELEASE.jar:5.2.12.RELEASE]
  at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:551) ~[spring-context-5.2.12.RELEASE.jar:5.2.12.RELEASE]
  at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:143) ~[spring-boot-2.3.7.RELEASE.jar:2.3.7.RELEASE]
  at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:758) [spring-boot-2.3.7.RELEASE.jar:2.3.7.RELEASE]
  at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:750) [spring-boot-2.3.7.RELEASE.jar:2.3.7.RELEASE]
  at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:405) [spring-boot-2.3.7.RELEASE.jar:2.3.7.RELEASE]
  at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) [spring-boot-2.3.7.RELEASE.jar:2.3.7.RELEASE]
  at org.springframework.boot.SpringApplication.run(SpringApplication.java:1237) [spring-boot-2.3.7.RELEASE.jar:2.3.7.RELEASE]
  at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) [spring-boot-2.3.7.RELEASE.jar:2.3.7.RELEASE]
  at com.example.gmallpublisher.GmallPublisherApplication.main(GmallPublisherApplication.java:19) [classes/:na]
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jdbcDialect' defined in class path resource [org/springframework/boot/autoconfigure/data/jdbc/JdbcRepositoriesAutoConfiguration$SpringBootJdbcConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.data.relational.core.dialect.Dialect]: Factory method 'jdbcDialect' threw exception; nested exception is org.springframework.data.jdbc.repository.config.DialectResolver$NoDialectException: Cannot determine a dialect for org.springframework.jdbc.core.JdbcTemplate@1aa6e3c0. Please provide a Dialect.
  at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:657) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
  at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:637) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1336) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1176) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:556) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
  at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
  at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
  at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
  at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
  at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
  at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1307) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
  at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1227) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
  at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:886) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
  at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:790) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
  ... 20 common frames omitted
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.data.relational.core.dialect.Dialect]: Factory method 'jdbcDialect' threw exception; nested exception is org.springframework.data.jdbc.repository.config.DialectResolver$NoDialectException: Cannot determine a dialect for org.springframework.jdbc.core.JdbcTemplate@1aa6e3c0. Please provide a Dialect.
  at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
  at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:652) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
  ... 34 common frames omitted
Caused by: org.springframework.data.jdbc.repository.config.DialectResolver$NoDialectException: Cannot determine a dialect for org.springframework.jdbc.core.JdbcTemplate@1aa6e3c0. Please provide a Dialect.
  at org.springframework.data.jdbc.repository.config.DialectResolver.lambda$getDialect$2(DialectResolver.java:80) ~[spring-data-jdbc-2.0.6.RELEASE.jar:2.0.6.RELEASE]
  at java.util.Optional.orElseThrow(Optional.java:290) ~[na:1.8.0_212]
  at org.springframework.data.jdbc.repository.config.DialectResolver.getDialect(DialectResolver.java:79) ~[spring-data-jdbc-2.0.6.RELEASE.jar:2.0.6.RELEASE]
  at org.springframework.data.jdbc.repository.config.AbstractJdbcConfiguration.jdbcDialect(AbstractJdbcConfiguration.java:144) ~[spring-data-jdbc-2.0.6.RELEASE.jar:2.0.6.RELEASE]
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_212]
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_212]
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_212]
  at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_212]
  at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
  ... 35 common frames omitted

 

3 Reason & Solution

Mybatis imported JDBC dependency conflicts with Clickhouse-JDBC dependency.

Solution: Comment out the SpringBoot imported dependencies

<!--        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jdbc</artifactId>
        </dependency>
-->

[Solved] Frida spawn process failed on Android ‘Error: VM::AttachCurrentThread failed: -1

An error will be reported when script.load() is called.

{'type': 'error', 'description': 'Error: VM::AttachCurrentThread failed: -1', 'stack': 'Error: VM::AttachCurrentThread failed: -1
    at o (frida/node_modules/frida-java-bridge/lib/result.js:4)
    at <anonymous> (frida/node_modules/frida-java-bridge/lib/vm.js:27)
    at <anonymous> (frida/node_modules/frida-java-bridge/lib/vm.js:15)
    at it (frida/node_modules/frida-java-bridge/lib/android.js:521)
    at ze (frida/node_modules/frida-java-bridge/lib/android.js:202)
    at Oe (frida/node_modules/frida-java-bridge/lib/android.js:16)
    at _tryInitialize (frida/node_modules/frida-java-bridge/index.js:29)
    at _ (frida/node_modules/frida-java-bridge/index.js:21)
    at <anonymous> (frida/node_modules/frida-java-bridge/index.js:332)
    at call (native)
    at o (/_java.js)
    at <anonymous> (/_java.js)
    at <anonymous> (frida/runtime/java.js:1)
    at call (native)
    at o (/_java.js)
    at r (/_java.js)
    at <eval> (frida/runtime/java.js:3)
    at _loadJava (native)
    at get (frida/runtime/core.js:130)
    at <eval> (/script1.js:30)', 'fileName': 'frida/node_modules/frida-java-bridge/lib/result.js', 'lineNumber': 4, 'columnNumber': 1}

Workaround https://github.com/frida/frida/issues/1788
https://stackoverflow.com/questions/36680128/frida-spawn-process-failed-on-android

1. may also require device.resume()
2.

su
setprop persist.device_config.runtime_native.usap_pool_enabled false
getprop | grep usap

3. Do not have spaces in the path

bazel Compile Error: absl/base/policy_checks.h:79:2: error: #error “C++ versions less than C++14 are not supported.”

An error is reported when compiling a software using bazel, and the error message is:

absl/base/policy_checks.h:79:2: error: #error “C++ versions less than C++14 are not supported.”

 

The entire compilation information is:

devil@hp:~/lab$ bazel build -c opt // :deepmind_lab.so 
INFO: Build option -- cxxopt has changed, discarding analysis cache. 
WARNING: Download from https: // mirror.bazel.build/github.com /glennrp/libpng/archive/v1.6.37.zip failed: class java.io.FileNotFoundException GET returned 404 Not Found 
DEBUG: Rule 
' com_google_absl ' indicated that a canonical reproducible form can be obtained by modifying arguments sha256 = " cd8a6aed3682cd6a0330e0c11828254877531109d7bddc9331109d7bddc9 Repository com_google_absl instantiated at: /home/devil/lab/WORKSPACE: 18 : 13
  : in <toplevel> 
Repository rule http_archive defined at:
   /home/devil/.cache/bazel/_bazel_devil/485f2e56923c3d722a11a1d362ce5e93/external/bazel_tools/tools/build_defs/repo/http.bzl: 355 : 31 : in <toplevel> 
DEBUG: Rule ' bazel_skylib ' indicated that a canonical reproducible form can be obtained by modifying arguments sha256 = " a9432ad1582da1dd8a2bcbbdaf11d887b38d97c226207b00471eeb2985576797 " DEBUG 
: Repository bazel_skylib instantiated at: 
  / home/devil/lab/ in : WORK : SPACE : 12
Repository rule http_archive defined at:
   /home/devil/.cache/bazel/_bazel_devil/485f2e56923c3d722a11a1d362ce5e93/external/bazel_tools/tools/build_defs/repo/http.bzl: 355 : 31 : in <toplevel> 
INFO: Analyzed target // :deepmind_lab .so (0 packages loaded, 4197 targets configured). 
INFO: Found 1 target... 
ERROR: /home/devil/.cache/bazel/_bazel_devil/485f2e56923c3d722a11a1d362ce5e93/external/com_google_absl/absl/types/BUILD.bazel: 153 : 11 : Compiling absl/types/bad_optional_access.cc failed: (Exit 1): gcc failed: error executing command /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but- set -parameter -Wno-free-nonheap- object -fno-omit-frame-pointer -g0 -O2 ' -D_FORTIFY_SOURCE=1 ' -DNDEBUG -ffunction-sections ... (remaining 36 arguments skipped) 

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging 
In file included from external/com_google_absl/absl/ base /config.h: 86 ,
                  fromexternal/com_google_absl/absl/types/bad_optional_access.h: 26 ,
                  from external/com_google_absl/absl/types/bad_optional_access.cc: 15 : 
external /com_google_absl/absl/ base /policy_checks.h: 79 : 2 : error: #error " C++ versions less than C++14 are not supported."
    79 | #error "C++ versions less than C++14 are not supported." 
      | ^~~~~ 
Target // :deepmind_lab.so failed to build 
Use -- verbose_failures to see the command lines of failed build steps. 
INFO: Elapsed time: 0.426s, Critical Path: 0 .26s 
INFO: 17 processes: 17  internal . 
FAILED: Build did NOT complete successfully

 

Solution:

Edit the file .bazelrc under home (this file generally does not exist in advance, you can save it directly after editing)

 

Fill in the content:

build –cxxopt=-std=c++14 

 

 

 

 

 

Execute the compilation again and successfully pass:

 

 

 

zookeeper Failed to Startup: Error: JAVA_HOME is not set and java could not be found in PATH

Obviously, JAVA_HOME is configured normally, but the error is still reported:

hadoop@hadoop-1:/data/apache-zookeeper-3.7.1-bin/bin$ sh zkServer.sh start
zkServer.sh: 78: /data/apache-zookeeper-3.7.1-bin/bin/zkEnv.sh: [[: not found
-p: not found
java is /data/hadoop/jdk1.8.0_202/bin/java
Error: JAVA_HOME is not set and java could not be found in PATH.

 

Solution:

Replace it with ./zkServer.sh start

or bash zkServer.sh start

[Solved] Error detected while processing /root/.vimrc: E492: Not an editor command: Plug ‘scrooloose/nerdtree’

Create a cron task, the error is as follows:

# crontab -e

no crontab for root - using an empty one

Error detected while processing /root/.vimrc:

line    2:

E492: Not an editor command: Plug 'scrooloose/nerdtree'

Press ENTER or type command to continue

 

Solution:

1. Open ~/.bashrc and insert the following red line in the file:

2. Effective source ~/.bashrc

Finish.

flask init-db Error: Error: Could not locate a Flask application. Use the ‘flask –app’ option, ‘FLASK_APP’ environment variable, or a ‘wsgi.py’ or ‘app.py’ file in the current directory.

1. Problem description

When flask initializes the database file, execute flask init-db to report Error: Could not locate a Flask application. Use the ‘flask –app’ option, ‘FLASK_APP’ environment variable, or a ‘wsgi.py’ or ‘app.py’ file in the current directory, the specific error screenshot is as follows:

 

2. Problem solving

This problem is really annoying. I can’t find the corresponding solution on Baidu. The official document about the flask initialization database is also very vague. I wrote an execution command directly, so I don’t understand it very well, so I do it when initializing the database. The operation is:

1. Shut down the previously started server, open a new terminal and execute the following command:

1
2
3
%export FLASK_APP=flaskr
export FLASK_ENV=development
%flask run

 2. Open another terminal and cd to the package directory to execute the flask inti-db command, and the above error is reported. Obviously this is the wrong step.

3. Solutions

After thinking about this problem for a long time, I want to understand where I am wrong. The correct execution steps should be:

1. Execute the following command

1
2
3
%export FLASK_APP=flaskr
export FLASK_ENV=development
%flask init-db

 2. After the execution is successful, a flaskr.sqlite file will be created in the instance folder. The actual result is shown as follows:

 

 

make Error: error: cast from ‘int32_t*’ {aka ‘int*’} to ‘int’ loses precision [-fpermissive]

Error message:

     xxx.h:117:59: error: cast from ‘int32_t*’ {aka ‘int*’} to ‘int’ loses precision [-fpermissive]
     int m_MinValidLen = (int)(&(((DataOnAir *)0)->rx_ts_s));

 

Reason for error:

This is because the pointer type occupies 8 bytes on the 64-bit system based on the Linux kernel, and the int type occupies 4 bytes, so there will be losses precision.

You can convert the int* to the long type first, and the long type can be implicitly converted to the int type. You can directly modify it to long long or long

Modified:

long m_MinValidLen = (long)(&(((DataOnAir *)0)->rx_ts_s));

[Solved] uiautomateviewer Tool Error: Error while obtaining UI hierarchy XML file: com.android.ddmlib.SyncException

Error Message:

Error while obtaining UI hierarchy XML file: com.android.ddmlib.SyncException: Remote object doesn't exist! Error while obtaining UI hierarchy XML file: com.android.ddmlib.SyncException: Remote object doesn't exist!

 

 

Solution: Turn on developer permissions on the phone, turn the USB debugging button back on, and then restart the emulator

Reference link: https://www.cnblogs.com/uniquefu/p/11496211.html

RECEIVED ERROR PACKET: ERRNO = 1236, SQLSTATE = HY000 ERRMSG = COULD NOT FIND FIRST LOG FILE NAME IN BINARY LOG INDEX FILE

When using canal to synchronize mysql data, the problem of Could not find first log file name in binary log index file cannot find the binlog file. The detailed error is as follows

java.io.IOException: Received error packet: errno = 1236, sqlstate = HY000 errmsg = Could not find first log file name in binary log index file
at com.alibaba.otter.canal.parse.inbound.mysql.dbsync.DirectLogFetcher.fetch(DirectLogFetcher.java:102) ~[canal.parse-1.1.6.jar:na]
at com.alibaba.otter.canal.parse.inbound.mysql.MysqlConnection.dump(MysqlConnection.java:237) [canal.parse-1.1.6.jar:na]
at com.alibaba.otter.canal.parse.inbound.AbstractEventParser$1.run(AbstractEventParser.java:262) [canal.parse-1.1.6.jar:na]
at java.lang.Thread.run(Thread.java:750) [na:1.8.0_333]
java.io.IOException: Received error packet: errno = 1236, sqlstate = HY000 errmsg = Could not find first log file name in binary log index file
at com.alibaba.otter.canal.parse.inbound.mysql.dbsync.DirectLogFetcher.fetch(DirectLogFetcher.java:102) ~[canal.parse-1.1.6.jar:na]
at com.alibaba.otter.canal.parse.inbound.mysql.MysqlConnection.dump(MysqlConnection.java:237) ~[canal.parse-1.1.6.jar:na]
at com.alibaba.otter.canal.parse.inbound.AbstractEventParser$1.run(AbstractEventParser.java:262) ~[canal.parse-1.1.6.jar:na]
at java.lang.Thread.run(Thread.java:750) [na:1.8.0_333]
ERROR com.alibaba.otter.canal.common.alarm.LogAlarmHandler - destination:example[java.io.IOException: Received error packet: err
no = 1236, sqlstate = HY000 errmsg = Could not find first log file name in binary log index file
at com.alibaba.otter.canal.parse.inbound.mysql.dbsync.DirectLogFetcher.fetch(DirectLogFetcher.java:102)
at com.alibaba.otter.canal.parse.inbound.mysql.MysqlConnection.dump(MysqlConnection.java:237)
at com.alibaba.otter.canal.parse.inbound.AbstractEventParser$1.run(AbstractEventParser.java:262)
at java.lang.Thread.run(Thread.java:750)
]

 

This problem is mainly caused by the logfile being overwritten. You can view the meta.dat file under canal/conf/example to check the location of the currently read binlog file
"postion":{"gtid":"","included":false,"journalName":"mys
ql-bin.000591","position":25928,"serverId":21381487,"timestamp":1663232397000}}}],"destination":"example"}[root@iZ2vcfjagtpbh97ar0zj6cZ example]

 

Then compare the current MySQL binlog file and position
Use show master status to view in MySQL
Solution:
1. Stop the canal server first
2. Delete canal/conf/example/meta.dat
3. Update the canal/conf/example/instance.properties file

canal.instance.master.journal.name=xxx
canal.instance.master.position=xxx
These two fields correspond to the file and position in the current database respectively
4. Restart the canal server
Then you can view canal/logs/example/example.log to check if there is still a problem of not finding the binlog file

./popins2: error while loading shared libraries: libbifrost.so: cannot open shared object file: No such file or directory

001. Question

root@ubuntu01:/home/software/PopIns2/PopIns2# ./ popins2 
. / popins2 : error while loading shared libraries: libbifrost.so: cannot open shared object file: No such file or directory

 

 

002, the cause of the problem

Analysis of the reason: ld prompts that the library file cannot be found, and the library file is in the current directory.

The default directories of the linker ld are /lib and /usr/lib. If they are placed in other paths, you need to let ld know where the library files are.

 

003. Find the file

root@ubuntu01:/home/software/PopIns2/PopIns2# find / -name " libbifrost.so "
 /usr/local/lib/ libbifrost.so
 /home/software/bifrost/build/src/ libbifrost.so 
find: ' / run /user/ 1000 / doc': Permission denied
find: ' /run/user/ 1000 / gvfs': Permission denied
find: ' /run/user/ 127 / doc': Permission denied
find: ' /run/user/ 127 /gvfs': Permission denied

 

004. Solution

method 1:

Edit the /etc/ld.so.conf file and add the directory where the library file is located in a new line;

Run ldconfig to update the /etc/ld.so.cache file;
method 2:

Create any file with a .conf suffix in the /etc/ld.so.conf.d/ directory, and add the directory where the library file is located in the file;

Run ldconfig to update the /etc/ld.so.cache file;

I think the second method is more convenient, with minimal changes to the original system. Because the content of the /etc/ld.so.conf file is include /etc/ld.so.conf.d/*.conf

root@ubuntu01:/home/software/PopIns2/PopIns2# echo " /home/software/bifrost/build/src/libbifrost.so " > /etc/ld.so.conf.d/bifrost.so 
root@ubuntu01 : / home/software/PopIns2/PopIns2# ldconfig ## Update library files

 

005. Test

root@ubuntu01:/home/software/PopIns2/PopIns2# ./popins2