Author Archives: Robins

[Solved] Vue Project Error: error ‘v-model‘ directives require no argument vue/valid-v-model

In Vue projects, you need to reference third-party libraries, such as vant@^2.12.47. When using the dialog popup component, you need to use v-model:show to determine whether to display the popup.

When the project is running, an error will be reported: error ‘v-model’ directives require no argument vue/valid-v-model

Solution: Add:'vue/valid-v-model':'off' in the root directory, .eslintrc.js file.

As shown in the figure:

[Solved] org.apache.maven.archiver.MavenArchiver.getManifest(org.apache.maven.project.MavenProject…

Error message:

org.apache.maven.archiver.MavenArchiver.getManifest(org.apache.maven.project.MavenProject, org.apache.maven.archiver.MavenArchiveConfiguration)

 

Solution:

Add and change the following plugin configuration in pom:

            </plugin>
                <plugin>
                    <artifactId>maven-war-plugin</artifactId>
                    <version>2.6</version>
                </plugin>  

How to Solve phpExcel Error: ERR_INVALID_RESPONSE

1. Occurrence scenario

  1. In thinkphp framework using phpoffice/phpexcel, exporting Excel tables directly to the browser for download, the error is reported: ERR_INVALID_RESPONSE
  2. Note: The export is fine in the local windows environment, but the problem only occurs in the online Linux environment.
  3. Screenshot of the problem.

2. Find a solution

1. Online solutions

1) Buffer problem

calling ob_clean() before calling save(“ php://output "), part of the code is as follows:

        ob_clean(); //Emptying the cache

        // final output via browser
        $fn = "The name of the file (" . date("Y.m.d") . ").xls"; // the name of the file to be saved
        header('Content-Type: application/vnd.ms-excel; charset=utf-8');
        header("Content-Disposition: attachment;filename={$fn}");
        header('Cache-Control: max-age=0');
        $objWriter = \PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
        $objWriter->save('php://output');
        exit;

2) Error is reported in line 581 of factory581, and break is deleted

Error in factory581 line, delete break;

PHPExcel\Calculation\Functions.php file, remove break at line 581

our phoffice/phpexcel is installed by composer. We have to change the source code every time we update it. It is not recommended to modify the source code. Even if it can solve the problem, it will not be adopted

2. My solution to this problem is to install the zip extension under Linux

[solution] my problem is that Linux lacks the zip extension. You can install it~

3. Zip extension

PHP under windows (my version is 7.3.3) has its own zip extension, and there is no directory_zip.dll file under the php/ext path, as shown in the figure

PHP under Linux does not have zip extension installed

[Solved] Canal Error: Could not find first log file name in binary log index file

Check /home/admin/canal-server/logs/example/example.log and find the following error:

2022-07-20 00:00:08.473 [destination = example , address = mall-mysql/192.168.38.131:3306 , EventParser] ERROR com.alibaba.otter.canal.common.alarm.LogAlarmHandler - destination:e
xample[java.io.IOException: Received error packet: errno = 1236, sqlstate = HY000 errmsg = Could not find first log file name in binary log index file                             
        at com.alibaba.otter.canal.parse.inbound.mysql.dbsync.DirectLogFetcher.fetch(DirectLogFetcher.java:102)                                                                    
        at com.alibaba.otter.canal.parse.inbound.mysql.MysqlConnection.dump(MysqlConnection.java:238)                                                                              
        at com.alibaba.otter.canal.parse.inbound.AbstractEventParser$1.run(AbstractEventParser.java:262)                                                                           
        at java.lang.Thread.run(Thread.java:748) 

reason:

The binlog file set in the configuration file was not found

Solution:

Because the configuration file of instance.properties is packaged into the docker image, so it can only be modified in the instance

First check the binlog log file name and position in the database

Query in the mall-mysql database of this example:

mysql> show master status;

Output file: File: mysql-binlog.000233, Position: 652645

Enter the instance:

kubectl exec -ti mall-canal-84f6f7d7cc-xbghn bash -n nsName
xxx> vi /home/admin/canal-server/conf/example/instance.properties

Modify the position Info section:

canal.instance.master.address=mall-mysql:3306                                                                                                                                      
canal.instance.master.journal.name=mysql-binlog.000233                                                                                                                             
canal.instance.master.position=652645                                                                                                                                              
canal.instance.master.timestamp=                                                                                                                                                   
canal.instance.master.gtid=

Restart service:

xxx> cd /home/admin/canal-server
xxx> ./restart.sh

Check the log after restart and solve this error.

[Solved] electron Package and Startup Error: Error: ENOENT: no such file or directory, open ‘xxx/manifest.json‘‘

Start the error report after packaging with electron-builder:

Reading /xxx/manifest.json failed.
Error: ENOENT: no such file or directory, open '/xxx/manifest.json'
    at Object.fs.openSync (fs.js:558:18)
    at Object.module.(anonymous function) [as openSync] (ELECTRON_ASAR.js:173:20)
    at Object.fs.readFileSync (fs.js:468:33)
    at Object.fs.readFileSync (ELECTRON_ASAR.js:506:29)
    at getManifestFromPath (/xxx/node_modules/electron/dist/Electron.app/Contents/Resources/electron.asar/browser/chrome-extension.js:34:26)
    at Function.BrowserWindow.addDevToolsExtension (/xxx/node_modules/electron/dist/Electron.app/Contents/Resources/electron.asar/browser/chrome-extension.js:373:22)
    at App.Z.enabled.X.on (/xxx/webpack:/~/electron-debug/index.js:78:1)
    at emitTwo (events.js:111:20)
    at App.emit (events.js:191:7)

Solution:

1. Execute the following command:

npm install vue-devtools --global

2. Modify src/main/index.dev.js as follows:

import {  BrowserWindow } from 'electron'; //Add
/* eslint-disable */

// Install `electron-debug` with `devtron`
// require('electron-debug')({ showDevTools: true })
require('electron-debug')() //Modify

// Install `vue-devtools`
require('electron').app.on('ready', () => {
  let installExtension = require('electron-devtools-installer')
  //Comment out
  // installExtension.default(installExtension.VUEJS_DEVTOOLS)
  //   .then(() => {})
  //   .catch(err => {
  //     console.log('Unable to install `vue-devtools`: \n', err)
  //   })
  //Add
  BrowserWindow.addDevToolsExtension('node_modules/vue-devtools/vender')
})
// Require `main` process to boot app
require('./index')

3. Recompile:

npm run build:win32

4. Repackage:

electron-builder

It can start normally:

[Solved] weditor Plug-in Dump Hierarchy Error: Local server not started, start with $ python -m weditor

I had tried many solutions online. but they do not work. here is my working solution I found finally.

 

Solution:

1. First, make sure that ADB devices can query your device

2. Key solution: delete ATX on the mobile phone and re-execute python -m uiautomator2 init

3. Just in case, don’t directly execute the WebEditor. Be sure to execute python -m weditor

Then click Dump Hierarchy to synchronize the screen. Don’t use real-time, just use static.

[Solved] ant design pro vue Startup Error: ERROR Failed to compile with 1 error 20:34:09 error in ./src/components/Num

Error reporting information

ERROR Failed to compile with 1 error 20:34:09

error in ./src/components/NumberInfo/NumberInfo.vue?vue&type=style&index=0&id=4370c5af&lang=less&scoped=true&

Syntax Error: TypeError: Cannot set properties of undefined (setting ‘parent’)

Delete the NumberInfo folder under the components folder, start the project again, and after starting, Ctrl + z to withdraw the deleted NumberInfo component folder, after which the project will start normally

Solution:

1. Delete, yarn run serve to start project

2. Withdrawal

3. Project started successfully

Android WebView loading HTTP error [How to Solve]

After android9.0, WebView can’t load the link starting with HTTP, or an error is reported.

Solution:

1. Add android:usesCleartextTraffic = true in the Application tag of AndroidManifest;

2. Set in webclient

webView.webViewClient = object : WebViewClient() {
            override fun shouldOverrideUrlLoading(view: WebView, url: String): Boolean {
                if (url.startsWith("http://") || url.startsWith("https://")) {
                    webView.loadUrl(url)
                    return true
                }
                return true
            }
}

[Solved] pymysql.err.OperationalError: (1045, “Access denied for user ‘root‘@‘192.168.118.44‘

Error: pymysql.err OperationalError: (1045, “Access denied for user ‘root’@‘192.168.118.44’ (using password: YES)”)

Possible problems:
1. Firewall blocking,
Solution: log in to the server and turn off the firewall

systemctl stop firewalld.service

2. User empowerment (the root user I use here)
Solution: log in to the MySQL database for empowerment

grant all privileges on *.* to 'root'@'%' identified by 'password';
flush privileges;

3. Check whether the password is entered incorrectly

jpeg4py.JPEG(path).decode() Open Image Error [How to Solve]

Recorded:

import jpeg4py
path = template_image[0]
im = jpeg4py.JPEG(path).decode()
"""
Note: template_image is ndarray type
"""

1. Error Message:
\jpeg4py._py.JPEGRuntimeError: tjDecompressHeader2() failed with error -1 and error string Not a JPEG

2. Reason: Problem with data type

>>> type(path)
<class 'numpy.str_'>
>>> # Although equal
>>> str(path) == path
True
>>> # But they are different types
>>> type(str(path))
<class 'str'>

3. Solution:

import jpeg4py
path = template_image[0]
im = jpeg4py.JPEG(str(path)).decode()
"""
Note: path-->str(path) 
Type from <class 'numpy.str_'> modify to <class 'str'>
"""

 

How to Solve Unity Package Android Project Error

1. Background

Unity project has the following capabilities

1. It can run directly on Android phones

2. You can build an APK file and then install it on the mobile phone to run

3. It can be packaged into an Android project and run the project using Android studio

There may be no problem that 1 and 2 can be implemented normally, but an error will be reported when implementing the third method
the first error:

unity UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&) (at /Users/bokken/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:189)

 

the second error:

UnityEditor.BuildPlayerWindow Error

 

2. Precautions

1. There is no problem with the configuration of gradle environment, because it can be compiled normally

2. The package directory also has no Chinese name

3. There is no problem with the packaging configuration

 

3. Solutions

Exporting Android Studio project needs to be consistent with our project name of unity

For example: File-BuildSettins-PlayerSetting-Player-ProductName name and File-BuildSettins-Build file directory name consistent can be solved

[Solved] Redis error: NOAUTH Authentication required.

1. Development environment

redis

2. Redis reports an error: NOAUTH Authentication required.

1. Set your password and open redis.window.conf file, search requirepass to view your password

2. For those without a password, there is a situation that can cause this error. Redis is running in the background. End redis in the background of the task manager and restart it