Tag Archives: No such file or directory

[Solved] Linux Execute File Error: no such file or directory (bit mismatch)

Recently, an executable file was executed in the Ubuntu 16.04 system, and the prompt no such file or directory appeared, as shown below:

In fact, this file exists

After consulting the data, it is found that the reason may be that the number of system bits does not match the number of Lib libraries required by the executable file, as shown below:

The system is a 64 bit system and the executable file is 32 bits

To run 32-bit programs with on a 64 bit system, you need to install the 32-bit lib library. For Ubuntu users, you can install using the following command:

sudo apt-get install ia32-libs

If the installation is not successful, lib32z1 can be used instead. Then you can run the previous executable file normally.

[Solved] libmysqlclient.so.16: cannot open shared object file: No such file or directory Error

libmysqlclient.so.16: cannot open shared object file: No such file or directory.

 

 

See libmysqlclient.so.16: find/-name libmysqlclient.so.16

If it’s installed,

ln -s /usr/local/mysql/lib/mysql/libmysqlclient.so.16 /usr/lib/libmysqlclient.so.16

This can solve, but it needs to be ldconfig

 

If not installed:

Method 1:

download libmysqlclient.so.16, put it in/usr/lib, if 64, put it in/usr/lib64

Method 2:

Example: MySQL-shared-compat package.

Command: #rpm -qp –provides MySQL-shared-compat-5.1.47-1.rhel5.x86_64.rpm

MySQL-shared

libmysqlclient.so.12()(64bit)

libmysqlclient.so.14()(64bit)

libmysqlclient.so.14(libmysqlclient_14)(64bit)

libmysqlclient.so.15()(64bit)

libmysqlclient.so.15(libmysqlclient_15)(64bit)

libmysqlclient.so.16()(64bit)

libmysqlclient.so.16(libmysqlclient_16)(64bit)

libmysqlclient_r.so.12()(64bit)

libmysqlclient_r.so.14()(64bit)

libmysqlclient_r.so.14(libmysqlclient_14)(64bit)

libmysqlclient_r.so.15()(64bit)

libmysqlclient_r.so.15(libmysqlclient_15)(64bit)

libmysqlclient_r.so.16()(64bit)

libmysqlclient_r.so.16(libmysqlclient_16)(64bit)

MySQL-shared-compat = 5.1.47-1.rhel5

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

As a result, this method can be reached 24443; it depends on the issue of human beings like libmysqlclient.so. Without facing a different problem, it’s decided.

Download location:

http://dev.mysql.com/downloads/mysql/5.1.html

下载安装包名:MySQL-shared-compat-5.1.47-1.rhel5.x86_64

Executable command installation: #rpm -ivh MySQL-shared-compat-5.1.47-1.rhel5.x86_64

[Solved] libgtk-3.so.0 or libXt.so.6: cannot open shared object file: No such file or directory

libgtk-3.so.0: cannot open shared object file: No such file or directory Couldn’t load XPCOM

error:

[root@test firefox]# firefox 

XPCOMGlueLoad error for file /usr/lib64/firefox/libmozgtk.so:
libgtk-3.so.0: cannot open shared object file: No such file or directory
Couldn't load XPCOM.

Solution:

1. To uninstall the original firebox:

yum romove firefox

2. Installing gtk3

yum install gtk3

3. Download the latest version of firebox installation

wget https://download-ssl.firefox.com.cn/releases/firefox/60.0/zh-CN/Firefox-latest-x86_64.tar.bz2

Decompression: tar - xjvf firefox-latest-x86_ 64.tar.bz2

The extracted file is firebox

4. Setting environment variables

Modify configuration file

vim /etc/profile

Add at the end

PATH=$PATH:/usr/local/firefox   #/usr/local/firefox is firefox unzip folder
export PATH

:wq! Exit file
execution

source /etc/profile

libXt.so.6: cannot open shared object file: No such file or directory

[root@crawl-01 bin]# firefox -v
XPCOMGlueLoad error for file /usr/lib64/firefox/libxul.so:
libXt.so.6: cannot open shared object file: No such file or directory
Couldn't load XPCOM.

Solution:

yum install libXt*  Install the appropriate packages
rpm -qa | grep libXt View the installed packages and see if the number is complete.

Note: you can’t use RPM - uvh libxt * to install. This installation method will report package dependency errors, even if you install interdependent packages together. The reason is that RPM does not solve the problem of package dependency

Remember to check the error of no such file or directory in PHP mysqli once

Geeks, please accept the hero post of 2021 Microsoft x Intel hacking contest>>>

Recently, one of the company’s development machines broke down and needed to transfer some work-related systems to another machine. In the process of transferring mantis, it was found that MySQL could not be connected, and the error was no such file or directory. This error message obviously told me that the file did not exist, but I connected to MySQL through the network. Why did I prompt that the file did not exist?So I wrote a test code

$mysqli = new mysqli('localhost', 'root', '', 'bugtracker');
if ($mysqli->connect_error) {
    die('Connect Error (' . $mysqli->connect_errno . '): '. $mysqli->connect_error);
}

Sure enough, it’s still wrong

PHP Warning:  mysqli::mysqli(): (HY000/2002): No such file or directory in /root/test.php on line 2

In order to ensure that the parameters are correct, the MySQL client is used for testing

mysql -uroot -hlocalhost

Well, it’s connected. There’s no error at all. That means there’s no problem with the parameters. But why can’t MySQL client connect normally with the same parameters and PHP connect?In order to find out, I ran this code again with strace, and found that the system call connect is not TCP, but UNIX domain, and the file path is/TMP/mysql.sock, but this file does not exist

