Category Archives: How to Fix

Beeline connection hive2 reports an error permission denied

Error message:

Error: Could not open client transport with JDBC Uri: jdbc:hive2://localhost:10000:
Failed to open new session: 
java.lang.RuntimeException: 
org.apache.hadoop.security.AccessControlException: 
Permission denied: user=anonymous, access=EXECUTE   , inode="/tmp":root:supergroup:drwx------

After trying to add an account and password to hive, it is found that the problem is stored in the last sentence. I am anonymous and the read-write permission of/tmp directory is drwx——

The first character: - indicates that this is a file, d indicates that this is a folder, | indicates that this is a connection file
is divided into three characters in a group
the first three: that is, RWX indicates owner permissions
the middle three: --- user permissions in the same group
the last three: --- other user permissions

permission

represents

value

binary

specific role

R

read

4

00000100

the current user can read the file content and browse the directory

W

write write

2

00000010

the current user can add or modify file contents, and the current user can delete or move directories or files in directories

x

execute

1

00000001

the current user can execute files and enter the directory

Aka, my root account is accessing hive2, so I belong to other user permissions, so I was rejected
solution:

Change the access permission of this file/file directory in the HDFS file system and relax it. The syntax of changing permissions is similar to that of Linux
HDFS DFS - Chmod - R 777/tmp log in with the account password of HDFS

Lamdba in the studio part reports an error. Observe lamdba reports an error but can run

Question:

Ordinary lamdba can be used, such as view. Setonclicklistener {}

Some lamdbas are popular but can run, such as livedata. Observe() {}

solve:

It’s not because the Java version is backward. I updated the kotlin plug-in to solve this problem

Studio even pops up a warning pop-up window of “plug-in needs to be updated” in the lower right corner, but I ignore it everyday… Try to update the Java version and still can’t solve it before you notice it

Error in react build packaging test environment

#NPM run build: test or yarn build: Test

        

