Category Archives: Error

Sentinel could not find the urlblockhandler interface solution

Recently, when I was learning spring cloud Alibaba, I needed sentinel for traffic management and control. When I configured the unified handling of returned exceptions, the implementation of urlblockhandler became popular. The reason is that I used sentinel 2.2.1.release, which was officially changed to blockexceptionhandler.

 

Solution: Inheritance   BlockExceptionHandler   The specific code is as follows:

package com.sentinel;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Component;

import com.Enum.RequestMsgEnum;
import com.alibaba.csp.sentinel.adapter.spring.webmvc.callback.BlockExceptionHandler;
import com.alibaba.csp.sentinel.slots.block.BlockException;
import com.alibaba.csp.sentinel.slots.block.authority.AuthorityException;
import com.alibaba.csp.sentinel.slots.block.degrade.DegradeException;
import com.alibaba.csp.sentinel.slots.block.flow.FlowException;
import com.alibaba.csp.sentinel.slots.block.flow.param.ParamFlowException;
import com.alibaba.csp.sentinel.slots.system.SystemBlockException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.global.BaseController;
 
/**
 * Custom sentinel exception return message
 */
@Component
public class MyUrlBlockHandler extends BaseController implements BlockExceptionHandler{

    @Override
    public void handle(HttpServletRequest request, HttpServletResponse response, BlockException ex) throws Exception {
        String msg = null;
        if (ex instanceof FlowException) {
            msg = "Flow is restricted";
        } else if (ex instanceof DegradeException) {
            msg = "Degraded";
        } else if (ex instanceof ParamFlowException) {
            msg = "Hotspot parameter flow restriction";
        } else if (ex instanceof SystemBlockException) {
            msg = "System rule (load/... Not satisfied)";
        } else if (ex instanceof AuthorityException) {
            msg = "Authorization rule not passed";
        }
        // http status code
        response.setStatus(500);
        response.setCharacterEncoding("utf-8");
        response.setHeader("Content-Type", "application/json;charset=utf-8");
        response.setContentType("application/json;charset=utf-8");
        // spring mvc comes with a json manipulation tool called jackson
        new ObjectMapper()
            .writeValue(
                response.getWriter(),
                this.responseResult(RequestMsgEnum.Failtrue, msg)
            );
    }
}

Note: the basecontroller class is my own definition class. The custom format is returned to the front end and needs to be modified according to my own needs.

[Solved] The invalidation of windows.location.txt on Android mobile phone

Problem: in the lower version of Android phones, the use of window.location.txt jump is invalid

solution 1:

Analysis: add a time stamp after the jump link. Considering that the cache problem may exist in the low version, we add a dynamic parameter time stamp after the jump link to refresh the cache data

// Add a timestamp after the jump link, because considering that it is a low version there may be caching problems so use the dynamic parameter timestamp after the jump link to refresh the cached data
window.location.href = url+'?time='+((new Date()).getTime());
solution 2:

Analysis: after using the above method, there will still be some problems with the jump of some models. Another method is tried to change the jump mode into asynchronous mode, and use a delayer to simulate (it is recommended that the time should be less than 300ms, otherwise users will be able to perceive some of the phenomenon of stuck)

// After using the above approach, there will still be some models have problems jumping, and tried another way to jump into an asynchronous way, using a time delay to simulate (recommended time less than 300ms, or the user will be able to perceive a slight lag phenomenon)
setTimeout(() => {
   window.location.href = url+'?time='+((new Date()).getTime());
}, 300);

How to Solve Cordova integrates Gaode Map key error

Plug in: com.kit.cordova.amaplocation

https://www.jianshu.com/p/85aceaee3b35

When referring to the above link articles or other articles, we still can’t solve the key error of Gaode
running the following two commands may solve the long-standing problem

cordova platform remove "platformName" // Remove the project platform
cordova platform add "platformName" // add device platform

Example:

cordova platform remove android // Remove Android project platform
cordova platform add android // add android device platform

