Category Archives: Error

[Solved] webview Switch Error: Failed to start Chromedriver session: Failed to get sockets matching: @weblayer_devtools_remote_.*4738

def switch_to_webview_wx(self):
    # context = 'WEBVIEW_com.tencent.mm:tools'
    context = 'WEBVIEW_com.tencent.mm:toolsmp'
    self.__switch_to(context)
    time.sleep(3)
    self.__sel_handle()

When switching webview, throwing exceptions, the context I was using before was: WEBVIEW_com.tencent.mm:tools, then it became WEBVIEW_com.tencent.mm:toolsmp

Only modify the value of context, still the same error is reported, see the log has loaded “androidProcess”: “com.tencent.mm:tools”,

 

Solution:

Modify desired_caps to “androidProcess”: “com.tencent.mm:toolsmp”, and it works!

"appPackage"      :   "com.tencent.mm",
"appActivity"     :   ".ui.LauncherUI",
"app"             :   "",
"noReset"         :   true,
"fullReset"       :   false,
"noSign"          :   true,
"unicodeKeyboard" :   true,
"resetKeyboard"   :   true,
"skipServerInstallation" : true,
"skipDeviceInitialization" : true,
"chromedriverExecutableDir" : "\\res\\chromedriver\\",
"chromedriverChromeMappingFile" : "\\res\\chromedriver\\chromedriver.json",
"chromeOptions"   :   {
      "androidProcess" : "com.tencent.mm:toolsmp"
}
 1 [Chromedriver] Attempting to use Chromedriver-Chrome mapping from 'D:\jiaolt\A_SVN_AUTO\auto_mwp\auto_mwp\res\chromedriver\chromedriver.json'
 2 [Chromedriver] No file found at 'D:\jiaolt\A_SVN_AUTO\auto_mwp\auto_mwp\res\chromedriver\chromedriver.json'. Using default mapping
 3 [Chromedriver] Found 4 executables in 'D:\jiaolt\A_SVN_AUTO\auto_mwp\auto_mwp\res\chromedriver\'
 4 [Chromedriver] Cannot retrieve version number from 'readme.md' Chromedriver binary. Make sure it returns a valid version string in response to '--version' command line argument. spawn UNKNOWN
 5 [Chromedriver] The following Chromedriver executables were found:
 6 [Chromedriver]     'D:/jiaolt/A_SVN_AUTO/auto_mwp/auto_mwp/res/chromedriver/chromedriver89.exe' (version '89.0.4389.23', minimum Chrome version 'Unknown')
 7 [Chromedriver]     'D:/jiaolt/A_SVN_AUTO/auto_mwp/auto_mwp/res/chromedriver/chromedriver_77_0_3865_40.exe' (version '77.0.3865.40', minimum Chrome version 'Unknown')
 8 [Chromedriver]     'D:/jiaolt/A_SVN_AUTO/auto_mwp/auto_mwp/res/chromedriver/chromedriver_74_0_3729_6_AN9_P30 .exe' (version '74.0.3729.6', minimum Chrome version '74.0.3729')
 9 [ADB] Getting package info for 'com.android.chrome'
