当前位置:网站首页>Problems encountered in 2022 work IV

Problems encountered in 2022 work IV

2022-07-06 03:03:00 The moonlight is beautiful tonight

1、 request 60s Overtime

The phenomenon : Colleagues request to appear 60s Overtime , Local Normal , The production environment has exceeded 60s Report timeout error , Tips 504 gateway timeout

reason :nginx The default backend server processing request timeout ( Page waiting for server response time )60s

resolvent : Set the appropriate timeout for the backend server to process requests

nginx Of conf The configuration file , stay location / {} Add proxy_read_timeout 600;( Don't forget to add a semicolon ) As shown below :

location / {
        ...
        proxy_read_timeout 150;  #  second 
        ...
    }

2、gitlab The port to take up

modify puma web Application port

vim /var/opt/gitlab/gitlab-rails/etc/puma.rb

bind 'tcp://127.0.0.1:9109'

gitlab The configuration file /etc/gitlab/gitlab.rb

 puma['listen'] = '127.0.0.1'
 puma['port'] = 9109 #  Default 8080, And  `puma.rb`  Configure the same port in 
 puma['socket'] = '/var/opt/gitlab/gitlab-rails/sockets/gitlab.socket'
 puma['somaxconn'] = 1024
 
 nginx['listen_port'] = 8083 #  Modify the built-in nginx Port used , Default 80, Avoid conflicts with the original nginx Port conflict 

restart gitlab service

gitlab-ctl reconfigure
gitlab-ctl restart

3、 Inquire about oracle Primary key constraint

select * from dba_constraints where constraint_name='PK_WM_CONTRL_MATERIAL_RECEIVE_PRICE';

4、jenkins Integration migration to git

1. Server installation git

yum install git

2.jenkins The source code management in the project is changed to git, Input gitlab Warehouse address and account number , And specify the Automated Deployment Branch

[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-xdlpuFFe-1656927341298)(C:\Users\11244\AppData\Roaming\Typora\typora-user-images\image-20220430114248998.png)]

3. If it is a back-end project, you need to give the script startup.sh Add execute permission

chmod +x ./bin/startup.sh

Such as :

[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-XmULh2c0-1656927341300)(C:\Users\11244\AppData\Roaming\Typora\typora-user-images\image-20220430114529006.png)]

5、git pull Report errors

error: Your local changes to the following files would be overwritten by merge:

resolvent :

git stash
git pull origin spd-dev
git stash pop

6、 see oracle constraint

SELECT * FROM DBA_CONSTRAINTS WHERE constraint_name like '%FK_CERT_CHA_REFERENCE_BASE_CER%';
SELECT * FROM USER_CONSTRAINTS WHERE TABLE_NAME like '%BASE_CERT%';

7、sql Error report in execution ParserException

ExecutorException: Error preparing statement. Cause: com.alibaba.druid.sql.parser.ParserException: TODO : pos 293, line 4, column 27, token ON

Enter source code view statement Medium sql sentence , Find out sql normal

org.apache.ibatis.executor.statement.PreparedStatementHandler#query
public <E> List<E> query(Statement statement, ResultHandler resultHandler) throws SQLException {
    PreparedStatement ps = (PreparedStatement) statement;
    ps.execute();
    return resultSetHandler.handleResultSets(ps);
  }

Breakpoint discovery is a parsing error when encapsulating the result set

8、 Cascade query error

Caused by: org.apache.ibatis.executor.result.ResultMapException: Error attempting to get column 'id' from result set.  Cause: com.alibaba.fastjson.JSONException: syntax error, expect {, actual int, pos 15, line 1, column 16220526000012424

Cascading query code :

<collection property="detailList" ofType="com.xxxDetail"
                    select="com.xxxDetailMapper.list" column="id"/>

Through the source code analysis found that , When cascading subqueries mybatis hold id As json analysis , So the above error message appears

public T getNullableResult(ResultSet rs, String columnName) throws SQLException {
        String sqlJson = rs.getString(columnName);
        if (null != sqlJson) {
            return JSONObject.parseObject(sqlJson, clazz);
        }
        return null;
    }

Cause analysis , The subquery contains multiple condition parameters , therefore mybatis Need to put column As json Only by parsing can we know id Which condition parameter .

resolvent , Modify the cascading query code :

<collection property="detailList" ofType="com.xxxDetail"
                    select="com.xxxDetailMapper.list" column="{backId=id}"/>

9、oracle simulation drop if exists

BEGIN
   EXECUTE IMMEDIATE 'DROP TABLE abc';
EXCEPTION
   WHEN OTHERS THEN
      IF SQLCODE != -942 THEN
         RAISE;
      END IF;
END;
/
CREATE TABLE abc
(
   ID                   VARCHAR2(128)        NOT NULL,
   TASK_STATUS          NUMBER(2)            NOT NULL,
   SURGERY_CODE         VARCHAR2(50)
);

10、 Connect seata Report errors can not register RM

linux Server startup Seata after ,Spring cloud Project to connect seata Report errors :

can not connect to 192.168.122.1:8091 cause:can not register RM,err:can not connect to services-server

Check seata stay nacos Registered service information discovery in ,seata Registered in nacos The address in is 192.168.122.1, Local ping or telnet None of them were successful ,spring cloud The project is obtained through the service name ip Later, due to 192.168.122.1 The Internet is not working , So wrong reporting can not connect to services-server

[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-WZojUK7k-1656927341300)(C:\Users\11244\AppData\Roaming\Typora\typora-user-images\image-20220704153839337.png)]

192.168.122.1 come from virbr0 network card , This is because the system is installed with libvirt A service will generate something .virbr0 yes KVM The default creation is Bridge, Its function is to connect

Virtual machine network card provides NAT Access to the Internet .

virbr0 One is assigned by default IP 192.168.122.1, It also provides support for other virtual network cards connected to it DHCP service .

[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-By5SUlYc-1656927341301)(C:\Users\11244\AppData\Roaming\Typora\typora-user-images\image-20220704160037989.png)]

resolvent , Specify the external network when starting ip, Do not use 127.0.0.1

./seata-server.sh -h 192.168.xxx
原网站

版权声明
本文为[The moonlight is beautiful tonight]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/187/202207060258038567.html