Category Archives: How to Fix

How to Solve Visual Studio C4996 Error

Follow the path VisualStudio\Common7\IDE\VC to find the folder VCProjectItems:

Right click to grant access permission -> Specific user

Click “share”

Enter the folder VCProjectsItems and open the file newc++file.cpp with Notepad. Paste the following into the file and save:

#define _CRT_SECURE_NO_WARNINGS 1

Right-click the folder VCProjectItems and click Properties -> Share -> Advanced sharing, click “share this folder” to uncheck it, and click “apply” and “OK”.

This will solve the problem. Create a new C/C + + file in vs. you can see the following code on the first line:

#define _CRT_SECURE_NO_WARNINGS 1

​​​​​​​

In this way, no error will be reported when using functions such as scanf(), printf().

How to Solve Remote Desktop Protocol 0xd06 Error

My environment:

Target computer win11 virtual machine vm16.2.0 (win10 in the virtual machine is copied from the original computer)

The original computer is win10 virtual machine vm15.5.0

Error reporting process:

Connect the win10 system in the virtual machine with the remote desktop connection tool mstsc provided by win11. The error is as follows:

The session will be disconnected due to a protocol error. Please reconnect to the remote computer
error code: 0xd06
extended error code: 0x0

Solution:

After a series of searches, no solution was found on the Internet. After careful consideration, considering that the win10 system in the virtual machine is copied from another original computer and the original computer uses the vm15.5.0 version of the virtual machine, it may be that the driver has a problem.

Solution:

Uninstall the display driver of win10 system in the virtual machine.

[Solved] Mac Terminal error: command not found: telnet

When a new Mac computer is purchased, an error is reported when the telnet command is used at the terminal: command not found: telnet. This is because telnet is not installed at the terminal.

Solution:

brew install telnet

If homebrew is not installed on the terminal, install homebrew first

 /usr/bin/ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install )”

Then install telnet

 brew install telnet

[Solved] Memory analysis tool Start Error: An internal error occurred during: “Parsing heap dump from

1. Error when opening the file

II. Reason
if the size of dump file is larger than your configured 1024m, the above error will be reported

III. Solution
1. Open MemoryAnalyzer.ini file in the directory of MAT.

2. The default is 1024, which can be modified to open the file

3. After modification, restart the mat tool and reopen it.

[Solved] selenium.common.exceptions.WebDriverException: Message: unknown error: DevToolsActivePort file doesn

1. Phenomenon: Jenkins cannot call out the browser page when building selenium, and Jenkins reports an error when building selenium: selenium.common.exceptions WebDriverException: Message: unknown error: DevToolsActivePort file doesn’t exist

2. Troubleshooting: run the project code directly under the Jenkins working directory, call out the browser normally, and the use case execution is completed

3. Reason: after Jenkins is built, the default node for running automation cases is the master, and the processes running on the master are background processes, so you can’t see the browser running interface

4. Solution:

① build the project in a graph free way
② add a slave node to Jenkins and point the project construction node to slave

[Solved] adb shell error: error: device unauthorized

2022/7/29 oppo-r11s Android 8-test success

After connecting the Android device, the windows computer wants to enter the device through the terminal command line, and an error is reported

Error content

C:\Users> adb shell

error: device unauthorized.
This adb server's $ADB_VENDOR_KEYS is not set
Try 'adb kill-server' if that seems wrong.
Otherwise check for a confirmation dialog on your device.

Inspection items:

1. Whether the data cable is plugged firmly

2. Whether the developer option is turned on

3. Whether the USB debugging option is turned on

If the above inspections are normal, the following methods can be used to solve the problem:

On the command line, enter adb kill-server to close the ADB service, and then ADB devices. He will automatically start the service. After querying the device, enter ADB shell again to test successfully.

If you fail unfortunately, you can enter adb start-server to restart the service that has just been shut down.

adb kill-server

[Solved] ERROR Error: No module factory availabl at Object.PROJECT_CONFIG_JSON_NOT_VALID_OR_NOT_EXIST ‘Error

1. Use wechat one-click packaging tool report the following error:

ERROR Error: No module factory available for dependency type: CssDependency

‘error: please check project.config Whether JSON exists and is valid (code 19) error: please check

2. Solutions

Hbuilder x development tools cannot be placed on the same disk as project files. The above errors will occur. If the development tools are placed on disk D and the project files are placed on disk e or disk F, the above errors will not be reported

How to Solve K8S Error getting node

During the installation or operation of k8s cluster, you may encounter problems of "error getting node", such as:

"Error getting node" err="node \"master\" not found"
dial tcp 10.8.126.46:6443: connect: connection refused"
"Error getting node" err="node \"master\" not found"
"Error getting node" err="node \"master\" not found"

The way to troubleshoot such problems is to execute the following commands to check the specific error causes:

journalctl -xeu kubelet

Find the initial error and deal with it according to different errors
according to the problems I have encountered, there are mainly the following possibilities:

  1. No swap memory disabled
  2. There is a problem with hostname setting or hosts setting (other bloggers listed reasons)
  3. The container and k8s version is not compatible (other bloggers listed reasons)

[Solved] Mac git clone error:xcrun:error:invalid active developer path(/Library/Developer/CommandLineTools)

Background

After upgrading the MAC system, using git clone and other related commands on the terminal fails with an error

xcrun:error:invalid active developer path(/Library/Developer/CommandLineTools),missing xcrun at:/Library/Developer/CommandLineTools/usr/bin/xcrun

Troubleshooting

1. Check whether git has been installed

# command
which git

# outcome
/usr/local/bin/git

Description git has been installed

2. View git help information

git --help

Error reporting is the same as above:

xcrun:error:invalid active developer path(/Library/Developer/CommandLineTools),missing xcrun at:/Library/Developer/CommandLineTools/usr/bin/xcrun

to sum up, GIT has been installed, but the GIT command cannot be used normally. It may be that the GIT installation package is damaged, so reinstall git

3. Reinstall Git

brew install git

The following error messages appear during installation:

Error: The following formula:
  git
cannot be installed as a binary package and must be built from source.
Install the Command Line Tools:
  xcode-select --install

Error: Git must be installed and in your PATH!
Error: The following formula:
  git
cannot be installed as a binary package and must be built from source.
Install the Command Line Tools:
  xcode-select --install

according to the prompt, you need to reinstall xcode-select

Solution: install xcode-select

To sum up, we need to reinstall xcode-select and execute the following commands on the terminal

 xcode-select --install

After installation, perform the following:

git --help

The correct output of information indicates that git has returned to normal and can be used

 

Zookeeper Failed to Start Error: start failed [How to Solve]

=====There is no error prompt in ZK here. Look for the logs. There is a logs directory on the upper layer of the bin directory. Check the logs===

Main error log information:

2022-07-28 15:31:50,793 [myid:] - ERROR [main:QuorumPeerMain@98] - Invalid config, exiting abnormally

========Solution information========

cd apache-zookeeper-3.6.2-bin/conf/

View the VIM zoo configuration file, view the dataDir directory defined by yourself, and view the ID information of zkServer.

CD to the dataDir directory,

echo  “serverid”  > myid

Go to the bin directory and start again, sh zkServer.sh start
check ZK application status: sh zkServer.sh status, (if the startup is successful and the status is wrong, you can wait until the cluster machine starts completely).

========================End=====================

[Solved] onlyoffice Error: error self signed certificate and download failed

When Installing nextcloud+onlyoffice, onlyoffice failed to start and report an error:


enter the container to see the error information of out.log

[root@nextcloud ~]# docker ps -a
Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
CONTAINER ID  IMAGE                                       COMMAND     CREATED       STATUS           PORTS                                        NAMES
a7c97fb93556  docker.io/onlyoffice/documentserver:latest              30 hours ago  Up 30 hours ago  0.0.0.0:8080->80/tcp, 0.0.0.0:9000->443/tcp  onlyoffice
[root@nextcloud ~]# docker exec -it a7c97fb93556 /bin/bash
Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
root@a7c97fb93556:/# cd /var/log/onlyoffice/documentserver/converter/
root@a7c97fb93556:/var/log/onlyoffice/documentserver/converter# ls
err.log  out.log-20220729
root@a7c97fb93556:/var/log/onlyoffice/documentserver/converter#

Disabling Document Server Access Authentication
Next, disable access authentication for Document Server, which by default rejects unauthenticated requests (i.e., self-signed HTTPS requests).

I am now running Document Server with Docker, using the docker exec command to log into the container.

There seems to be only the nano editor in the container, but that’s enough.

Open /etc/onlyoffice/documentserver/default.json, go down and find the rejectUnauthorized field and change its value to false.

Restart the container.
Modify default.json