10 [ADB] Running 'D:\tools\Android\android_sdk\platform-tools\adb.exe -P 5037 -s 3fc24606 shell dumpsys package com.android.chrome'
11 [Chromedriver] Unable to discover Chrome version. Using Chromedriver 89.0.4389.23 at 'D:/jiaolt/A_SVN_AUTO/auto_mwp/auto_mwp/res/chromedriver/chromedriver89.exe'
12 [Chromedriver] Set chromedriver binary as: D:/jiaolt/A_SVN_AUTO/auto_mwp/auto_mwp/res/chromedriver/chromedriver89.exe
13 [Chromedriver] Killing any old chromedrivers, running: wmic process where "commandline like '%chromedriver.exe%--port=8000%'" delete
14 [Chromedriver] Successfully cleaned up old chromedrivers
15 [Chromedriver] Cleaning any old adb forwarded port socket connections
16 [ADB] List forwarding ports
17 [ADB] Running 'D:\tools\Android\android_sdk\platform-tools\adb.exe -P 5037 -s 3fc24606 forward --list'
18 [Chromedriver] Spawning chromedriver with: D:/jiaolt/A_SVN_AUTO/auto_mwp/auto_mwp/res/chromedriver/chromedriver89.exe --url-base=wd/hub --port=8000 --adb-port=5037 --verbose
19 [Chromedriver] Chromedriver version: '89.0.4389.23'
20 [WD Proxy] Matched '/status' to command name 'getStatus'
21 [WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8000/wd/hub/status] with no body
22 [WD Proxy] Got response with status 200: {"value":{"build":{"version":"89.0.4389.23 (61b08ee2c50024bab004e48d2b1b083cdbdac579-refs/branch-heads/4389@{#294})"},"message":"ChromeDriver ready for new sessions.","os":{"arch":"x86_64","name":"Windows NT","version":"6.1.7601 SP1"},"ready":true}}
23 [Chromedriver] Starting W3C Chromedriver session with capabilities: {
24 [Chromedriver]   "capabilities": {
25 [Chromedriver]     "alwaysMatch": {
26 [Chromedriver]       "goog:chromeOptions": {
27 [Chromedriver]         "androidPackage": "com.tencent.mm",
28 [Chromedriver]         "androidUseRunningApp": true,
29 [Chromedriver]         "androidProcess": "com.tencent.mm:tools",
30 [Chromedriver]         "androidDeviceSerial": "3fc24606"
31 [Chromedriver]       },
32 [Chromedriver]       "goog:loggingPrefs": {
33 [Chromedriver]         "browser": "ALL"
34 [Chromedriver]       }
35 [Chromedriver]     }
36 [Chromedriver]   }
37 [Chromedriver] }
38 [WD Proxy] Matched '/session' to command name 'createSession'
39 [WD Proxy] Proxying [POST /session] to [POST http://127.0.0.1:8000/wd/hub/session] with body: {"capabilities":{"alwaysMatch":{"goog:chromeOptions":{"androidPackage":"com.tencent.mm","androidUseRunningApp":true,"androidProcess":"com.tencent.mm:tools","androidDeviceSerial":"3fc24606"},"goog:loggingPrefs":{"browser":"ALL"}}}}
40 [WD Proxy] Got an unexpected response with status 500: {"value":{"error":"unknown error","message":"unknown error: Failed to get sockets matching: @weblayer_devtools_remote_.*4738\n  (make sure the app has its WebView/WebLayer configured for debugging)","stacktrace":"Backtrace:\n\tOrdinal0 [0x0018E7D3+124883]\n\tOrdinal0 [0x0018E7B1+124849]\n\tGetHandleVerifier [0x003D8688+193832]\n\tGetHandleVerifier [0x003C1DCE+101486]\n\tGetHandleVerifier [0x003C93BA+131674]\n\tGetHandleVerifier [0x003C8DF4+130196]\n\tGetHandleVerifier [0x003EE860+284416]\n\tGetHandleVerifier [0x003EE035+282325]\n\tGetHandleVerifier [0x00414A90+440624]\n\tGetHandleVerifier [0x004147FC+439964]\n\tGetHandleVerifier [0x0041154B+426987]\n\tGetHandleVerifier [0x003F4FFD+310941]\n\tGetHandleVerifier [0x003F5D8E+314414]\n\tGetHandleVerifier [0x003F5D19+314297]\n\tGetHandleVerifier [0x004B31EC+1089676]\n\tGetHandleVerifier [0x004B17C9+1082985]\n\tGetHandleVerifier [0x004B13A3+1081923]\n\tGetHandleVerifier [0x005AD9FD+2115741]\n\tOrdinal0 [0x002DB82E+1488942]\n\tOrdinal0 [0x00275A7D+1071741]\n\tOrdi...
41 [W3C] Matched W3C error code 'unknown error' to UnknownError
42 [Chromedriver] Failed to start Chromedriver session: An unknown server-side error occurred while processing the command. Original error: unknown error: Failed to get sockets matching: @weblayer_devtools_remote_.*4738
43 [Chromedriver]   (make sure the app has its WebView/WebLayer configured for debugging)

[Solved] nvidia-smi Error: Failed to initialize NVML: Driver/library version mismatch

Record the problems and solutions encountered when configuring CUDA environment, which has been convenient for future verification:

problem

When the terminal inputs NVIDIA-SMI, the following error is reported:

Failed to initialize NVML: Driver/library version mismatch

The reason for this situation is that the NVIDIA kernel driver version and the system driver do not match.

Most of the cases of this error may be the NVIDIA driver is installed in the low version, due to the system update, the kernel version upgrade led to NVIDIA can not be applied in the high kernel version, the new version of the kernel and the graphics driver does not match, the graphics driver version is too low!

In my case, when I configured a low version of cuda, I accidentally lowered the version of the graphics driver, resulting in an error due to its inconsistency with the system kernel version. In order to restore the previous version, here I solved the problem by reinstalling the corresponding version of the graphics card driver.

Installing the graphics card driver

For the method of this step, please refer to method 2 in this blog. Thank you very much!!

Step 1: install the graphics card driver PPA

The website of NVIDIA’s official PPA is: https://launchpad.net/ ~Graphics drivers/+ archive/Ubuntu/PPA, you can view all graphics card drivers.

lspci | grep NVIDIA #Check the PCIE installed graphics card on your computer, theoretically you don't need to check, you should know it on your own computer
sudo add-apt-repository ppa:graphics-drivers/ppa # Add the graphics card installation source

The installation process of NVIDIA graphics card can take any time for NVIDIA graphics card installation. Press enter in the middle to continue. (because the problem has been solved when writing this blog, there is no way to release the screenshot of the process. For details, please refer to the blog in the link)

NVIDIA PPA is installed into the cache of apt package repository Update it later.

sudo apt update

Step 2: find the appropriate graphics card driver

Open the graphics card driver query website:

When my graphics card is Titan XP, find the corresponding option and click search to query

You can see that currently (2022.1.14), the driver version number of my graphics card is 470.94. Verify whether the driver version of the graphics card can be installed initially. You can visit the link and view it according to the system type

Use the following command to search the PPA for the 470 Version (no need to pay attention to the number after the decimal point) of the graphics card driver:

apt search nvidia-470

Good luck, just have; If not found, you can search and use it from high to low according to all available graphics card driver versions in the above web page.

Step 3: remove the previously installed graphics card driver on the system

sudo apt purge nvidia*

This instruction will remove all the graphics card drivers and CUDA used. When the graphics card driver remains unchanged, it will simply upgrade CUDA and delete the previous CUDA version.

Step 4: install the graphics card driver

In this step, use the following commands to install:

sudo apt install nvidia-driver-470

Step 5: restart the computer and verify

sudo reboot
nvidia-smi
lsmod | grep nvidia
nvcc --version

 

[Solved] SSZipArchive Decompress Error: failed to open file in zip file

1. Add manually and drag ssziparchive library directly, and an error will be reported

Error Domain=SSZipArchiveErrorDomain Code=-2 “failed to open file in zip file”

2. Solution

Notes for using ssziparchive:

Add the following GCC_ PREPROCESSOR_ DEFINITIONS:

HAVE_ INTTYPES_ H HAVE_ PKCRYPT HAVE_ STDINT_ H HAVE_ WZAES HAVE_ ZLIB $(inherited).

build Setting-Preprocessor Macros–Multiple values (Double-Click), add the following codes:

HAVE_INTTYPES_H HAVE_PKCRYPT HAVE_STDINT_H HAVE_WZAES HAVE_ZLIB $(inherited)

Screenshot:

Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.3.5. RELEASE:repackage (repackage) on project tristone-boot-module-system: zip file is empty

install package error: Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.3.7.RELEASE:repackage (repackage) on project

install package error:
Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.3.7.RELEASE:repackage (repackage) on project zbbzfw-common: Execution repackage of goal org.springframework.boot:spring-boot-maven-plugin:2.3.7.RELEASE:repackage failed: Unable to find main class

Solution:

Comment out the following codes in pom.xml file:

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

BackupDiskFile::CreateMedia: Backup device ‘D:\\backup\\drm_server20220114.bak’ failed to create. Operating system error 5(Access denied.)

BackupDiskFile::CreateMedia: Backup device ‘D:\\backup\\drm_server20220114.bak’ failed to create when the database is automatically backed up. system error 5 (Access denied.) .” Error.

Solution: Right-click the folder à Properties à Security à Group or Username, see if there are Authenticated Users in it, if not, click Edit à Add à Enter Authenticated Users à Check Name à OK à Add Modify Permissions

Nginx Failed to Starup Error: [emerg] mkdir() “/var/tmp/nginx/client” failed (2: No such file or directory)

Nginx Failed to startup Error: [emerg] mkdir() “/var/tmp/nginx/client” failed (2: No such file or directory)
 

Commands:
mkdir -pv /var/tmp/nginx/client
Type nginx -t again to display: the configuration file /etc/nginx/nginx.conf syntax is ok
After starting Nginx, you can now. service nginx start

Execute the Jmeter Script Error: .org.apache.http.conn.httphostconnectexception: XXXX failed: unable to specify the solution of the requested address (Connect failed)

Problem Description: While executing a single transaction load script, I found that running the script locally, the exception rate was 0%, and when the same script was executed on the hair press, there were large error reports.

Reason: Linux allocate to the client connection port exhausted, can not establish a socket connection caused by, although the socket closed, but the port default wait for 60s to be released, so as long as we give more available ports will be fine.

Solution steps.

1. Check the range of client connection ports supported by Linux: cat /proc/sys/net/ipv4/ip_local_port_range

2. Tune down the waiting time after port release, the default is 60s, modify it to 15~30s: echo 30 > /proc/sys/net/ipv4/tcp_fin_timeout

3. Modify the tcp/ip protocol configuration by configuring /proc/sys/net/ipv4/tcp_tw_reuse, the default is 0, modify it to 1 to release the TIME_WAIT port for new connections: echo 1 > /proc/sys/net/ipv4/tcp_tw_resue

4. Modify the tcp/ip protocol configuration to quickly recycle socket resources, the default is 0, modify it to 1: echo 1 > /proc/sys/net/ipv4/tcp_tw_recycle

After the modification, execute the single transaction load script on the issuing press again, and the exception rate is normal.

Uncaught InvalidStateError: Failed to execute ‘stop’ on ‘MediaRecorder’: The MediaRecorder’s state is ‘inactive’

      
The state is already inactive, add a state determination
              console.log(mediaRecorder.state);
                        if(mediaRecorder.state!="inactive"){
                            mediaRecorder.stop();
                        }