Category Archives: Error

[Solved] Postgre Error: ERROR: UNION types numeric and character varying cannot be matched

Today, I encountered a problem. A query function of postgre suddenly reported an error “error:   Union types numeric and character varying cannot be matched, line 6:… Ipermial, b.geom, b.pressurizing, b.pipelength, pipediam, b…., an error is reported when merging and querying two result sets. The types of numbers and strings cannot be merged. The SQL is as follows:

SELECT
    a.gid AS gid,
    a. NAME AS NAME,
    a.pipematerial,
    a.geom,
    a.pressurerating,
    a.pipelength,
    a.pipediam,
    a.wallthickness,
    a.source,
    a.target
FROM
    zy a
WHERE
    a.projectId = '2c91808f7cc0e652017ccfc7f7ea016f'
UNION ALL
    SELECT
        b.id AS gid,
        b. NAME AS NAME,
        b.pipematerial,
        b.geom,
        b.pressurerating,
        b.pipelength,
        b.pipediam,
        b.wallthickness,
        b.source,
        b.target
    FROM
        digital_edit_pipeline b
    WHERE
        b.condition_id = '2c9180887d45f311017d55857e9b02ac'
    AND b. ENABLE = 1

Check it. It’s the digital_edit_pipeline field of the pipeline table has been changed to the string type, which was modified by another colleague for some reason, resulting in an error in this place. The solution is also very simple. Just convert the field of the two tables to the same data type. Use to_Number (obj, ‘99999.999’) can convert a string to a number. The modified SQL is as follows:

SELECT
    a.gid AS gid,
    a. NAME AS NAME,
    a.pipematerial,
    a.geom,
    a.pressurerating,
    a.pipelength,
    a.pipediam,
    a.wallthickness,
    a.source,
    a.target
FROM
    zy a
WHERE
    a.projectId = '2c91808f7cc0e652017ccfc7f7ea016f'
UNION ALL
    SELECT
        b.id AS gid,
        b. NAME AS NAME,
        b.pipematerial,
        b.geom,
        b.pressurerating,
        b.pipelength,
        to_number (b.pipediam, '99999.999') AS pipediam,
        b.wallthickness,
        b.source,
        b.target
    FROM
        digital_edit_pipeline b
    WHERE
        b.condition_id = '2c9180887d45f311017d55857e9b02ac'
    AND b. ENABLE = 1

As above, you can solve the previous error report. If you need to intercept a string and then turn it into a number, you can use the trim() function, such as trim (both ‘ABC’ from pipedia), which can remove the string containing ABC in the pipedia field. The complete writing is to_number(trim(both ‘abc’ from pipediam), ‘9999.999’) AS pipediam.

In fact, the solution is the same for postgre, mysql, Oracle and other data. The difference may be that the functions of each database are different.

[Solved] Docker Install Error: repodata/repomd.xml: [Errno 14] HTTPS Error 404 – Not Found Trying other mirror.

Install docker by referring to the official documentation and execute the command

sudo yum install -y yum-utils
sudo yum-config-manager \
    --add-repo \
    https://download.docker.com/linux/centos/docker-ce.repo

sudo yum install docker-ce docker-ce-cli containerd.io

Throw an exception after

https://mirrors.aliyun.com/docker-ce/linux/centos/2.1903/x86_64/stable/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found
Trying other mirror.


 One of the configured repositories failed (Docker CE Stable - x86_64),
 and yum doesn't have enough cached data to continue. At this point the only
 safe thing yum can do is fail. There are a few ways to work "fix" this:

     1. Contact the upstream for the repository and get them to fix the problem.

     2. Reconfigure the baseurl/etc. for the repository, to point to a working
        upstream. This is most often useful if you are using a newer
        distribution release than is supported by the repository (and the
        packages for the previous distribution release still work).

     3. Run the command with the repository temporarily disabled
            yum --disablerepo=docker-ce-stable ...

     4. Disable the repository permanently, so yum won't use it by default. Yum
        will then just ignore the repository until you permanently enable it
        again or use --enablerepo for temporary usage:

            yum-config-manager --disable docker-ce-stable
        or
            subscription-manager repos --disable=docker-ce-stable

     5. Configure the failing repository to be skipped, if it is unavailable.
        Note that yum will try to contact the repo. when it runs most commands,
        so will have to try and fail each time (and thus. yum will be be much
        slower). If it is a very temporary problem though, this is often a nice
        compromise:

            yum-config-manager --save --setopt=docker-ce-stable.skip_if_unavailable=true

