Author Archives: Robins

User space operation GPIO error echo: write error: device or resource busy error resolution

Error when using echo 17 > /sys/class/gpio/export: -sh: echo: write error: Device or resource busy
-sh: echo: write error: Device or resource busy
Shows that gpio is occupied.

To check the occupancy status.

cat /sys/kernel/debug/gpio
If no such directory is available.
mount -t debugfs debugfs /sys/kernel/debug

Android r compiles OTA times error: ExternalError: Invalid ro.product.property_source_order

In make dist dist_ When compiling OTA package, dir = mydist encountered an error, which was not encountered in previous Android versions. Here is a record
error report content:

2021-07-02 09:53:29 - common.py - WARNING : Failed to read ODM/build.prop
2021-07-02 09:53:29 - add_img_to_target_files.py - ERROR   : 
   ERROR:
Traceback (most recent call last):
  File "/home/xxxx/yourdevice_r_1.0_dev_0616/android/out/host/linux-x86/bin/add_img_to_target_files/add_img_to_target_files.py", line 999, in <module>
  File "/home/xxxx/yourdevice_r_1.0_dev_0616/android/out/host/linux-x86/bin/add_img_to_target_files/add_img_to_target_files.py", line 993, in main
  File "/home/xxxx/yourdevice_r_1.0_dev_0616/android/out/host/linux-x86/bin/add_img_to_target_files/add_img_to_target_files.py", line 733, in AddImagesToTargetFiles
  File "/home/xxxx/yourdevice_r_1.0_dev_0616/android/out/host/linux-x86/bin/add_img_to_target_files/common.py", line 701, in LoadInfoDict
    build_info = BuildInfo(d)
  File "/home/xxxx/yourdevice_r_1.0_dev_0616/android/out/host/linux-x86/bin/add_img_to_target_files/common.py", line 393, in __init__
    self._device = self.GetOemProperty("ro.product.device")
  File "/home/xxxx/yourdevice_r_1.0_dev_0616/android/out/host/linux-x86/bin/add_img_to_target_files/common.py", line 509, in GetOemProperty
    return self.GetBuildProp(key)
  File "/home/xxxx/yourdevice_r_1.0_dev_0616/android/out/host/linux-x86/bin/add_img_to_target_files/common.py", line 451, in GetBuildProp
    return self._ResolveRoProductBuildProp(prop)
  File "/home/xxxx/yourdevice_r_1.0_dev_0616/android/out/host/linux-x86/bin/add_img_to_target_files/common.py", line 476, in _ResolveRoProductBuildProp
    "Invalid ro.product.property_source_order '{}'".format(source_order))
**ExternalError: Invalid ro.product.property_source_order '['odm', 'vendor', 'product', 'product_services', 'system']'**

Analyze the corresponding common. Py code

common.py script
 def _ResolveRoProductBuildProp(self, prop):
   default_source_order = self._GetRoProductPropsDefaultSourceOrder()
   source_order_val = self._GetRawBuildProp(
        "ro.product.property_source_order", None)
   source_order = source_order_val.split(",")
       if any([x not in default_source_order for x in source_order]):
      raise ExternalError(
          "Invalid ro.product.property_source_order '{}'".format(source_order))#挂在这行

  def _GetRoProductPropsDefaultSourceOrder(self):
  ...
  return BuildInfo._RO_PRODUCT_PROPS_DEFAULT_SOURCE_ORDER_CURRENT

  _RO_PRODUCT_PROPS_DEFAULT_SOURCE_ORDER_CURRENT = [
      "product", "odm", "vendor", "system_ext", "system"]

Open systme.prop in the board

ro.product.property_source_order=odm,vendor,product,product_services,system

It can be seen that the two do not match, resulting in an error
modify the ro.product.property in system.prop_ source_ The content of the order property, so that the two are equal, the compiler will no longer report an error.

#ro.product.property_source_order=odm,vendor,product,product_services,system
ro.product.property_source_order=odm,vendor,product,system_ext,system

[Solved] Git error: You have not concluded your merge (MERGE_HEAD exists)

Enter the root directory of the website

Solution 1: keep the local changes and stop merging – & gt; Re merge – & gt; Pull again

$:git merge --abort
$:git reset --merge
$:git pull

Solution 2: discard the local code, and the remote version will cover the local version (be careful)

$:git fetch --all           //Repulling
$:git reset --hard origin/master //git reset --hard reverts master back to origin/master and ignores all new commits
$:git fetch

Cannot resolve classpath entry: e://jar/mysql-connector-java-5.1.17-bin mybatis error in reverse engineering

error: failed: Cannot resolve classpath entry: E:\jar\mysql-connector-java-5.1.17-bin -> [Help 1]