Error response from daemon: driver failed programming external connectivity on endpoint quirky_allen is reported when docker port mapping or starting the container

phenomenon:

[root@localhost ~]# docker run -d -p 9000:80 centos:httpd /bin/sh -c /usr/local/bin/start.sh
d5b2bd5a7bc4895a973fe61efd051847047d26385f65c278aaa09e4fa31c4d76
docker: Error response from daemon: driver failed programming external connectivity on endpoint quirky_allen (6bda693d1143657e46bee0300276aa05820da2b21a3d89441e820d1a274c48b6): (iptables failed: iptables –wait -t nat -A DOCKER -p tcp -d 0/0 –dport 9000 -j DNAT –to-destination 172.17.0.2:80 ! -i docker0: iptables: No chain/target/match by that name.
(exit status 1)).

[root@localhost ~]# docker start d5b2bd5a7bc4
Error response from daemon: driver failed programming external connectivity on endpoint quirky_allen (4127da7466709fd45695a1fbe98e13c2ac30c2a554e18fb902ef5a03ba308438): (iptables failed: iptables –wait -t nat -A DOCKER -p tcp -d 0/0 –dport 9000 -j DNAT –to-destination 172.17.0.2:80 ! -i docker0: iptables: No chain/target/match by that name.
(exit status 1))
Error: failed to start containers: d5b2bd5a7bc4

 

Reason:

The custom chain DOCKER defined when the docker service is started is cleared for some reason.
Restart the docker service and regenerate the custom chain. DOCKER
Chain PREROUTING (policy ACCEPT)
target prot opt ​​source destination        
DOCKER all – 0.0.0.0/0 0.0.0.0/0 ADDRTYPE match dst-type LOCAL

Chain INPUT (policy ACCEPT)
target prot opt ​​source destination        

Chain OUTPUT (policy ACCEPT)
target prot opt ​​source destination        
DOCKER all – 0.0.0.0/0 !127.0.0.0/8 ADDRTYPE match dst-type LOCAL

Chain POSTROUTING (policy ACCEPT)
target prot opt ​​source destination        
MASQUERADE all – 172.17.0.0/16 0.0.0.0/0          
MASQUERADE  tcp  —  172.17.0.2           172.17.0.2           tcp dpt:8080

Chain DOCKER (2 references)
target     prot opt source               destination
RETURN     all  —  0.0.0.0/0            0.0.0.0/0
DNAT       tcp  —  0.0.0.0/0            0.0.0.0/0            tcp dpt:8888 to:172.17.0.2:8080
root@router:playbook#iptables -t nat -nL
Chain PREROUTING (policy ACCEPT)
target     prot opt source               destination
DOCKER     all  —  0.0.0.0/0            0.0.0.0/0            ADDRTYPE match dst-type LOCAL

Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
DOCKER     all  —  0.0.0.0/0           !127.0.0.0/8          ADDRTYPE match dst-type LOCAL

Chain POSTROUTING (policy ACCEPT)
target     prot opt source               destination
MASQUERADE  all  —  172.17.0.0/16        0.0.0.0/0
MASQUERADE  tcp  —  172.17.0.2           172.17.0.2           tcp dpt:8080

Chain DOCKER (2 references)
target     prot opt source               destination
RETURN     all  —  0.0.0.0/0            0.0.0.0/0
DNAT       tcp  —  0.0.0.0/0            0.0.0.0/0            tcp dpt:8888 to:172.17.0.2:8080

Solution:

Restart the docker service and then start the container
systemctl restart docker
docker start foo

Error: (1, 1) java: Illegal character:’\ufeff’ [How to Solve]

the problem

When opening the eclipse java project compiling with IDEA, the following error occurred:

Error:(1, 1) java: Illegal character: ‘\ufeff’ 
Error:(1, 10) java: need class, interface or enum 

2. Reason analysis

Eclipse can intelligently convert UTF-8+BOM files into ordinary UTF-8 files. IDEA does not have this intelligent conversion.

Three, the solution

