Tag Archives: linux

[Solved] Gitlab Error: gitlab-ctl reconfigure Error: STDERR: initdb: error: invalid locale settings; check LANG and L

The error report is shown in the figure

There was an error running gitlab-ctl reconfigure:

execute[/opt/gitlab/embedded/bin/initdb -D /var/opt/gitlab/postgresql/data -E UTF8] (postgresql::enable line 49) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of /opt/gitlab/embedded/bin/initdb -D /var/opt/gitlab/postgresql/data -E UTF8 ----
STDOUT: The files belonging to this database system will be owned by user "gitlab-psql".
This user must also own the server process.
STDERR: initdb: error: invalid locale settings; check LANG and LC_* environment variables
---- End output of /opt/gitlab/embedded/bin/initdb -D /var/opt/gitlab/postgresql/data -E UTF8 ----
Ran /opt/gitlab/embedded/bin/initdb -D /var/opt/gitlab/postgresql/data -E UTF8 returned 1
                   Default character set issues

Ensure that there is more than 4G in the

Solution process:

vim /etc/profile
# Add the following to the end of the configuration file
export LC_CTYPE=en_US.UTF-8
export LC_ALL=en_US.UTF-8
# reread the environment variables
[root@localhost src]# source /etc/profile
# Reload
[root@localhost src]# gitlab-ctl reconfigure
It is best to change the password the first time you enter
Details: > https://blog.csdn.net/weixin_46115601/article/details/120721246

How to Solve Linux connecte to the old version of SQL Server Error

Most methods of online search can’t help me
the errors are as follows:
the server selected protocol version tls10 is not accepted by client preferences [tls12]
in the root directory of Java (mine is 1.8), the jdk11 will find the security file under conf, and there is a java.security file under JRE/lib/security, The jdk.tls.disabledalgorithms configuration in this file will disable the tls1.0 version of the transport protocol. At this time, we need to close the protocol and delete tls1.0. Of course, deletion under this file is useless. Most posts on the Internet also say that it is impossible to change this file. Therefore, the following methods are used, Create a new empty file and paste it as follows:

jdk.tls.disabledAlgorithms=SSLv3, RC4, DES, MD5withRSA, \
 DH keySize < 1024, EC keySize < 224, 3DES_EDE_CBC, anon, NULL, \
 include jdk.disabled.namedCurves```
Save it and run the java project:

```bash
-Djava.security.properties=xxx

The above parameters determine the location of the new file. At this time, the error can be solved.

CDH operation and maintenance: child node cloudera SCM agent starts Error

1.Startup Error:
./cloudera-scm-agent start
Error Screenshot:

2.Delete or backup to other corresponding pid files according to the error report
find/-name cloudera-scm-agent.pid
mv cloudera-scm-agent.pid cloudera-scm-agent.pid20211019
or rm -rf cloudera-scm-agent.pid
3.restart cloudera-scm-agent
./cloudera-scm-agent start
Done!

Error no module named ‘in newly installed Python_ sqlite3‘

Tencent cloud server Ubuntu 20 already has Python 3.8. Download the installation package from Huawei cloud. After installing Python 3.9, an error is reported

solve:

Copy the dependent files from the existing 3.8 to 3.9, and then rename them. The command is as follows