failure: repodata/repomd.xml from docker-ce-stable: [Errno 256] No more mirrors to try.
https://mirrors.aliyun.com/docker-ce/linux/centos/2.1903/x86_64/stable/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found

After investigation, it is found that it is in the warehouse configuration  $ releasever   Cause not found

It can be solved simply by modifying the warehouse configuration file.

Solution

1. Open the warehouse configuration file: vim /etc/yum.repos.d/docker-ce.repo

2. Editing docker-ce-stable Baseurl value for

[docker-ce-stable]
name=Docker CE Stable - $basearch
# baseurl=https://download.docker.com/linux/centos/$releasever/$basearch/stable
baseurl=https://download.docker.com/linux/centos/7/$basearch/stable

After saving and exiting, the installation command can be executed normally

sudo yum install docker-ce docker-ce-cli containerd.io

 

[Solved] Kibana 7.15.x [error][savedobjects-service] [.kibana] Action failed with ‘Request timed out’. Retrying attempt

1. Error reporting

Recently, when elasticsearch and kibana of 7.15.2 were used on the windows platform, kibana failed to start after opening the ES CMD window and reported an error.

log [09:03:50.365] [error][savedobjects-service] [.kibana] Action failed with 'Request timed out'. Retrying attempt 1 in 2 seconds.
log [09:03:50.371] [info][savedobjects-service] [.kibana] UPDATE_TARGET_MAPPINGS -> UPDATE_TARGET_MAPPINGS. took: 120043ms.
log [09:03:50.410] [error][savedobjects-service] [.kibana_task_manager] Action failed with 'Request timed out'. Retrying attempt 1 in 2 seconds.
log [09:03:50.412] [info][savedobjects-service] [.kibana_task_manager] UPDATE_TARGET_MAPPINGS -> UPDATE_TARGET_MAPPINGS. took: 120059ms.
log [09:05:52.415] [error][savedobjects-service] [.kibana] Action failed with 'Request timed out'. Retrying attempt 2 in 4 seconds.
log [09:05:52.416] [info][savedobjects-service] [.kibana] UPDATE_TARGET_MAPPINGS -> UPDATE_TARGET_MAPPINGS. took: 122050ms.
log [09:05:52.462] [error][savedobjects-service] [.kibana_task_manager] Action failed with 'Request timed out'. Retrying attempt 2 in 4 seconds.
log [09:05:52.463] [info][savedobjects-service] [.kibana_task_manager] UPDATE_TARGET_MAPPINGS -> UPDATE_TARGET_MAPPINGS. took: 122052ms.
log [09:07:56.471] [error][savedobjects-service] [.kibana] Action failed with 'Request timed out'. Retrying attempt 3 in 8 seconds.
log [09:07:56.472] [info][savedobjects-service] [.kibana] UPDATE_TARGET_MAPPINGS -> UPDATE_TARGET_MAPPINGS. took: 124055ms.
log [09:07:56.517] [error][savedobjects-service] [.kibana_task_manager] Action failed with 'Request timed out'. Retrying attempt 3 in 8 seconds.
log [09:07:56.518] [info][savedobjects-service] [.kibana_task_manager] UPDATE_TARGET_MAPPINGS -> UPDATE_TARGET_MAPPINGS. took: 124055ms.

2. Cause

In fact, the reason is very simple. If you accidentally select any string in the CMD window started by es, the output of es will be blocked, resulting in kibana startup failure. As shown in the figure below.

3. Solution

The simplest way is to cancel the selection, press enter and ESC, and then restart kibana. Of course, it is more recommended to build es into the system service of windows to avoid similar problems. Here is the official screenshot of ES, and the operation is as follows.

[Solved] org.springframework.dao.DataIntegrityViolationException: Error attempting to get column…

error

dao.DataIntegrityViolationException: Error attempting to get column 'owner_name' from result set.  Cause: java.sql.SQLDataException: Cannot determine value type from string '大老板'

reason:

Database field does not match entity class field type

If union is used in the code, each SQL field in the union must correspond one by one. When the corresponding data type is wrong, the above exception will be reported

[Solved] oauth2(spring security) Error: method_not_allowed(Request method ‘GET’ not supported)

Error message

<MethodNotAllowed>
<error>method_not_allowed</error>
<error_description>Request method &#39;GET&#39; not supported</error_description>
</MethodNotAllowed>

39 is a single quotation mark

reason