[INFO] Scanning for projects…
[INFO]
[INFO] ————————–< pay-center:demo >—————————
[INFO] Building demo 0.0.1-SNAPSHOT
[INFO] ——————————–[ jar ]———————————
[INFO]
[INFO] — mybatis-generator-maven-plugin:1.3.2:generate (default-cli) @ demo —
[INFO] ————————————————————————
[INFO] BUILD FAILURE
[INFO] ————————————————————————
[INFO] Total time: 1.043 s
[INFO] Finished at: 2021-07-01T10:31:26+08:00
[INFO] ————————————————————————
[ERROR] Failed to execute goal org.mybatis.generator:mybatis-generator-maven-plugin:1.3.2:generate (default-cli) on project demo: Execution default-cli of goal org.mybatis.generator:mybatis-generator-maven-plugin:1.3.2:generate failed: Cannot resolve classpath entry: E:\jar\mysql-connector-java-5.1.17-bin -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
My generatorConfig.xml file looks like this, showing only the parts.



My generatorConfig.xml file looks like this, showing only the parts.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE generatorConfiguration
        PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN"
        "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd" >
<generatorConfiguration>


    <!-- Database driver: select the database driver package on your local hard disk-->
    <classPathEntry  location="E:\jar\mysql-connector-java-5.1.17-bin"/>

    <context id="DB2Tables"  targetRuntime="MyBatis3">
        <commentGenerator>
            <property name="suppressDate" value="true"/>
            <!-- Whether to remove automatically generated comments true: yes : false:no -->
            <property name="suppressAllComments" value="true"/>
        </commentGenerator>



This database driver cannot be found problem occurs, go directly to the database driver to delete. The following figure shows the comparison of the two figures
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE generatorConfiguration
        PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN"
        "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd" >
<generatorConfiguration>

    

    <context id="DB2Tables"  targetRuntime="MyBatis3">
        <commentGenerator>
            <property name="suppressDate" value="true"/>
            <!-- Whether to remove automatically generated comments true: yes : false:no -->
            <property name="suppressAllComments" value="true"/>
        </commentGenerator>

Solution to the failure of ROS noetic initialization (rosdep init)

This method focuses on

 

ERROR: cannot download default sources list from:
https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/sources.list.d/20-default.list

I. Download rosdistro files manually
rosdistro is downloaded to the home directory by default

git clone https://github.com/ros/rosdistro.git

2.Modify 20-default.list

The terminal enters the following command to get the path of the home directory

pwd

Enter rosdistro/rosdep/sourceslist. D, open the 20-default.list file, and

https://raw.githubusercontent.com/ros/rosdistro/master

Amend to read

file:///home/username/rosdistro

Where/home/username is the path obtained by PWD command

3. Modify py file

1. Modification__ init__. py

cd ~/usr/lib/python3/dist-packages/
sudo gedit ./rosdistro/__init__.py

Convert DEFAULT_INDEX_URLs to

DEFAULT_INDEX_URL=” file:///home/username/rosdistro/index-v.yaml “

2, correct3.py

sudo gedit ./rosdep2/rep3.py

Change REP3_TAGETS_URL to

REP3_TAGETS_URL=”file:///home/username/rosdistro/releases/targets.yaml”

3. Modify sources_list.py

sudo gedit ./rosdep2/sources_list.py

Change DEFAULT_SOURCES_LIST_URL to

DEFAULT_SOURCES_LIST_URL=”file:///home/username/rosdistro/rosdep/sources.list.d/20-default.list”

4. Modify gbpdistro_support.py

sudo gedit ./rosdep2/gbpdistro_support.py

Change FUTURE_GBPDISTRO_URL to

FUTURE_GBPDISTRO_URL=”file:///home/username/rosdistro/releases/future.yaml”

4. Reinitialization

sudo rosdep init
rosdep update