1 Convert with IDEA, first convert to GBK, and then back to UTF-8



2 Convert with other editors, such as notpade++, sublime, etc.

The principle is the same, the operation is omitted.

[Solved] Flutter – AAPT: error: resource android:attr/dialogCornerRadius not found.

Launching lib\main.dart on Nokia X6 in debug mode...

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugResources'.
> Android resource linking failed
  Output:  E:\Flutter Projects\intro_to_flutter\build\app\intermediates\incremental\mergeDebugResources\merged.dir\values-v28\values-v28.xml:7: error: resource android:attr/dialogCornerRadius not found.
  E:\Flutter Projects\intro_to_flutter\build\app\intermediates\incremental\mergeDebugResources\merged.dir\values-v28\values-v28.xml:11: error: resource android:attr/dialogCornerRadius not found.
  E:\Flutter Projects\intro_to_flutter\build\app\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:959: error: resource android:attr/fontVariationSettings not found.
  E:\Flutter Projects\intro_to_flutter\build\app\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:960: error: resource android:attr/ttcIndex not found.
  error: failed linking references.

  Command: C:\Users\hupo3\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.1-4818971-windows.jar\c1441429ce2aae0e0bed3ad48db2b49e\aapt2-3.2.1-4818971-windows\aapt2.exe link -I\
          C:\Users\hupo3\AppData\Local\Android\sdk\platforms\android-27\android.jar\
          --manifest\
          E:\Flutter Projects\intro_to_flutter\build\app\intermediates\merged_manifests\debug\processDebugManifest\merged\AndroidManifest.xml\
          - the\
          E:\Flutter Projects\intro_to_flutter\build\app\intermediates\processed_res\debug\processDebugResources\out\resources-debug.ap_\
          -R\
          @E:\Flutter Projects\intro_to_flutter\build\app\intermediates\incremental\processDebugResources\resources-list-for-resources-debug.ap_.txt\
          --auto-add-overlay\
          --java\
          E:\Flutter Projects\intro_to_flutter\build\app\generated\not_namespaced_r_class_sources\debug\processDebugResources\r\
          --custom-package\
          com.xiaobing.introtoflutter \
          -0 \
          apk\
          --output-text-symbols\
          E:\Flutter Projects\intro_to_flutter\build\app\intermediates\symbols\debug\R.txt\
          --no-version-vectors
  Daemon:  AAPT2 aapt2-3.2.1-4818971-windows Daemon #0
  Output:  C:\Users\hupo3\.gradle\caches\transforms-1\files-1.1\appcompat-v7-28.0.0.aar\12aaee80bab0fcaef8511d3958ba785b\res\values-v28\values-v28.xml:9:5-12:13: AAPT: error: resource android:attr/dialogCornerRadius not found.

  E:\Flutter Projects\intro_to_flutter\build\app\intermediates\incremental\mergeDebugResources\merged.dir\values-v28\values-v28.xml:11: AAPT: error: resource android:attr/dialogCornerRadius not found.

  C:\Users\hupo3\.gradle\caches\transforms-1\files-1.1\support-compat-28.0.0.aar\b1fc0e0ff1348f4d278539eb80ede9d3\res\values\values.xml:89:5-125:25: AAPT: error: resource android:attr/fontVariationSettings not found.

  C:\Users\hupo3\.gradle\caches\transforms-1\files-1.1\support-compat-28.0.0.aar\b1fc0e0ff1348f4d278539eb80ede9d3\res\values\values.xml:89:5-125:25: AAPT: error: resource android:attr/ttcIndex not found.

  error: failed linking references.
  Command: C:\Users\hupo3\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.1-4818971-windows.jar\c1441429ce2aae0e0bed3ad48db2b49e\aapt2-3.2.1-4818971-windows\aapt2.exe link -I\
          C:\Users\hupo3\AppData\Local\Android\sdk\platforms\android-27\android.jar\
          --manifest\
          E:\Flutter Projects\intro_to_flutter\build\app\intermediates\merged_manifests\debug\processDebugManifest\merged\AndroidManifest.xml\
          - the\
          E:\Flutter Projects\intro_to_flutter\build\app\intermediates\processed_res\debug\processDebugResources\out\resources-debug.ap_\
          -R\
          @E:\Flutter Projects\intro_to_flutter\build\app\intermediates\incremental\processDebugResources\resources-list-for-resources-debug.ap_.txt\
          --auto-add-overlay\
          --java\
          E:\Flutter Projects\intro_to_flutter\build\app\generated\not_namespaced_r_class_sources\debug\processDebugResources\r\
          --custom-package\
          com.xiaobing.introtoflutter \
          -0 \
          apk\
          --output-text-symbols\
          E:\Flutter Projects\intro_to_flutter\build\app\intermediates\symbols\debug\R.txt\
          --no-version-vectors
  Daemon:  AAPT2 aapt2-3.2.1-4818971-windows Daemon #0

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 18s
Gradle task assembleDebug failed with exit code 1
Exited (sigterm)

 