Only post is supported by default

Solution:

Download and install the postman tool (or other post tools)
use post to call

Code add get method

@Configuration
public class OAuthSecurityConfig extends AuthorizationServerConfigurerAdapter {
...
    @Override
    public void configure(AuthorizationServerEndpointsConfigurer endpoints) throws Exception {
        ...
        endpoints.allowedTokenEndpointRequestMethods(HttpMethod.GET, HttpMethod.POST);// add get method
        ...

        endpoints.tokenServices(tokenServices);
    }
...
}

 

[Solved] Docker Container Start Error: OCI runtime create failed: container with ID exists

environment

System: CentOS 7.6

Docker:20.10.7

symptom

After executing the following startup command, docker start mysqlserver an exception occurs and an error is reported

1 docker start mysqlserver
2 Error response from daemon: OCI runtime create failed: container with id exists: c29c0bc9836880aa883d1ac7e50da56656ed9b2c5499831f3610d775997aa5f2: unknown
3 Error: failed to start containers: mysqlserver

Solution

 1 # Go to the following directory
 2 cd /run/docker/runtime-runc/moby
 3 
 4 # Run the ls command to see a similar display
 5 ls
 6 2901da5462f792296b36ce7e982d8ef66233fce3c78c8c150522893625768e56
 7 c29c0bc9836880aa883d1ac7e50da56656ed9b2c5499831f3610d775997aa5f2
 8 ed4c1c5e03c74b3ce4c41aafbb5f276064d51546f8359ed493b3623a0baaf648
 9 
10 # Delete folder by rm -rf command
11 # For example, delete the folder corresponding to the error id (c29c0bc9836880aa883d1ac7e50da56656ed9b2c5499831f3610d775997aa5f2) in the symptom
12 rm -rf c29c0bc9836880aa883d1ac7e50da56656ed9b2c5499831f3610d775997aa5f2/
13 
14 # Delete and re-execute the command to start the container
15 docker start mysqlserver

[Solved] Spring Boot Package Error: Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0

Error Messages:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-resources) on project helloworld: Input length = 1 -> [Help 1]

Problem Analysis
1, plugins tag inside the lack of maven-resources-plugin dependency.

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
    </plugins>
</build>

Solution: add Maven resources plugin dependency.

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-resources-plugin</artifactId>
            <version>3.1.0</version>
        </plugin>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
    </plugins>
</build>

[Solved] Hive Update and Delete Error: Attempt to do update or delete using transaction manager

By default, there is no default support for single insert (update), update and delete (delete) operations in hive, you need to configure it yourself. And by default, when a user uses the update and delete operations, the following happens.
hive> update dp set name=’beijing’ where id=1159;
FAILED: SemanticException [Error 10294]: Attempt to do update or delete using transaction manager that does not support these operations.

The following is a step-by-step guide to enable the update and delete functions.
1. In the hive-site.xml file, add the following attributes.

<name>hive.support.concurrency</name>
<value>true</value

<name>hive.force.bucketing</name
<value>true</value>

<name>hive.exec.dynamic.partition.mode</name
<value>nonstrict</value>

<name>hive.txn.manager</name>
<value>org.apache.hadoop.hive.ql.lockmgr.DbTxnManager</value>

<name>hive.compactor.initiator.on</name
<value>true</value>

<name>hive.compactor.worker.threads</name
<value>1</value>

<name>hive.in.test</name
<value>true</value>

2. restarting the hive service.

3. Create the table.
create table student(
id int,
name String,
sex varchar(2),
birthday varchar(10),
major varchar(1)
) clustered by (id) into 2 buckets stored as orc TBLPROPERTIES(‘transactional’=’true’);

4, test update, delete statement
hive> update student set name=’beijing’ where id=1159;

Modify successfully. The frequent update and delete operations have defeated the original purpose of hive. As a last resort, it is best to use the incremental add method.

[Solved] Hadoop running jar package error: xception in thread “main” java.lang.ClassNotFoundException: Filter

Execute Commands: [root@hadoop102 mapreduce]# hadoop jar mapreduce2_maven.jar Filter

Error Messages:

Exception in thread "main" java.lang.ClassNotFoundException: Filter
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at org.apache.hadoop.util.RunJar.run(RunJar.java:311)
at org.apache.hadoop.util.RunJar.main(RunJar.java:232)

Solution: change hadoop jar mapreduce2_maven.jar Filter to hadoop jar mapreduce2_maven.jar exper.
Reason: class path problem