[Solved] unknown error: Chrome failed to start: exited abnormally (Driver info: chromedriver=2.36.540471

I wrote a crawler in python, it works fine in pycharm, but it reports an error on the command line under linux
Message: unknown error: Chrome failed to start: exited abnormally
(Driver info: chromedriver=2.36.540471 (9c759b81a907e70363c6312294d30b6ccccc2752),platform=Linux 4.14.0-deepin2-amd64 x86_64)
You are using arg –headless so with that my be you can try with another argument –no-sandbox and window-size=1024,768.

chrome.additional.capabilities={“chromeOptions”:{“args”:[“–headless”, “window-size=1024,768”, “–no-sandbox”], “binary”: “/home/ubuntu/software/chromedriver”}}

Solution:

chrome_options = Options()
chrome_options.add_argument('--headless')
chrome_options.add_argument('--disable-gpu')
chrome_options.add_argument("window-size=1024,768")
chrome_options.add_argument("--no-sandbox")
driver = webdriver.Chrome(chrome_options=chrome_options)

Error (17) solves the problem of losing the request header of multithread asynchronous feign call

questions

In microservice, the request header will be lost in multithreading asynchronous + feign call

solving
    1. in the main thread, the request header parameters are first obtained and passed into the sub thread, and then the sub thread sets the request header parameters to the context. Finally, in feign forwarding processing, the request header data of the context set by the sub thread is obtained and forwarded to the downstream

Get context request parameter tool class

@Slf4j
public class RequestContextUtil {

    /**
     * Get request header data
     *
     * @return key-> request header name value-> request header value
     * @author zhengqingya
     * @date 2021/6/30 9:39 PM
     */
    public static Map<String, String> getHeaderMap() {
        Map<String, String> headerMap = Maps.newLinkedHashMap();
        try {
            ServletRequestAttributes requestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
            if (requestAttributes == null) {
                return headerMap;
            }
            HttpServletRequest request = requestAttributes.getRequest();
            Enumeration<String> enumeration = request.getHeaderNames();
            while (enumeration.hasMoreElements()) {
                String key = enumeration.nextElement();
                String value = request.getHeader(key);
                headerMap.put(key, value);
            }
        } catch (Exception e) {
            log.error("《RequestContextUtil》 Failed to get request header parameters:", e);
        }
        return headerMap;
    }

}

Request header context

@Slf4j
public class RequestHeaderHandler {

    public static final ThreadLocal<Map<String, String>> THREAD_LOCAL = new ThreadLocal<>();

    public static void setHeaderMap(Map<String, String> headerMap) {
        THREAD_LOCAL.set(headerMap);
    }

    public static Map<String, String> getHeaderMap() {
        return THREAD_LOCAL.get();
    }

    public static void remove() {
        THREAD_LOCAL.remove();
    }

}

Feign forwarding process RPC call parameter transfer

 */
@Slf4j
@Configuration
public class FeignRequestInterceptor implements RequestInterceptor {

    @Override
    @SneakyThrows
    public void apply(RequestTemplate requestTemplate) {
        log.debug("========================== ↓↓↓↓↓↓ 《FeignRequestInterceptor》 Start... ↓↓↓↓↓↓ ==========================");
        Map<String, String> threadHeaderNameMap = RequestHeaderHandler.getHeaderMap();
        if (!CollectionUtils.isEmpty(threadHeaderNameMap)) {
            threadHeaderNameMap.forEach((headerName, headerValue) -> {
                log.debug("《FeignRequestInterceptor》 Multi-threaded headerName:[{}] headerValue:[{}]", headerName, headerValue);
                requestTemplate.header(headerName, headerValue);
            });
        }
        Map<String, String> headerMap = RequestContextUtil.getHeaderMap();
        headerMap.forEach((headerName, headerValue) -> {
            log.debug("《FeignRequestInterceptor》 headerName:[{}] headerValue:[{}]", headerName, headerValue);
            requestTemplate.header(headerName, headerValue);
        });
        log.debug("========================== ↑↑↑↑↑↑ 《FeignRequestInterceptor》 End... ↑↑↑↑↑↑ ==========================");
    }

}

Use cases

@Slf4j
@RestController
@RequestMapping("/web/api/demo/test")
@Api(tags = "test api")
@AllArgsConstructor
public class RpcController extends BaseController {

    private SystemTaskThread systemTaskThread;

    @GetMapping("getContextUserId")
    @ApiOperation("rpc Call test - Async")
    public void getContextUserId() {
        Map<String, String> headerMap = RequestContextUtil.getHeaderMap();
        log.info("Main thread request header value: {}", headerMap.get("userId"));
        this.systemTaskThread.getRequestHeaderUserId(RequestContextUtil.getHeaderMap());
    }

}

@Slf4j
@Component
@AllArgsConstructor
public class SystemTaskThread {

    private ISystemClient systemClient;

    @SneakyThrows
    @Async(ThreadPoolConstant.SMALL_TOOLS_THREAD_POOL)
    public void getRequestHeaderUserId(Map<String, String> headerMap) {
        RequestHeaderHandler.setHeaderMap(headerMap);
        log.info("Sub-thread request header value: {}", this.systemClient.getRequestHeaderUserId());
    }

}

Note: it is also mentioned on the Internet that the main thread obtains the request parameters requestattributes, requestattributes = requestcontextholder. Getrequestattributes() to the child thread, and then re assign requestcontextholder. Setrequestattributes (requestattributes) But this method is not effective. Please record it here by the way~

NBU The vnet proxy encounrtened an error [How to Solve]

0 div。

NBU 41 client Vnet agent encountered an error

prathakan

https://www.veritas.com/content/support/en_US/article.100039650
https://www.veritas.com/content/support/en_US/article.100039943

Problem description

After installing the NBU client software and adding the client to NBU, it is found that the client reports an error, such as the title. After consulting the official articles, it is found that the Vnet connection may have failed. It is necessary to test the connection on the client, and carry out the corresponding operation according to the error.

Client: Linux has completed the client software installation, windows, please read the resources

Processing steps

Processing steps:
1. Check whether other clients can connect normally. Click once, it can be the problem of the client

# Execute the following command on the NBU master to check the vnet status
bpps 

2. Log in to the client server
for preliminary check (all commands here need to be executed in the NBU client installation directory)

# 1、Test the connection status
<install_path>/netbackup/bin/bpclntcmd -pn -verbose
# The default installation directory is: /usr/openv/
cd /usr/openv/bin/

# 2. Check the certificate status:
<installation path>/netbackup/bin/nbcertcmd -listCACertDetails

Question 1: there is something wrong with the certificate

# First backup the original certificate
mv /usr/openv/var/webtruststore/cacert.pem /tmp
# Get the certificate from Master
nbcertcmd -getCACertificate
# View Certificate
nbcertcmd -listCACertDetails

Problem 2: there is a problem with the connection state

./nbcertcmd -getCertificate -host client Hostname -server nbuMaster Hostname
# The result of the execution is as follows.
Host certificate and certificate revocation list received successfully from server NBUMaster Hostname.

Rabbitmq failed to stop normally: ERROR: node with name “rabbit” already running on “localhost”

ERROR: node with name “rabbit” already running on “localhost”
[root@localhost init.d]# rabbitmqctl stop
Stopping and halting node rabbit@localhost
Error: unable to connect to node rabbit@localhost: nodedown
ERROR: node with name “rabbit” already running on “localhost”//Common rabbitmq commands
service rabbitmq-server   start
service rabbitmq-server   stop
service rabbitmq-server   status
service rabbitmq-server   rotate-logs|
service rabbitmq-server   restart
service rabbitmq-server   condrestart
service rabbitmq-server   try-restart
service rabbitmq-server   reload
service rabbitmq-server   force-reload
service rabbitmq-server   -detached    //Start in the background
ps -ef | grep rabbitmq View rabbitMq processes
netstat -anplt | grep LISTEN rabbitmq listens on port 15672/5672 by default
Currently, the only way to stop the process is to find the PID

[Solved] Rabbitmq Warning: java.net.SocketException: socket closed

Abnormal log appears in the background:

java.net.SocketException: socket closed

crcimpl.ForgivingExceptionHandler An unexpected connection driver error occured

Note:

RabbitMQ will open 3 ports, 5672, 15672, 25672, of which 5672 is used to provide message queue service, 15672 is used to enable background http access,
and 15672 is not opened by default.

1. Open port 5672 on the server.

Open port 5672:
firewall-cmd –zone=public –add-port=5672/tcp –permanent
Reload:
firewall-cmd –reload

2. Modify the port in the project to 5672

spring:
application:
name: config-client
rabbitmq:
host: localhost
port: 5672
username: admin
password: 123456
virtual-host: /
3. The user has operation authority on the virtual host.

[Solved] This is probably not a problem with npm. There is likely additional logging output above.

If this error occurs, you need to re install the node_ Contents in the modules folder   But before installing, you should clear all the previous contents. The steps are as follows:

1. Delete the node first_ modules

rmdir /s/q node_modules

2.delete package-lock.json file
3.npm cache clean –force
4.npm install(npm i is ok)

[Solved] /var/tmp/rpm-tmp. The tmp file cannot be found when the installation fails

When installing the package generated by rpmbuild, the following error occurred:

/var/tmp/rpm-tmp.YiDXeN: line 374: syntax error: unexpected end of file

 

Solution:

Write a shell script:

#!/ bin/bash

while [ 1 -eq 1 ]
do
cat -n /var/tmp/rpm-tmp.*
done

Then execute./Sh_ test.sh

Another window starts the installation, and you can see in the front window where the error stopped.

If/var/TMP/rpm-tmp.6ljgwm: Line 374: syntax error: unexpected end of file

Generally, if and fi are not paired. You can use Notepad + + statistics to see if   Don’t count elif

Or use Notepad to open the spec script, highlight if and see the pairing.

have not closed a control structure such as a missing  fi   with an  if, or a missing  done   with a  for.