root@a7c97fb93556:/var/log/onlyoffice/documentserver/converter# cd /etc/onlyoffice/
root@a7c97fb93556:/etc/onlyoffice# ls
documentserver  documentserver-example
root@a7c97fb93556:/etc/onlyoffice# cd documentserver
root@a7c97fb93556:/etc/onlyoffice/documentserver# ls
default.json              local.json  production-linux.json
development-linux.json    log4js      production-windows.json
development-mac.json      logrotate   supervisor
development-windows.json  nginx
root@a7c97fb93556:/etc/onlyoffice/documentserver# pwd
/etc/onlyoffice/documentserver
root@a7c97fb93556:/etc/onlyoffice/documentserver#

Modify as follows: “rejectunauthorized”: false

                     "requestDefaults": {
                                "headers": {
                                        "User-Agent": "Node.js/6.13",
                                        "Connection": "Keep-Alive"
                                },
                                "gzip": true,
                                "rejectUnauthorized": false
                        },

Restart container

root@a7c97fb93556:/etc/onlyoffice/documentserver# exit
exit
[root@nextcloud ~]# docker stop a7c97fb93556
Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
Error: given PIDs did not die within timeout
[root@nextcloud ~]# docker start a7c97fb93556
Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
Error: unable to start container "a7c97fb93556650c83dd763f9578705a82f34b2673f9759e8d0ce62afc63e77c": container a7c97fb93556650c83dd763f9578705a82f34b2673f9759e8d0ce62afc63e77c must be in Created or Stopped state to be started: container state improper
[root@nextcloud ~]# reboot

Restart nextcloud

login as: root
[email protected]'s password:
Activate the web console with: systemctl enable --now cockpit.socket

Last login: Fri Jul 29 15:59:59 2022 from 192.168.182.1
[root@nextcloud ~]# setenforce 0
[root@nextcloud ~]# systemctl start https
Failed to start https.service: Unit https.service not found.
[root@nextcloud ~]# systemctl start httpd
Enter TLS private key passphrase for localhost:443 (RSA) : ******
[root@nextcloud ~]# docker ps -a
Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
CONTAINER ID  IMAGE                                       COMMAND     CREATED       STATUS      PORTS                                        NAMES
a7c97fb93556  docker.io/onlyoffice/documentserver:latest              31 hours ago  Created     0.0.0.0:8080->80/tcp, 0.0.0.0:9000->443/tcp  onlyoffice
[root@nextcloud ~]# docker start a7c97fb93556
Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
a7c97fb93556
[root@nextcloud ~]#

Start onlyoffice

run as prompted

[root@nextcloud ~]# sudo docker exec a7c97fb93556 sudo supervisorctl start ds:example
Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
sudo: unable to send audit message: Operation not permitted
ds:example: started

Successfully opened word document

Mac HarmonyOS Failure[INSTALL_PARSE_FAILED_USESDK_ERROR]

In the MAC environment, during the development of HarmonyOS, the project runs to the simulator and reports the following errors:

Failure[INSTALL_PARSE_FAILED_USESDK_ERROR]

compileSdkVersion and releaseType of the app do not match the apiVersion and releaseType on the device.

Operation steps.

I. If the HDC tool environment variables are not configured, configure them as follows, and skip this step if they have been configured.

1. Open Mac terminal and enter the following command to open the bash_profile file.

open .bash_profile

2. In the bash_profile file, configure the environment variables, here the PATH path, refer to your own sdk path, version 3.0.0.1 is the version corresponding to Toolschains under API Version7 in my own SDK, the value is 3.0.0.1.

export PATH=$PATH:/Users/tangkun/Library/HarmonyOS/Sdk/toolchains/{3.0.0.1}
export CLASSPATH
HDC_SERVER_PORT=7035
launchctl setenv HDC_SERVER_PORT $HDC_SERVER_PORT
export HDC_SERVER_PORT

3. Save the configured environment variables and enter the following command in the open terminal.

source .bash_profile

4. Restart the development tool DevEco-Studio.

Second, the following is the operation of configured HDC environment variables:
In the terminal terminal of DevEco-Studio, enter the following command:

. /hdc shell

(Windows environment does not need the previous . /hdc shell)

Next, enter the following command in the terminal, but this time you do not need to enter . /, in terminal my Huawei emulator output 6.

getprop hw_sc.build.os.apiversion

This apiversion version number 6 is smaller than the version number 7 in my project’s build.gradle and project’s build.gradle, so it causes my project to run on this apiversion version 6 emulator with the following direct error.

The version numbers of entry and application in the build.gradle:
compileSdkVersion 7 and compatibleSdkVersion 7

Solution:

1. lower the compileSdkVersion and compatibleSdkVersion version numbers in the build.gradle file of entry and application to 6.

2. Use an emulator with Api 7 for debugging.