Author Archives: Robins

Redis Error: (error) ERR Errors trying to SHUTDOWN. Check logs.

An error is reported when closing redis

(error) ERR Errors trying to SHUTDOWN. Check logs.

First, we need to understand that when we shutdown, redis will save the data, whether it is rdb or aof depends on your own settings. But when you save the file, you may encounter the save path does not exist, or the save path does not have permission, in the configuration file, the default save path for rdb is . /. So we have a problem because of path permissions.

Modify . / file permissions

[atguigu@hadoop100 bin]$ sudo chown atguigu:atguigu -R /usr/local/bin/redis-config/

Shut down again and stop successfully

[Solved] yum Command Error: Error: Failed to download metadata for repo ‘appstream‘

From the official explanation:
CentOS Linux 8 had reached the End Of Life (EOL) on December 31st, 2021. It means that CentOS 8 will no longer receive development resources from the official CentOS project. After Dec 31st, 2021, if you need to update your CentOS, you need to change the mirrors to vault.centos.org where they will be archived permanently.

Solution: Execute the following statements in sequence

cd /etc/yum.repos.d/
sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
yum update

[Solved] AttributeError: ‘NoneType‘ object has no attribute ‘astype‘

Problem description

When running the code, an error is reported attributeerror: 'nonetype' object has no attribute 'asttype', as shown in the following figure:

Traceback (most recent call last):
  File "work/person_search-master/tools/demo.py", line 82, in <module>
    query_feat = net.inference(query_img, query_roi).view(-1, 1)
  File "/home/featurize/work/person_search-master/tools/../lib/models/network.py", line 178, in inference
    processed_img, scale = img_preprocessing(img)
  File "/home/featurize/work/person_search-master/tools/../lib/datasets/data_processing.py", line 49, in img_preprocessing
    processed_img = img.astype(np.float32)
AttributeError: 'NoneType' object has no attribute 'astype'

Solution:

According to the error message, the error is reported because the img is a ‘NoneType’ object, so the ‘astype’ property cannot be used.

In general, the above error occurs when the img does not exist, so

  • You need to make sure that the image exists in the appropriate path in the code.
  • You need to run the command python XXX.py in the correct directory to ensure that XXX.py searches for the image in the correct directory.

Cesium.js:1 Error loading image for billboard: [object Event]

Label pictures are not displayed

Address error

When going to reference local images in the .js file, the path should be introduced in the form of require(), modified as follows

billboard: {
        image: require("../img/boshi.png"),
        pixelOffset: new Cesium.Cartesian2(-120, 0),
        // eyeOffset: new Cesium.Cartesian3(0.0, 0.0, 0.0),
        horizontalOrigin: Cesium.HorizontalOrigin.LEFT,
        verticalOrigin: Cesium.VerticalOrigin.CENTER,
        // scale: 0.25,
        distanceDisplayCondition: new Cesium.DistanceDisplayCondition(100, 20000)
 }

Error: Rule can only have one resource source (provided resource and test + include + exclude)

The Vue project reports an error after running NPM run dev/NPM run serve:

Error: Rule can only have one resource source (provided resource and test + include + exclude) in {
  "type": "javascript/auto",
  "include": [
    {}
  ],
  "use": []
}
    at checkResourceSource (D:\Program Files\vue_shop\node_modules\@vue\cli-service\node_modules\webpack\lib\RuleSet.js:167:11)
    at Function.normalizeRule (D:\Program Files\vue_shop\node_modules\@vue\cli-service\node_modules\webpack\lib\RuleSet.js:198:4)
    at D:\Program Files\vue_shop\node_modules\@vue\cli-service\node_modules\webpack\lib\RuleSet.js:110:20
    at Array.map (<anonymous>)
    at Function.normalizeRules (D:\Program Files\vue_shop\node_modules\@vue\cli-
    ```
    Process finished with exit code 1

Cause of problem:

Webpack version conflict.

Webpack version conflict issue.

Some new versions of libraries require webpack@5, and when updating dependencies, webpack@5 is installed as the primary dependency based on the rules of dependency selection. However, @vue/cli relies on webpack@4, and its own webpack configuration is not compatible with webpack@5, so it reports an error and cannot continue to compile. If you’re also using @vue/cli, then don’t upgrade webpack@5 rashly.

Following its solution, I found a conflict between webpack and the previously installed version of less,less-loader

The overall solution is as follows:

//uninstall webpack 
npm uninstall webpack
//Install the specified version of webpack
npm install [email protected] --save-dev

npm uninstall less-loader
npm uninstall less

//Install compliant versions of less and less-loader
npm install [email protected] [email protected] --save-dev

[Solved] write javaBean error, fastjson version 1.2.76, class org.apache.flink.table.data.binary

An exception is thrown when using the static variable Map as a return

com.alibaba.fastjson.JSONException: write javaBean error, fastjson version 1.2.76, class org.apache.flink.table.data.binary.BinaryStringData, fieldName : id, Memory segment does not represent off heap memory

The rest of the code remains unchanged, and only an empty new Map is returned. The result is normal, which proves that there is a problem with the encoding of the fields inside, so it can be re-encoded
for (Map<String, Object> map : FakerConstant.TABLE_ROW_DATA_RESULT) {
            Map<String, Object> m = new HashMap<>();
            map.forEach((key, value) -> {
                m.put(
                        // You need to re-encode it, otherwise it will report FastJson exception. write javaBean error, fastjson version 1.2.76
                        new String(key.getBytes(), StandardCharsets.UTF_8),
                        new String(String.valueOf(value).getBytes(), StandardCharsets.UTF_8)););
            });
            res.add(m);
        }

[Solved] filebeat Startup Error: Exiting: error unpacking config data: more than one namespace configured accessing

After extracting filebeat from the virtual machine, enter #: ./filebeat -c filebeat.yml

Encountered the following problems!!!!!!

Exiting: error unpacking config data: more than one namespace configured accessing ‘output’ (source:’filebeat.yml’)

resolvent:

#Note that you must install filebeat in your own directory to modify filebeat.yml

[filebeat directory] #: VIM filebeat.yml

After entering, find the following configuration location

#—————————-Elasticsearch output ———————————-

output. elasticsearch:

#Array of hosts to connecr to.

hosts: [“localhost:9200”]

=====================Modification====================

Just comment out the contents under Elasticsearch output

#—————————-Elasticsearch output ———————————-

#output. elasticsearch:

#Array of hosts to connecr to.

hosts: [“localhost:9200”]

Save exit after modification

Restart filebeat

Enter #:/ filebeat -c filebeat.yml

View process

Enter #:/ filebeat -e -c filebeat.yml

Successfully started filebeat!!!!!

[Solved] GLSL Lint: Failed to spawn ‘glslangValidator‘ binary. Error: spawn glslangValidator.exe ENOENT

1. preface

After using vscode to install the plug-in: glsl lint, there is an error every time you start vscode:
glsl lint: failed to spawn ‘glslangvalidator’ binary Error: spawn glslangValidator. Exe enoent
and vscode will not be automatically colored and highlighted every time the shader program is opened. At this time, I reinstall the glsl lint plug-in. It’s troublesome

glslangValidator is a custom GLSL reference compiler from the Khronos Group, the official OpenGL standard customizer. The command line compilation mode facilitates users to test glsl syntax directly and bypass the C/C++ related dependency libraries compilation, and there is no need to write a lot of initialization code in the main file. This can save a lot of time in practical testing. In many websites such as shadertoy, the glsl code written by users can be compiled and run directly in the main function, which requires a convenient syntax check, and the shadertoy website also provides a simple syntax check. However, glslang is a standard custom official compiler, so the compiled glsl code can be compiled correctly on all kinds of drivers that support GLSL syntax.

2. Solution steps

1. Open vscode settings

2. Search “security.workspace.trust”

Enter “security.workspace.trust” in “search settings” (just enter “security”)

3. Cancel ssecurity.workspace.trust:Enabled

Remove the hook in front of “security.workspace.trust:Enabled”

Just restart vscode

[Solved] ERROR: child process failed, exited with error number 14 (error number 1, error number 100)

Problem Description:

Error: 14 when starting mongodb, check mongodb.log for MongoDB – Unable to unlink socket file / tmp / mongodb-27017

Cause analysis:

Check /tmp/mongodb-27017.sock, found that the owner is root

Solution:

Delete the /tmp/mongodb-27017.sock file and restart the mongod process. Check the /tmp/mongodb-27017.sock permissions again and change the ownership to the “mongodb” user.

also started successfully

Summary:

1. Check more logs, mongodb.log
2. The mongodb error column, such as 1100, is mostly due to the wrong specification of the data path and log path in the configuration file. The data path needs to be created in advance, which is a directory, and the log path also needs to be created in advance, which is a file