Open android\app\build.gradle

Modify compileSdkVersion and  targetSdkVersion

Windows 7 IIS (HTTP Error 500.21-Internal Server Error) solution

When I was testing the website today, when I entered http://localhost/ in the browser, the following error occurred:

HTTP Error 500.21-Internal Server Error

Handler “WebServiceHandlerFactory-Integrated” has a bad module “ManagedPipelineHandler” in its module list.

I looked for the reason on the Internet, and the result was

Reason: After installing Framework v4.0, enable IIS, resulting in the Framework not being fully installed

Solution: Start -> All Programs -> Accessories -> Right-click on “Command Prompt” -> Run as Administrator ->%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -i

[Solved] error LNK2038: Detected mismatch of “RuntimeLibrary”: The value “MDd_DynamicDebug” does not match the value “MTd_StaticDebug”

A bunch of errors appeared in VS2012 C++ compilation today:

1  1 >   Code generation...
 2  1 >Code.obj: error LNK2005: " public: __thiscall std::_Container_base12::_Container_base12(void) " (?? 0_Container_base12@std@@QAE@XZ) is already in msvcprtd. Defined in lib(MSVCP110D.dll)
 3  1 >Code.obj: error LNK2005: " public: __thiscall std::_Container_base12::~_Container_base12(void) " (?? 1_Container_base12@std@@QAE@XZ) is already in msvcprtd. Defined in lib(MSVCP110D.dll)
 4  1 >Code.obj: error LNK2005: " public: void __thiscall std::_Container_base12::_Orphan_all(void) " (?_Orphan_all@_Container_base12@std@@QAEXXZ) has been defined in msvcprtd.lib(MSVCP110D.dll)
 5  1 > IOCP_Socket.lib(CLog.obj): error LNK2038: mismatch detected for "RuntimeLibrary": value "MDd_DynamicDebug" Mismatched value "MTd_StaticDebug" (in Code.obj)
 6  1 > IOCP_Socket.lib(TcpServer.obj): error LNK2038: mismatch detected for "RuntimeLibrary": The value "MDd_DynamicDebug" does not match the value "MTd_StaticDebug" (Code. obj)
 7  1 > IOCP_Socket.lib(stdafx.obj): error LNK2038: mismatch detected for "RuntimeLibrary": The value "MDd_DynamicDebug" does not match the value "MTd_StaticDebug" (Code.obj)
 8  1 > IOCP_Socket.lib (TcpSrvException.obj): error LNK2038: mismatch detected for "RuntimeLibrary": The value "MDd_DynamicDebug" does not match the value "MTd_StaticDebug" (in Code.obj)
 9  1> IOCP_Socket.lib(TcpReceiveContext.obj): error LNK2038: mismatch detected for "RuntimeLibrary": The value "MDd_DynamicDebug" does not match the value "MTd_StaticDebug" (in Code.obj)
 10  1 > IOCP_Socket.lib(TcpSendContext.obj) : error LNK2038: mismatch detected for "RuntimeLibrary": The value "MDd_DynamicDebug" does not match the value "MTd_StaticDebug" (Code.obj)
 11  1 > IOCP_Socket.lib(AcceptContext.obj): error LNK2038: "RuntimeLibrary" detected Mismatch for: value "MDd_DynamicDebug" does not match value "MTd_StaticDebug" (in Code.obj)
 12  1 > IOCP_Socket.lib(OperateContext.obj): error LNK2038: mismatch detected for "RuntimeLibrary": value "MDd_DynamicDebug" Does not match the value "MTd_StaticDebug" (in Code.obj)
 13  1 >IOCP_Socket.lib(MemoryBlock.obj): error LNK2038: mismatch detected for "RuntimeLibrary": The value "MDd_DynamicDebug" does not match the value "MTd_StaticDebug" (in Code.obj)
 14  1 > IOCP_Socket.lib(ContextStack.obj): error LNK2038: mismatch detected for "RuntimeLibrary": The value "MDd_DynamicDebug" does not match the value "MTd_StaticDebug" (in Code.obj)
 15  1 >msvcprtd.lib(MSVCP110D.dll): error LNK2005: " void __cdecl std:: _Debug_message(wchar_t const *,wchar_t const *,unsigned int) " (? _Debug_message@std@@YAXPB_W0I@Z) has been defined in libcpmtd.lib(stdthrow.obj)
 16  1 >msvcprtd.lib(MSVCP110D.dll): error LNK2005: " public: __thiscall std::_Container_base12::_Container_base12(void) " (??0_Container_base12@std@@QAE@XZ) has been defined in Code.obj
 17  1 >msvcprtd.lib(MSVCP110D.dll): error LNK2005: " public: __thiscall std::_Container_base12::~_Container_base12(void) " (?? 1_Container_base12@std@@QAE@XZ) has been defined in Code.obj
 18  1 >msvcprtd.lib(MSVCP110D.dll): error LNK2005: " public: void __thiscall std::_Container_base12::_Orphan_all(void) " (? _Orphan_all @_Container_base12@std@@QAEXXZ) has been defined in Code.obj
 19  1 >msvcprtd.lib(MSVCP110D.dll): error LNK2005: " void __cdecl std::_Xbad_alloc(void) " (?_Xbad_alloc@std@@YAXXZ) has been defined in libcpmtd.lib(xthrow.obj)
 20  1 >msvcprtd.lib(MSVCP110D.dll): error LNK2005: " void __cdecl std::_Xlength_error(char const *) " (? _Xlength_error @std@@YAXPBD@Z) has been defined in libcpmtd.lib(xthrow.obj)
 21  1 >msvcprtd.lib(MSVCP110D.dll): error LNK2005: " void __cdecl std::_Xout_of_range(char const *) " (? _Xout_of_range@std@@YAXPBD@Z) has been defined in libcpmtd.lib(xthrow.obj)
 22  1 >msvcprtd.lib(MSVCP110D.dll): error LNK2005: " char const * __cdecl std::_Syserror_map(int) " ( ?_Syserror_map@std@@YAPBDH@Z) has been defined in
 libcpmtd.lib(syserror.obj) 23  1 >msvcprtd.lib(MSVCP110D.dll): error LNK2005: " char const * __cdecl std::_Winerror_map(int) " ( ? _Winerror_map@std@@YAPBDH@Z) has been defined in
 libcpmtd.lib(syserror.obj) 24  1 >msvcprtd.lib(MSVCP110D.dll): error LNK2005: " public: __thiscall std::_Lockit::_Lockit(int ) " (?? 0_Lockit@std@@QAE@H@Z) has been defined in libcpmtd.lib(xlock.obj)
 25  1 >msvcprtd.lib(MSVCP110D.dll): error LNK2005: " public: __thiscall std:: _Lockit::~_Lockit(void) " (??1_Lockit@std@@QAE@XZ) is already defined in libcpmtd.lib(xlock.obj)
 26  1 > MSVCRTD.lib(MSVCR110D.dll): error LNK2005: _memmove is already defined in LIBCMTD.lib(memmove.obj)
 27  1 > MSVCRTD.lib(MSVCR110D.dll): error LNK2005: _fclose already defined in LIBCMTD.lib(fclose.obj)
 28  1 > MSVCRTD.lib(MSVCR110D.dll): error LNK2005: _fflush already defined in LIBCMTD.lib(fflush .obj)
 29  1 > MSVCRTD.lib(MSVCR110D.dll): error LNK2005: _printf already defined in LIBCMTD.lib(printf.obj)
 30  1 > MSVCRTD.lib(MSVCR110D.dll): error LNK2005: _vprintf already defined Defined in LIBCMTD.lib(vprintf.obj)
 31  1 >MSVCRTD.lib(MSVCR110D.dll): error LNK2005: __vsnprintf_s already defined in LIBCMTD.lib(vsnprnc.obj)
 32  1 > MSVCRTD.lib(MSVCR110D.dll): error LNK2005: _vsprintf_s already defined in LIBCMTD.lib(vsnprnc.lib(vsnprnc) ) Defined in
 33  1 > MSVCRTD.lib(MSVCR110D.dll): error LNK2005: __invalid_parameter is already defined in LIBCMTD.lib(invarg.obj)
 34  1 > MSVCRTD.lib(MSVCR110D.dll): error LNK2005: _memcpy_s is already defined in LIBCMTD .lib(memcpy_s.obj) is defined in
 35  1 > MSVCRTD.lib(MSVCR110D.dll): error LNK2005: _strncpy_s is already defined in LIBCMTD.lib(strncpy_s.obj)
 36  1 >MSVCRTD.lib(MSVCR110D.dll): error LNK2005: "public: virtual __thiscall std::exception::~exception(void) " (?? 1exception@std@@UAE@XZ) has been defined in LIBCMTD.lib(stdexcpt.obj)
 37  1 >MSVCRTD.lib(MSVCR110D.dll ): error LNK2005: " public: virtual char const * __thiscall std::exception::what(void)const " (? what@exception@std@@UBEPBDXZ) is already defined in LIBCMTD.lib(stdexcpt.obj)
 38  1 > MSVCRTD.lib(MSVCR110D.dll): error LNK2005: __CrtDbgReportW is already defined in LIBCMTD.lib(dbgrptw.obj)
 39  1 >MSVCRTD.lib(ti_inst.obj): error LNK2005: " private: __thiscall type_info::type_info( class type_info const &) " (??0type_info@@AAE@ABV0@@Z) is already defined in LIBCMTD.lib(typinfo.obj)
 40  1 >MSVCRTD.lib(ti_inst.obj): error LNK2005: " private: class type_info & __thiscall type_info::operator=( class type_info const &) " (?? 4type_info@@AAEAAV0@ABV0@@Z) has been defined in LIBCMTD.lib(typinfo.obj)
 41  1 >LINK: warning LNK4098: The default library "MSVCRTD" conflicts with the use of other libraries ;Please use / NODEFAULTLIB:library
 42  1 >E:\Projects\C++ \IOCP_Socket\Debug\Test.exe: fatal error LNK1169: Found one or more multiple defined symbols
 43 ========== Generate : Success 0 , failure 1 , 0 latest , skip 0 ==========