connect(3, {sa_family=AF_FILE, path="/tmp/mysql.sock"}, 17) = -1 ENOENT (No such file or directory)

So far, I have known the source of the error. It is the use of unixdomain to connect to an address that does not exist, resulting in an error. But why use unixdomain to connect to MySQL?And where does this address come from?According to historical records, when you use localhost to connect, you will use unixdomain. So MySQL client also uses unixdomain?So we used strace to MySQL again

connect(3, {sa_family=AF_FILE, path="/var/lib/mysql/mysql.sock"}, 110) = 0

Found that connect does use unixdomain, but… This file path is completely different from the above, and this path exists.. But where did/TMP/mysql.sock come from?So I kept going through the PHP document, which clearly pointed out that the socket parameter of mysqli constructor (that is, the file path of the UNIX domain mentioned above) is from mysqli. Default of php.ini by default_ Then check the parameters again

php -i|grep 'mysqli.default_socket'
mysqli.default_socket => no value => no value

Huh?It’s not worth it. Where did this product come from?In order to find out the truth, I began to look through the source code of mysqli. Sure enough, I found such a paragraph from the source code

if (host_len == sizeof("localhost") - 1 && !strncasecmp(host, "localhost", host_len)) {
    DBG_INF_FMT("socket=%s", socket_or_pipe?socket_or_pipe:"n/a");
    if (!socket_or_pipe) {
        socket_or_pipe = "/tmp/mysql.sock";
    }
    transport_len = mnd_sprintf(&transport, 0, "unix://%s", socket_or_pipe);
    unix_socket = TRUE;
}

If you use localhost, use unixdomain. The file path is the socket in the parameter. If the parameter is empty, then write/TMP/mysql.socket. In this way, the above error address is dead in the source code, so you need to manually set it to the correct value. So modify the parameters of mysqli and test again

$mysqli = new mysqli('localhost', 'root', '', 'bugtracker', 3306, "/var/lib/mysql/mysql.sock");

Sure enough, we have found out the truth. We can’t connect because we use localhost and mysqli. Default_ The value of socket is empty, and the default path provided in the source code does not exist. I don’t have to ask here. Can I add two judgments?If you use localhost and socket is not empty, you can use unixdomain instead of providing the default path, because if you install PHP first and then mysql, the default_ Socket will be null

Of course, it’s very simple to solve this problem. There are many articles on the Internet about how to solve it, such as mysqli. Default_ Change the value of socket to the correct path, or change localhost to 127.0.0.1, etc. Mainly want to know why do not configure socket will be wrong, to find the root of the problem to suit the remedy

OSError: [Errno 8] Exec format error: “No such file or directory3” or “/usr/local/bin/python3^M: bad interpreter:…

Today, I encountered this problem on the Internet. Oserror: [errno 8] exec format error: I searched the Internet and found a solution. I added #, which is on the first line of Py file/ usr/bin/env python3

Continue to run or report an error, “no that file or directory 3” continue to search the Internet to find a solution

Why

If you are using #! /usr/local/bin/python3 this way, the error "/usr/local/bin/python3^M: bad interpreter: no such file or directory" will appear.

If you are using #! /usr/bin/env python3, you get the error "No such file or directory3".

The reason for the error is that each line of the code has 3^M more at the end, which is due to the fact that I wrote the code on Windows and then put it on Linux.

However, when I open the code, it looks normal, but when I view the file with cat -v command, I can see that there is a ^M symbol at the end of each line.

Solutions

Run the following command to replace the ^ m symbol and regenerate a file:

cat -v oldfile.py | sed -e '1,$s/\^M$/ /g' > newfile.py

And then it’s working

 

How to Solve Airflow Install Error: OSError: [Errno 2] No such file or directory

Airflow website address

http://airflow.apache.org/

System environment:

CentOS release 6.5 (Final)

python 2.7.13

pip 9.0.1

Problems emerge

Install airflow under the root user in the way of quick start on the official website

export AIRFLOW_HOME=~/airflow
pip install airflow
airflow initdb

All the above commands can be executed normally when airflow is started

/usr/local/python-2.7.13/bin/airflow webserver

Report the following error

[2017-06-30 09:24:01,609] {__init__.py:57} INFO - Using executor SequentialExecutor
  ____________       _____________
 ____    |__( )_________  __/__  /________      __
____  /| |_  /__  ___/_  /_ __  /_  __ \_ | /|//
___  ___ | /_ /  _  __/ _ // /_/ /_ |/ |/ /
 _/_/  |_/_/  /_/    /_/    /_/  \____/____/|__/

/usr/local/python/lib/python2.7/site-packages/flask/exthook.py:71: ExtDeprecationWarning: Importing flask.ext.cache is deprecated, use flask_cache instead.
  .format(x=modname), ExtDeprecationWarning
[2017-06-30 09:24:02,045] [29107] {models.py:167} INFO - Filling up the DagBag from /root/airflow/dags
Running the Gunicorn Server with:
Workers: 4 sync
Host: 0.0.0.0:8080
Timeout: 120
Logfiles: - -
=================================================================
Traceback (most recent call last):
  File "/usr/local/python/bin/airflow", line 28, in <module>
    args.func(args)
  File "/usr/local/python/lib/python2.7/site-packages/airflow/bin/cli.py", line 791, in webserver
    gunicorn_master_proc = subprocess.Popen(run_args)
  File "/usr/local/python/lib/python2.7/subprocess.py", line 390, in __init__
    errread, errwrite)
  File "/usr/local/python/lib/python2.7/subprocess.py", line 1024, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

Solutions

Configure /usr/local/python-2.7.13/bin/ to environment variables

export PATH=$PATH:/usr/local/python-2.7.13/bin/

Start ariflow again, the problem is solved.