ubuntu@esoaru-net ~/github/aiopathlib
☺  python3.8 -c 'import _sqlite3;print(_sqlite3.__file__)'                                                                                                          master ✗
/usr/lib/python3.8/lib-dynload/_sqlite3.cpython-38-x86_64-linux-gnu.so
ubuntu@esoaru-net ~/github/aiopathlib
☺  which python3.9                                                                                                                                                  master ✗
/usr/local/bin/python3.9
ubuntu@esoaru-net ~/github/aiopathlib
☺  cp /usr/lib/python3.8/lib-dynload/_sqlite3.cpython-38-x86_64-linux-gnu.so /usr/lib/python3.9/lib-dynload/                                                        master ✗
cp: cannot create regular file '/usr/lib/python3.9/lib-dynload/_sqlite3.cpython-38-x86_64-linux-gnu.so': Permission denied
ubuntu@esoaru-net ~/github/aiopathlib
☹  sudo cp /usr/lib/python3.8/lib-dynload/_sqlite3.cpython-38-x86_64-linux-gnu.so /usr/lib/python3.9/lib-dynload/                                                   master ✗
ubuntu@esoaru-net ~/github/aiopathlib
☺  python3.9 -c 'import _sqlite3;print(_sqlite3.__file__)'                                                                                                          master ✗
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named '_sqlite3'
ubuntu@esoaru-net ~/github/aiopathlib
☹  cd /usr/lib/python3.9/lib-dynload                                                                                                                                master ✗
ubuntu@esoaru-net /usr/lib/python3.9/lib-dynload
☺  sudo mv _sqlite3.cpython-38-x86_64-linux-gnu.so _sqlite3.cpython-39-x86_64-linux-gnu.so
ubuntu@esoaru-net /usr/lib/python3.9/lib-dynload
☺  python3.9 -c 'import _sqlite3;print(_sqlite3.__file__)'
/usr/lib/python3.9/lib-dynload/_sqlite3.cpython-39-x86_64-linux-gnu.so
☹  sudo cp /usr/lib/python3.9/lib-dynload/* /usr/local/lib/python3.9/lib-dynload/  

Summary:

It’s actually a line of command

sudo cp /usr/lib/python3.8/lib-dynload/_sqlite3.cpython-38-x86_64-linux-gnu.so /usr/lib/python3.9/lib-dynload/_sqlite3.cpython-39-x86_64-linux-gnu.so

[Linux] MAC installation pyfasttext error

Reference: MacOS installation pyfasttext error reporting solution_ Kungreye CSDN blog

Mac usage  clang   Compile and change the compilation path again to successfully install (both methods are OK).

Solution:  

CXX=/usr/bin/clang CC=/usr/bin/clang pip3 install --no-cache pyfasttext

[Solved] sys.stderr.write(f“ERROR: {exc}“) ^ SyntaxError: invalid syntax

Reference link: (19 messages) two reasons and solutions for syntaxerror: invalid syntax in PIP instruction,

The relevant solutions in the original text are as follows:

However, the get-pip.py file was not found in the process of trying to solve it. Access the index of /.

https://bootstrap.pypa.io/ Observe that the relevant version of get-pip.py file is found in PIP

To sum up, the command to get-pip.py should be

wget https://bootstrap.pypa.io/pip/3.5/get-pip.py

After downloading, execute the following command
python3 get-pip.py

How to Solve Fopen bus error

Bus error (core dumped) occurs in my program, and the error is locked in the fopen part of the code

void dipget(int icdp, int nti, float *dip, char * tanpath)
{
  FILE * dfile;
  char *filename;

  printf("Choose %d from %s\n",icdp, tanpath);
  sprintf(filename, "%s%d.x.dat",tanpath, icdp);
  printf("Open file: %s \n", filename);

  if((dfile = fopen(filename,"rb"))==NULL) // Bus error
  {
    printf("\n Open %s File error\n",filename);
    exit(EXIT_FAILURE);
  }
  fread(dip, sizeof(float), nti, dfile);
  fclose(dfile);
}

Here, you only need to make one step of modification to solve the problem. The reason is very simple. Before using sprintf, you need to allocate a buffer space to it

  char *filename;
  Change to
  char filename[200];

error while loading shared libraries [How to Solve]

When running the program, the following errors occur:

 error while loading shared libraries: libXXXXXXX.so.1: cannot open shared object file: No such file or directory

1. First open the/etc/ld.so.conf file

2. Add the directory where the dynamic library file is located: execute VI/etc/ld.so.conf, and add “/usr/local/lib” under “include LD.So.Conf.d/*.Conf”.

3. After saving, execute:/SBIN/ldconfig – V on the command line terminal; Its function is to cache the library files under the path listed in the file/etc/ld.so.conf to/etc/ld.so.cache for use. Therefore, when some library files are installed or/etc/ld.so.conf is modified to add a new search path for the library, it is necessary to run ldconfig to cache all library files into the file/etc/ld.so.cache. If it is not done, the newly installed library may not be found.

[Solved] Apex Install Error: ERROR: Command errored out with exit status 1

First of all, the most important thing is the version correspondence problem:
my environment
linux Ubuntu 16.04.7 lts
python = 3.7
python = 1.4
CUDA = 10.1
the versions of the above four should correspond. This can be found online.

This is the official installation procedure:

git clone https://github.com/NVIDIA/apex
cd apex
pip install -v --disable-pip-version-check --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" ./

If not, replace the installation statement with the following:

python setup.py install --cuda_ext --cpp_ext

Errors may be reported here:
filenotfounderror: [errno 2] no such file or directory: ‘:/usr/local/cuda-10.1/bin/nvcc’: ‘:/usr/local/cuda-10.1/bin/nvcc’

The problem here lies in “: /”, so we just need to specify
export cuda_home = {/usr/local/cuda-10.1} to remove the redundant “:”, and then run it again. We will report some warnings. Don’t worry.