Later, I checked it and found that it was a problem with the runtime library settings; the runtime library settings for several projects were different:

Project Properties -> Configuration Properties -> C/C++ -> Code Generation -> Runtime Library

We are set on the line, like multi-threaded debugging (/ MTd)

error: src refspec master does not match any. [How to Solve]

Since I learned git last time, I rarely use it. Using today

 

The local warehouse is initialized with the following command:

$ git init

Then use the following command to add the remote library:

$ git remote add origin [email protected]:hahah/ftpmanage.git

Then use

$ git push -u origin master

The following error occurred:

error: src refspec master does not match any.
error: failed to push some refs to '[email protected]:hahaha/ftpmanage.git'

the reason:

The local warehouse is empty

Solution: Use the following command to add files;

$ git add add.php addok.php conn.php del.php edit.php editok.php ftpsql.sql index.php

$ git commit -m "init files"

Then the following error occurred during the push process:

$ git push -u origin master
Warning: Permanently added the RSA host key for IP address 'xx.xx.xxx.xxx' to the list of known hosts.
To [email protected]:hahaha/ftpmanage.git
 ! [rejected]        master -> master (fetch first)
error: failed to push some refs to '[email protected]:hahahah/ftpmanage.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

Prompt to push after using git pull

Use the following command to solve:

$ git pull --rebase origin master
warning: no common commits
remote: Counting objects: 3, done.
remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (3/3), done.
From github.com:hahah/ftpmanage
 * branch            master     -> FETCH_HEAD
 * [new branch]      master     -> origin/master
First, rewinding head to replay your work on top of it...
Applying: init files

Continue to push, success.

$ git push -u origin master
Counting objects: 10, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (10/10), done.
Writing objects: 100% (10/10), 5.15 KiB | 0 bytes/s, done.
Total 10 (delta 3), reused 0 (delta 0)
To [email protected]:hahaha/ftpmanage.git
   a2b5c30..1044f15  master -> master
Branch master set up to track remote branch master from origin.

That’s it!!!

[Solved] NPM Error: gyp: No Xcode or CLT version detected!

problem

Recently, using npm to install modules in macOS Catalina, the following errors often occur:


> node-gyp rebuild

No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'.

No receipt for 'com.apple.pkg.DeveloperToolsCLILeo' found at '/'.

No receipt for 'com.apple.pkg.DeveloperToolsCLI' found at '/'.

gyp: No Xcode or CLT version detected!
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack     at ChildProcess.emit (events.js:210:5)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Darwin 19.3.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/yangjian/Documents/temp/test001/node_modules/fsevents
gyp ERR! node -v v12.13.0
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok 
  • Screenshot below