Dotenv cli needs to be installed before use( https://github.com/entropitor/dotenv-cli )Otherwise, the following error will be reported:

dotenv -e .env.development craco build

'dotenv' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build:test: `dotenv -e .env.development craco build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build:test script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\node\node_cache\_logs\2021-09-01T02_25_42_552Z-debug.log

 

To install global dotenv cli:

Execute command:   yarn global add dotenv-cli           perhaps         npm   install -g   dotenv-cli  

Installation complete:

Execute again as shown in the figure:

Packaging complete  

Xcode12 error in compiling cocos2d [How to Solve]

Using xcode12 to build the cocos2d 3.17 project has the following similar problems:

the linked framework is missing one or more architectures required by this target arm64

The reason: because V8 does not support 32-bit CPU, that is, it does not support armv7. If you do not need to support 32-bit devices, you can directly remove the compilation of armv7

Amend as follows:

 

  Basically, the above four modifications can solve the project running in the debug mode. It has not been tried on the real machine for the time being. It should also directly modify the configuration in the release.

There will be some minor problems after modifying the above:

1.Argument value 10880 is outside the valid range [0, 255]

Amend as follows:

Need to

#define BT_ SHUFFLE(x,y,z,w) ((w)<& lt; 6 | (z)<& lt; 4 | (y)<& lt; 2 | (x))

Change to

#define BT_ SHUFFLE(x, y, z, w) (((w) <& lt; 6 | (z) <& lt; 4 | (y) <& lt; 2 | (x)) & 0xff)

2.The application’s Info.plist does not contain CFBundleShortVersionString.

Modify as follows: add cfbundleshortversion in info.plist

Ubuntu Reportno moulde named tkinter

In the Ubuntu system, an error is reported by using Python Tkinter:
no mount named Tkinter
the following error appears after changing the code file to Tkinter

using sudo apt to install Python TK
in fact, a solution has been prompted in the error report, so you should read the tips carefully

Solutions to errors in ipvsadm startup

Centos7 Yum – y install ipvadm. After installing, start ipvsadm with an error.


# systemctl status ipvsadm. Service finally, I see a reliable solution. Manually generate this file:

ipvsadm --save > /etc/sysconfig/ipvsadm

Service ipvsadm start – confirm

Git report HTTP Basic: Access denied

Recently, when submitting code on the company intranet using git, the following error message was encountered:

remote: HTTP Basic: Access denied
fatal: Authentication failed for 'http://dev.xxxxx/gitlab/XXXX.git/'

1、 Error reason

The reason for this error is an error in the verification of user name or password .

I have changed the configuration under the. SSH file before, but the verification is not successful.

2、 Settle

Find the corresponding project directory, execute the following git command, and re-enter the account and password

git config --system --unset credential.helper

An error is reported when uploading a file using commonsmultipartfile

Handler dispatch failed; nested exception is java.lang.NoClassDefFoundError: org/apache/commons/io/output/DeferredFileOutputStream

An error is reported when uploading a file using commonsmultipartfile. The error is due to the following reasons: the corresponding jar package of Commons IO is missing

The solution is to import the dependencies of Commons IO in POM. Update the classes jar package and import it successfully

Just run the program

An error is reported when uploading a file using commonsmultipartfile

Errors are reported as follows

HTTP status 500 – internal server error

Type exception report

Message handler dispatch failed; nested exception is java.lang.NoClassDefFoundError: org/apache/commons/io/output/DeferredFileOutputStream

Description the server encountered an unexpected condition that prevented it from completing the request.

Exceptions

org.springframework.web.util.NestedServletException: Handler dispatch failed; nested exception is java.lang.NoClassDefFoundError: org/apache/commons/io/output/DeferredFileOutputStream
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1006)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:925)
org.springframework.web.servlet.FrameworkServlet.proc essRequest(FrameworkServlet.java:974)
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:877)
javax.servlet.http.HttpServlet.service(HttpServlet.java:681)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:851)
javax.servlet.http.HttpServlet.service(HttpServlet.java:764)
or g.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

reason

The corresponding jar package of Commons IO is missing

terms of settlement

Import common IO dependency in POM

Update the classes

The jar package was imported successfully

Just run the program

error: initializer element is not constant [How to Solve]

1. Background

C language compilation error: error: initializer element is not constant. The error code is as follows:

    char *info = (char *)malloc(len);
    static char *info_t = info;

The above error is caused by trying to initialize a static variable with the memory pointer allocated by malloc.

2. Error reason

Static variable is a global variable. The value of the global variable cannot be determined at compile time, but at run time (compilation principle). Therefore, the global variable cannot be initialized directly with the return value of malloc at the time of declaration. Replace with the following:

    char *info = (char *)malloc(len);
    static char *info_t; 
    info_t = info;

Compilation passed.

C++: terminate called after throwing an instance of ‘std::length_error‘ (sort function cmp sorting rules problem)

Leetcode-539: encountered a big problem when brushing the minimum time difference:

Errors are reported as follows:

terminate called after throwing an instance of 'std::length_error'
  what():  basic_string::_M_create

The error code is as follows:

class Solution {
public:
    static bool cmp(string x,string y){ //Handwritten sorting rules Sort by chronological ascending order
        int Xshi= (x[0]-'0')*10+x[1]-'0';
        int Xfen= (x[3]-'0')*10+x[4]-'0';
        int Yshi= (y[0]-'0')*10+y[1]-'0';
        int Yfen= (y[3]-'0')*10+y[4]-'0';
        if(Xshi>Yshi || (Xshi==Yshi && Xfen> Yfen))  return false;
        else return true;
    }
    //input time has been sorted x is less than y to find two time minute difference function
    int Time_diff(string x,string y){
        int Xshi= (x[0]-'0')*10+x[1]-'0';
        int Xfen= (x[3]-'0')*10+x[4]-'0';
        int Yshi= (y[0]-'0')*10+y[1]-'0';
        int Yfen= (y[3]-'0')*10+y[4]-'0';

        int diff=(Yshi-Xshi)*60;
        if(Yfen>Xfen) diff+=Yfen-Xfen;
        else diff-=Xfen-Yfen;
        return diff;
    }
    int findMinDifference(vector<string>& timePoints) {
        //After sorting, compare the two adjacent to each other and also compare the first and last
        sort(timePoints.begin(),timePoints.end(),cmp);
        //compare the first and the last
        int T_min=min(  Time_diff(timePoints[0],timePoints[timePoints.size()-1]),  
                        1440-(Time_diff(timePoints[0],timePoints[timePoints.size()-1])) );
        //Two adjacent to each other for comparison
        for(int i=1;i<timePoints.size();i++)
        {
            T_min=min(T_min, Time_diff(timePoints[i-1],timePoints[i]) );
        }
        return T_min;
    }
};

Looking back and forth at the code, I was stunned that I couldn’t see any problems. I consulted hundreds of relevant web pages, basically for the following two reasons:

    1. an empty string was entered. The array subscript is out of bounds

However, these two problems are obviously not in my code. Finally, I checked all night and found the official description of sort sorting comparison.

https://en.cppreference.com/w/cpp/named_req/Compare

Let’s focus here:

In other words, for the CMP comparison function we handwritten, the following three points should be met:

      1. for all input a, input two identical elements, namely CMP (a, a). If the returned result is false, it cannot be false. If the result of entering CMP (a, b) is true, conversely, the result of entering CMP (B, a) is false, that is, if a > b. No more B > a. Otherwise, there will be contradictions. If the result of input CMP (a, b) is true, and the result of input CMP (B, c) is true, then the result of CMP (a, c) should also be true, which is also well understood. If a > B and B > C then a must be greater than C

Here, we should mainly pay attention to the first point. When the two numbers are the same, the returned result should be false, and my code:

    static bool cmp(string x,string y){ //Handwritten sorting rules Sort by chronological ascending order
        int Xshi= (x[0]-'0')*10+x[1]-'0';
        int Xfen= (x[3]-'0')*10+x[4]-'0';
        int Yshi= (y[0]-'0')*10+y[1]-'0';
        int Yfen= (y[3]-'0')*10+y[4]-'0';
        if(Xshi>Yshi || (Xshi==Yshi && Xfen> Yfen))  return false;
        else return true;
    }

This rule is not satisfied. So add one   =  Number to make it comply with the rules.

    static bool cmp(string x,string y){ //Handwritten sorting rules Sort by chronological ascending order
        int Xshi= (x[0]-'0')*10+x[1]-'0';
        int Xfen= (x[3]-'0')*10+x[4]-'0';
        int Yshi= (y[0]-'0')*10+y[1]-'0';
        int Yfen= (y[3]-'0')*10+y[4]-'0';
        if(Xshi>Yshi || (Xshi==Yshi && Xfen>= Yfen))  return false;
        else return true;
    }

The problem that bothered me all night was solved.