1

solution

1. Try to repair with the following command

$ xcode-select --install

The system prompts the following information:

xcode-select: error: command line tools are already installed, use "Software Update" to install updates

In fact, there is no so-called “Software Update” to update

2. Correct posture

When I was unable to do anything, I found the following solution:

$ sudo rm -rf $(xcode-select -print-path)
$ xcode-select --install

[Solved] ERROR 1819 (HY000): Your password does not satisfy the current policy requirements

In order to strengthen security, MySQL 5.7 randomly generates a password for the root user. In the error log, regarding the location of the error log, if the RPM package is installed, the default is /var/log/mysqld.log.

Generally can be set by log_error

mysql >  select  @@log_error ;
 + - -------------------+ 
|  @@log_error          | 
+ - ------------ -------+ 
|  / var / log / mysqld. log  | 
+ - -------------------+ 
1 row in  set ( 0.00 sec)

The MySQL temporary password can be obtained through the # grep “password” /var/log/mysqld.log command

2016 - 01 - 19T05: 16 : 36 .218234Z . 1  [ Note ] A Temporary password IS Generated for the root @localhost : WAQ, qR % BE2 ( . 5

After logging in to the server with this password, the password must be changed immediately, otherwise the following error will be reported:

mysql >  select  user ();
ERROR 1820 (HY000): You must reset your password using ALTER  USER statement before executing this statement.

If you just change it to a simple password, the following error will be reported:

mysql >   ALTER  USER  USER () IDENTIFIED BY  ' 12345678 ' ;
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements

This is actually related to the value of validate_password_policy.

The validate_password_policy has the following values:

Policy Tests Performed
0 or LOW Length
1 or MEDIUM Length; numeric, lowercase/uppercase, and special characters
2 or STRONG Length; numeric, lowercase/uppercase, and special characters; dictionary file

The default is 1, which is MEDIUM, so the password set at the beginning must meet the length, and must contain numbers, lowercase or uppercase letters, and special characters.

Sometimes, just for my own testing, I don’t want to set the password so complicated. For example, I just want to set the root password to 123456.

Two global parameters must be modified:

First, modify the value of the validate_password_policy parameter

mysql >  set global validate_password_policy = 0 ;
Query OK, 0 rows affected ( 0.00 sec)

In this way, the criterion for determining the password is based on the length of the password. This is determined by the validate_password_length parameter.

mysql >  select  @@validate_password_length ;
 + - --------------------------+ 
|  @@validate_password_length  | 
+ - ----- ---------------------+ 
|                           8  | 
+ - ---------------------- ----+ 
1 row in  set ( 0.00 sec)

The validate_password_length parameter defaults to 8, which has a minimum limit, the minimum value is:

validate_password_number_count
 + validate_password_special_char_count
 + ( 2  * validate_password_mixed_case_count)

Among them, validate_password_number_count specifies the length of data in the password, validate_password_special_char_count specifies the length of special characters in the password, and validate_password_mixed_case_count specifies the length of upper and lower letters in the password.

The default value of these parameters is 1, so the minimum value of validate_password_length is 4. If you explicitly specify that the value of validate_password_length is less than 4, although no error will be reported, the value of validate_password_length will be set to 4. As follows:

mysql >  select  @@validate_password_length ;
 + - --------------------------+ 
|  @@validate_password_length  | 
+ - ----- ---------------------+ 
|                           8  | 
+ - ---------------------- ----+ 
1 row in  set ( 0.00 sec)

mysql >  set global validate_password_length = 1 ;
Query OK, 0 rows affected ( 0.00 sec)

mysql >  select  @@validate_password_length ;
 + - --------------------------+ 
|  @@validate_password_length  | 
+ - ----- ---------------------+ 
|                           4  | 
+ - ---------------------- ----+ 
1 row in  set ( 0.00 sec)

If any value of validate_password_number_count, validate_password_special_char_count, validate_password_mixed_case_count is modified, validate_password_length will be modified dynamically.

mysql >  select  @@validate_password_length ;
 + - --------------------------+ 
|  @@validate_password_length  | 
+ - ----- ---------------------+ 
|                           4  | 
+ - ---------------------- ----+ 
1 row in  set ( 0.00 sec)

mysql >  select  @@validate_password_mixed_case_count ;
 + - ------------------------------------+ 
|  @@ validate_password_mixed_case_count  | 
+ - ------------------------------------+ 
|                                     1  | 
+ - - ----------------------------------+ 
1 row in  set ( 0.00 sec)

mysql >  set global validate_password_mixed_case_count = 2 ;
Query OK, 0 rows affected ( 0.00 sec)

mysql >  select  @@validate_password_mixed_case_count ;
 + - ------------------------------------+ 
|  @@ validate_password_mixed_case_count  | 
+ - ------------------------------------+ 
|                                     2  | 
+ - - ----------------------------------+ 
1 row in  set ( 0.00 sec)

mysql >  select  @@validate_password_length ;
 + - --------------------------+ 
|  @@validate_password_length  | 
+ - ----- ---------------------+ 
|                           6  | 
+ - ---------------------- ----+ 
1 row in  set ( 0.00 sec)

Of course, the premise is that the validate_password plug-in must have been installed, and MySQL 5.7 is installed by default.

So how to verify whether the validate_password plugin is installed? You can check the following parameters, if it is not installed, the output will be empty.

mysql > SHOW VARIABLES LIKE  ' validate_password% ' ;
 + - ------------------------------------+ -------+ 
| Variable_name                         | Value | 
+ - ---------------------------------- --+-------+ 
| validate_password_dictionary_file     |        | 
| validate_password_length              |  6      | 
| validate_password_mixed_case_count    |  2      | 
| validate_password_number_count        |  1      |
| validate_password_policy              | LOW    | 
| validate_password_special_char_count |  1      | 
+ - ------------------------------------+ -------+ 
6 rows in  set ( 0.00 sec)