#StackBounty: #centos #apache-httpd #url #rewrite URL rewriting for root of website

Bounty: 50

This is an excerpt of the configuration of my Apache 2.4.37 webserver on Centos 8:

RewriteEngine on

RewriteRule ^/$ /index.php [R,L]

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9} /(([^/]+/)*([^/.]+)).php[ ?]
RewriteRule .php$ /%1/ [R=301,NC,L]
RewriteRule ^(.*)/$ /$1.php [NC,L]

The second rule block is taken from here and rewrites all URLs https://mysite.com/anypage.php to https://mysite.com/anypage/, hiding PHP file extensions and making permalinks nicer to see.

I’ve added the first rule block after noticing that the URL https://mysite.com/ returned a File not Found. Now it works.

However, a minor annoyance is that https://mysite.com/ redirects to https://mysite.com/index/ (since it loads the file index.php).

My question: How can this configuration be changed so that the URL https://mysite.com/ stays the same?


Get this bounty!!!

#StackBounty: #centos #display #session #remote-desktop Using Remote Desktop on my private VM, I enter another existing session than th…

Bounty: 50

At work, we are developing programs, each developer having his own private VM under CentOS.
I disconnect my session at the end of the day, then the next morning I start Remote Desktop under Windows and join it again.

But today, I went on a different Windows workstation, with lower resolution display.
I started my remote session with Remote Desktop as usual in direction of CentOS who led me to another, old, already opened session of mine that I started one month before…
I was troubled. I disconnected, came back to my previous workstation and retrieved the one I was expecting.

Question 1 : How this behavior explains itself?

Question 2 : How to drop my old session from the main one?

When I do a who command from my main session, I see myself + a number of me equals to the number of shell I have opened with KConsole.

How can I list how many others session like the one I found today are still opened and how can I close them?


Get this bounty!!!

#StackBounty: #ubuntu #centos #networkmanager Issues installing CentOS 8, suspects issues with NetworkManager to be the reason

Bounty: 50

So I am trying to change OS on my server, from Ubuntu 18 to CentOS 8.

I have made an install media for my CentOS 8 on a USB drive. When I boot from the drive on my server the installer always crashes and usually returns an error like:

gGLib.Error: g-dbus-error-quark: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such interface org.freedesktop.DBus.Properties on object path /org/freedesktop/NetworkManager/Devices/96

Where the last number (in this case 96) can by another number such as 9. I can also see 100+ network interfaces when changing settings during the installation.

This made me think that there must be an issue with NetworkManager. So I made a bootable ubuntu USB drive, booted it on my laptop and called NetworkManager with gdbus and the method GetDevices. It returned three expected interfaces.

I then booted the same USB on my server and ran the same command but then I got:

Error: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such interface "org.freedesktop.NetworkManager" on object at path /org/freedesktop/NetworkManager

This is where I am stuck and I do not know how to continue the troubleshooting.


Get this bounty!!!

#StackBounty: #linux #centos #mount #cifs #centos8 Unstable CIFS mount on CentOS 8

Bounty: 100

We recently created several centOS 8 serveur for running some springboot applications, which mount several directories from
a windows server. Mount is working, but we are getting lots of errors at random time of the day

sample dmesg output:

[Wed Oct 21 15:31:21 2020] CIFS VFS: Send error in SessSetup = -11
[Wed Oct 21 18:59:56 2020] CIFS VFS: Send error in SessSetup = -11
[Thu Oct 22 07:37:51 2020] CIFS VFS: Send error in SessSetup = -11
[Thu Oct 22 08:28:37 2020] CIFS VFS: Send error in SessSetup = -11
[Thu Oct 22 08:49:07 2020] CIFS VFS: Server XXXXXXX has not responded in 120 seconds. Reconnecting...
[Thu Oct 22 11:07:38 2020] CIFS VFS: Send error in SessSetup = -11
[Thu Oct 22 11:07:52 2020] CIFS VFS: Send error in SessSetup = -11
[Thu Oct 22 14:20:52 2020] CIFS VFS: Send error in SessSetup = -11
[Thu Oct 22 17:22:24 2020] CIFS VFS: Send error in SessSetup = -11
[Fri Oct 23 06:33:03 2020] CIFS VFS: Send error in SessSetup = -11
[Fri Oct 23 06:35:03 2020] CIFS VFS: Server XXXXXXX has not responded in 120 seconds. Reconnecting...
[Fri Oct 23 08:27:45 2020] CIFS VFS: Send error in SessSetup = -11
[Fri Oct 23 08:28:06 2020] CIFS VFS: Send error in SessSetup = -11

The issue does not arise when we mount the same dir from centOS 7

Mount

centOS 7

//SERVER/DATA on /mnt/data type cifs (rw,nosuid,noexec,relatime,vers=3.0,cache=strict,username=data_user,domain=xxx.xxx.xxx,uid=1000,forceuid,gid=1000,forcegid,addr=xxx.xx.x.xx,file_mode=0755,dir_mode=0755,soft,nounix,serverino,mapposix,rsize=1048576,wsize=1048576,echo_interval=60,actimeo=1)

centOS 8

//SERVER/DATA on /mnt/data type cifs (rw,nosuid,noexec,relatime,vers=3.0,cache=strict,username=data_user,domain=xxx.xxx.xxx,uid=1000,forceuid,gid=1000,forcegid,addr=xxx.xx.x.xx,file_mode=0755,dir_mode=0755,soft,nounix,serverino,mapposix,rsize=1048576,wsize=1048576,bsize=65536,echo_interval=60,actimeo=1)

Kernel and package version

+-----------+-----------------------------+-----------------------------+
|   prop    |          CentOS 7           |          centOS 8           |
+-----------+-----------------------------+-----------------------------+
| kernel    | 3.10.0-1127.18.2.el7.x86_64 | 4.18.0-147.8.1.el8_1.x86_64 |
| cifs-util | 6.2-10.el7                  | 6.8-3.el8                   |
+-----------+-----------------------------+-----------------------------+

Here is the exact sequence leading to the error on CentOS 8, with cifs debug enabled:

[Thu Oct 22 10:04:58 2020] fs/cifs/dir.c: name: data
[Thu Oct 22 10:04:58 2020] fs/cifs/dir.c: name: data
[Thu Oct 22 10:04:58 2020] fs/cifs/inode.c: Update attributes: data inode 0x00000000bc98fea9 count 1 dentry: 0x00000000bd47d1e0 d_time 15148690417 jiffies 15179170239
[Thu Oct 22 10:04:58 2020] fs/cifs/inode.c: Getting info on data
[Thu Oct 22 10:04:58 2020] fs/cifs/smb2ops.c: set credits to 1 due to smb2 reconnect
[Thu Oct 22 10:04:58 2020] fs/cifs/misc.c: Null buffer passed to cifs_small_buf_release
[Thu Oct 22 10:04:58 2020] fs/cifs/smb2pdu.c: In echo request
[Thu Oct 22 10:04:58 2020] fs/cifs/smb2pdu.c: Need negotiate, reconnecting tcons
[Thu Oct 22 10:04:58 2020] fs/cifs/smb2pdu.c: Negotiate protocol
[Thu Oct 22 10:04:58 2020] fs/cifs/transport.c: Sending smb: smb_len=106
[Thu Oct 22 10:04:58 2020] fs/cifs/smb2pdu.c: Negotiate protocol
[Thu Oct 22 10:04:58 2020] fs/cifs/connect.c: RFC1002 header 0xf8
[Thu Oct 22 10:04:58 2020] fs/cifs/smb2misc.c: SMB2 data length 120 offset 128
[Thu Oct 22 10:04:58 2020] fs/cifs/smb2misc.c: SMB2 len 248
[Thu Oct 22 10:04:58 2020] fs/cifs/transport.c: cifs_sync_mid_result: cmd=0 mid=0 state=4
[Thu Oct 22 10:04:58 2020] fs/cifs/misc.c: Null buffer passed to cifs_small_buf_release
[Thu Oct 22 10:04:58 2020] fs/cifs/smb2pdu.c: mode 0x1
[Thu Oct 22 10:04:58 2020] fs/cifs/smb2pdu.c: negotiated smb3.0 dialect
[Thu Oct 22 10:04:58 2020] fs/cifs/asn1.c: OID len = 10 oid = 0x1 0x3 0x6 0x1
[Thu Oct 22 10:04:58 2020] fs/cifs/asn1.c: OID len = 7 oid = 0x1 0x2 0x348 0xbb92
[Thu Oct 22 10:04:58 2020] fs/cifs/asn1.c: OID len = 7 oid = 0x1 0x2 0x348 0x1bb92
[Thu Oct 22 10:04:58 2020] fs/cifs/asn1.c: OID len = 8 oid = 0x1 0x2 0x348 0x1bb92
[Thu Oct 22 10:04:58 2020] fs/cifs/asn1.c: OID len = 10 oid = 0x1 0x3 0x6 0x1
[Thu Oct 22 10:04:58 2020] fs/cifs/connect.c: Security Mode: 0x1 Capabilities: 0x300067 TimeAdjust: 0
[Thu Oct 22 10:04:58 2020] fs/cifs/connect.c: Free previous auth_key.response = 00000000a46e9e42
[Thu Oct 22 10:04:58 2020] fs/cifs/smb2pdu.c: Session Setup
[Thu Oct 22 10:04:58 2020] fs/cifs/smb2pdu.c: sess setup type 4
[Thu Oct 22 10:04:58 2020] fs/cifs/transport.c: Sending smb: smb_len=124
[Thu Oct 22 10:04:58 2020] fs/cifs/connect.c: Received no data or error: -104
[Thu Oct 22 10:04:58 2020] fs/cifs/connect.c: cifs_reconnect: will retry 0 target(s)
[Thu Oct 22 10:04:58 2020] fs/cifs/connect.c: Mark tcp session as need reconnect
[Thu Oct 22 10:04:58 2020] fs/cifs/connect.c: cifs_reconnect: marking sessions and tcons for reconnect
[Thu Oct 22 10:04:58 2020] fs/cifs/connect.c: cifs_reconnect: tearing down socket
[Thu Oct 22 10:04:58 2020] fs/cifs/connect.c: State: 0x3 Flags: 0x0
[Thu Oct 22 10:04:58 2020] fs/cifs/connect.c: Post shutdown state: 0x3 Flags: 0x0
[Thu Oct 22 10:04:58 2020] fs/cifs/connect.c: cifs_reconnect: moving mids to private list
[Thu Oct 22 10:04:58 2020] fs/cifs/connect.c: cifs_reconnect: issuing mid callbacks
[Thu Oct 22 10:04:58 2020] fs/cifs/connect.c: Socket created
[Thu Oct 22 10:04:58 2020] fs/cifs/connect.c: sndbuf 16384 rcvbuf 87380 rcvtimeo 0x1b58
[Thu Oct 22 10:04:58 2020] fs/cifs/transport.c: cifs_sync_mid_result: cmd=1 mid=0 state=8
[Thu Oct 22 10:04:58 2020] fs/cifs/misc.c: Null buffer passed to cifs_small_buf_release
[Thu Oct 22 10:04:58 2020] CIFS VFS: Send error in SessSetup = -11
[Thu Oct 22 10:04:58 2020] fs/cifs/connect.c: cifs_put_tcon: tc_count=2
[Thu Oct 22 10:04:58 2020] fs/cifs/smb2ops.c: set credits to 1 due to smb2 reconnect
[Thu Oct 22 10:04:58 2020] fs/cifs/smb2pdu.c: In echo request
[Thu Oct 22 10:05:09 2020] fs/cifs/smb2pdu.c: Negotiate protocol
[Thu Oct 22 10:05:09 2020] fs/cifs/transport.c: Sending smb: smb_len=106
[Thu Oct 22 10:05:09 2020] fs/cifs/connect.c: RFC1002 header 0xf8
[Thu Oct 22 10:05:09 2020] fs/cifs/smb2misc.c: SMB2 data length 120 offset 128
[Thu Oct 22 10:05:09 2020] fs/cifs/smb2misc.c: SMB2 len 248
[Thu Oct 22 10:05:09 2020] fs/cifs/transport.c: cifs_sync_mid_result: cmd=0 mid=0 state=4
[Thu Oct 22 10:05:09 2020] fs/cifs/misc.c: Null buffer passed to cifs_small_buf_release
[Thu Oct 22 10:05:09 2020] fs/cifs/smb2pdu.c: mode 0x1
[Thu Oct 22 10:05:09 2020] fs/cifs/transport.c: Sending smb: smb_len=106
[Thu Oct 22 10:05:09 2020] fs/cifs/smb2pdu.c: negotiated smb3.0 dialect
[Thu Oct 22 10:05:09 2020] fs/cifs/asn1.c: OID len = 10 oid = 0x1 0x3 0x6 0x1
[Thu Oct 22 10:05:09 2020] fs/cifs/asn1.c: OID len = 7 oid = 0x1 0x2 0x348 0xbb92
[Thu Oct 22 10:05:09 2020] fs/cifs/asn1.c: OID len = 7 oid = 0x1 0x2 0x348 0x1bb92
[Thu Oct 22 10:05:09 2020] fs/cifs/asn1.c: OID len = 8 oid = 0x1 0x2 0x348 0x1bb92
[Thu Oct 22 10:05:09 2020] fs/cifs/asn1.c: OID len = 10 oid = 0x1 0x3 0x6 0x1
[Thu Oct 22 10:05:09 2020] fs/cifs/connect.c: Security Mode: 0x1 Capabilities: 0x300067 TimeAdjust: 0
[Thu Oct 22 10:05:09 2020] fs/cifs/smb2pdu.c: Session Setup
[Thu Oct 22 10:05:09 2020] fs/cifs/smb2pdu.c: sess setup type 4
[Thu Oct 22 10:05:09 2020] fs/cifs/connect.c: Received no data or error: -104
[Thu Oct 22 10:05:09 2020] fs/cifs/connect.c: cifs_reconnect: will retry 0 target(s)
[Thu Oct 22 10:05:09 2020] fs/cifs/connect.c: Mark tcp session as need reconnect
[Thu Oct 22 10:05:09 2020] fs/cifs/connect.c: cifs_reconnect: marking sessions and tcons for reconnect
[Thu Oct 22 10:05:09 2020] fs/cifs/connect.c: cifs_reconnect: tearing down socket
[Thu Oct 22 10:05:09 2020] fs/cifs/connect.c: State: 0x3 Flags: 0x0
[Thu Oct 22 10:05:09 2020] fs/cifs/connect.c: Post shutdown state: 0x3 Flags: 0x0
[Thu Oct 22 10:05:09 2020] fs/cifs/connect.c: cifs_reconnect: moving mids to private list
[Thu Oct 22 10:05:09 2020] fs/cifs/connect.c: cifs_reconnect: issuing mid callbacks
[Thu Oct 22 10:05:09 2020] fs/cifs/transport.c: cifs_sync_mid_result: cmd=0 mid=1 state=8
[Thu Oct 22 10:05:09 2020] fs/cifs/misc.c: Null buffer passed to cifs_small_buf_release
[Thu Oct 22 10:05:09 2020] fs/cifs/connect.c: Socket created
[Thu Oct 22 10:05:09 2020] fs/cifs/connect.c: sndbuf 16384 rcvbuf 87380 rcvtimeo 0x1b58
[Thu Oct 22 10:05:09 2020] fs/cifs/misc.c: Null buffer passed to cifs_small_buf_release
[Thu Oct 22 10:05:09 2020] fs/cifs/inode.c: CIFS VFS: leaving cifs_revalidate_dentry_attr (xid = 35385880) rc = -112
[Thu Oct 22 10:05:09 2020] fs/cifs/inode.c: CIFS VFS: in cifs_revalidate_dentry_attr as Xid: 35385881 with uid: 1004

Windows server is a windows 2016 server. The only logs that appears on this server at the same time are these:

<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
   <System>
      <Provider Name="Service Control Manager" Guid="{555908d1-a6d7-4695-8e1e-26931d2012f4}" EventSourceName="Service Control Manager" />
      <EventID Qualifiers="16384">7036</EventID>
      <Version>0</Version>
      <Level>4</Level>
      <Task>0</Task>
      <Opcode>0</Opcode>
      <Keywords>0x8080000000000000</Keywords>
      <TimeCreated SystemTime="2020-10-16T10:42:59.636088900Z" />
      <Channel>System</Channel>
      <Computer>XXX.xxx.xxx</Computer>
   </System>
   <EventData>
      <Data Name="param1">Connection Assistant with a Microsoft account</Data>
      <Data Name="param2">stopped</Data>
      <Binary>77006C00690064007300760063002F0031000000</Binary>
   </EventData>
</Event>

<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
   <System>
      <Provider Name="Service Control Manager" Guid="{555908d1-a6d7-4695-8e1e-26931d2012f4}" EventSourceName="Service Control Manager" />
      <EventID Qualifiers="16384">7036</EventID>
      <Version>0</Version>
      <Level>4</Level>
      <Task>0</Task>
      <Opcode>0</Opcode>
      <Keywords>0x8080000000000000</Keywords>
      <TimeCreated SystemTime="2020-10-16T10:42:20.692575900Z" />
      <Channel>System</Channel>
      <Computer>XXX.xxx.xxx</Computer>
   </System>
   <EventData>
      <Data Name="param1">Client licenses service (ClipSVC)</Data>
      <Data Name="param2">stopped</Data>
      <Binary>43006C00690070005300560043002F0031000000</Binary>
   </EventData>
</Event>

After looking at open sessions in windows server, we noticed that user sessions from centOS 8 are automatically disconnected every 30 minutes, whereas user session from centOS 7 are note disconnected


Get this bounty!!!

#StackBounty: #linux #bash #centos #python3 #sqlite ModuleNotFoundError: No module named '_sqlite3'

Bounty: 50

We have different python version installed and specifically using python3.7 so I have edited my .bashrc file. We are using Centos7 with Linux server.

# .bashrc

# Source global definitions
if [ -f /etc/bashrc ]; then
        . /etc/bashrc
fi

# Uncomment the following line if you don't like systemctl's auto-paging feature:
# export SYSTEMD_PAGER=
# User specific aliases and functions
alias python=python3.7
alias pip=pip3.7


[xyz@innolx20122 ~]$ python
python             python2.7          python3.6          python3.7          python3.7m-config
python2            python3            python3.6m         python3.7m

[xyz@innolx20122 ~]$ which sqlite3
/usr/bin/sqlite3

Its working with python2.7 and python3.6 version

[xyz@innolx20122 ~]$ python2.7
Python 2.7.5 (default, Apr  2 2020, 13:16:51)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sqlite3

[xyz@innolx20122 ~]$ python3.6
Python 3.6.8 (default, Apr  2 2020, 13:34:55)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sqlite3

It’s not working with python3.7 version

[xyz@innolx20122 ~]$ python3.7
Python 3.7.0 (default, Sep  3 2020, 09:25:25)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sqlite3
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.7/sqlite3/__init__.py", line 23, in <module>
    from sqlite3.dbapi2 import *
  File "/usr/local/lib/python3.7/sqlite3/dbapi2.py", line 27, in <module>
    from _sqlite3 import *
ModuleNotFoundError: No module named '_sqlite3'

Update-

We installed python following instruction in the below link
Python3.7 installation link

Hence my python3.7 version is installed at root level

[root@innolx20122 ~]# ls
anaconda-ks.cfg  Python-3.7.0  Python-3.7.0.tgz
[root@innolx20122 ~]# cd Python-3.7.0
[root@innolx20122 Python-3.7.0]# ls
aclocal.m4    config.status  Doc         Lib              Mac              Misc     PC              pyconfig.h     python-config     setup.py
build         config.sub     Grammar     libpython3.7m.a  Makefile         Modules  PCbuild         pyconfig.h.in  python-config.py  Tools
config.guess  configure      Include     LICENSE          Makefile.pre     Objects  Programs        python         python-gdb.py
config.log    configure.ac   install-sh  m4               Makefile.pre.in  Parser   pybuilddir.txt  Python         README.rst

I saw one link on stack overflow suggesting some workaround.
fix Sqlite3 issue

Kindly suggest if it’s ok to run below commands from same root directory itself

yum install sqlite-devel

./configure
make && make altinstall


Get this bounty!!!

#StackBounty: #linux #bash #centos #python3 #sqlite ModuleNotFoundError: No module named '_sqlite3'

Bounty: 50

We have different python version installed and specifically using python3.7 so I have edited my .bashrc file. We are using Centos7 with Linux server.

# .bashrc

# Source global definitions
if [ -f /etc/bashrc ]; then
        . /etc/bashrc
fi

# Uncomment the following line if you don't like systemctl's auto-paging feature:
# export SYSTEMD_PAGER=
# User specific aliases and functions
alias python=python3.7
alias pip=pip3.7


[xyz@innolx20122 ~]$ python
python             python2.7          python3.6          python3.7          python3.7m-config
python2            python3            python3.6m         python3.7m

[xyz@innolx20122 ~]$ which sqlite3
/usr/bin/sqlite3

Its working with python2.7 and python3.6 version

[xyz@innolx20122 ~]$ python2.7
Python 2.7.5 (default, Apr  2 2020, 13:16:51)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sqlite3

[xyz@innolx20122 ~]$ python3.6
Python 3.6.8 (default, Apr  2 2020, 13:34:55)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sqlite3

It’s not working with python3.7 version

[xyz@innolx20122 ~]$ python3.7
Python 3.7.0 (default, Sep  3 2020, 09:25:25)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sqlite3
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.7/sqlite3/__init__.py", line 23, in <module>
    from sqlite3.dbapi2 import *
  File "/usr/local/lib/python3.7/sqlite3/dbapi2.py", line 27, in <module>
    from _sqlite3 import *
ModuleNotFoundError: No module named '_sqlite3'

Update-

We installed python following instruction in the below link
Python3.7 installation link

Hence my python3.7 version is installed at root level

[root@innolx20122 ~]# ls
anaconda-ks.cfg  Python-3.7.0  Python-3.7.0.tgz
[root@innolx20122 ~]# cd Python-3.7.0
[root@innolx20122 Python-3.7.0]# ls
aclocal.m4    config.status  Doc         Lib              Mac              Misc     PC              pyconfig.h     python-config     setup.py
build         config.sub     Grammar     libpython3.7m.a  Makefile         Modules  PCbuild         pyconfig.h.in  python-config.py  Tools
config.guess  configure      Include     LICENSE          Makefile.pre     Objects  Programs        python         python-gdb.py
config.log    configure.ac   install-sh  m4               Makefile.pre.in  Parser   pybuilddir.txt  Python         README.rst

I saw one link on stack overflow suggesting some workaround.
fix Sqlite3 issue

Kindly suggest if it’s ok to run below commands from same root directory itself

yum install sqlite-devel

./configure
make && make altinstall


Get this bounty!!!

#StackBounty: #linux #bash #centos #python3 #sqlite ModuleNotFoundError: No module named '_sqlite3'

Bounty: 50

We have different python version installed and specifically using python3.7 so I have edited my .bashrc file. We are using Centos7 with Linux server.

# .bashrc

# Source global definitions
if [ -f /etc/bashrc ]; then
        . /etc/bashrc
fi

# Uncomment the following line if you don't like systemctl's auto-paging feature:
# export SYSTEMD_PAGER=
# User specific aliases and functions
alias python=python3.7
alias pip=pip3.7


[xyz@innolx20122 ~]$ python
python             python2.7          python3.6          python3.7          python3.7m-config
python2            python3            python3.6m         python3.7m

[xyz@innolx20122 ~]$ which sqlite3
/usr/bin/sqlite3

Its working with python2.7 and python3.6 version

[xyz@innolx20122 ~]$ python2.7
Python 2.7.5 (default, Apr  2 2020, 13:16:51)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sqlite3

[xyz@innolx20122 ~]$ python3.6
Python 3.6.8 (default, Apr  2 2020, 13:34:55)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sqlite3

It’s not working with python3.7 version

[xyz@innolx20122 ~]$ python3.7
Python 3.7.0 (default, Sep  3 2020, 09:25:25)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sqlite3
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.7/sqlite3/__init__.py", line 23, in <module>
    from sqlite3.dbapi2 import *
  File "/usr/local/lib/python3.7/sqlite3/dbapi2.py", line 27, in <module>
    from _sqlite3 import *
ModuleNotFoundError: No module named '_sqlite3'

Update-

We installed python following instruction in the below link
Python3.7 installation link

Hence my python3.7 version is installed at root level

[root@innolx20122 ~]# ls
anaconda-ks.cfg  Python-3.7.0  Python-3.7.0.tgz
[root@innolx20122 ~]# cd Python-3.7.0
[root@innolx20122 Python-3.7.0]# ls
aclocal.m4    config.status  Doc         Lib              Mac              Misc     PC              pyconfig.h     python-config     setup.py
build         config.sub     Grammar     libpython3.7m.a  Makefile         Modules  PCbuild         pyconfig.h.in  python-config.py  Tools
config.guess  configure      Include     LICENSE          Makefile.pre     Objects  Programs        python         python-gdb.py
config.log    configure.ac   install-sh  m4               Makefile.pre.in  Parser   pybuilddir.txt  Python         README.rst

I saw one link on stack overflow suggesting some workaround.
fix Sqlite3 issue

Kindly suggest if it’s ok to run below commands from same root directory itself

yum install sqlite-devel

./configure
make && make altinstall


Get this bounty!!!

#StackBounty: #centos #dns #hosts Device or resource busy – getaddrinfo

Bounty: 50

I’m on a CentOS 7 VM running PG, MariaDB, sidekiq and apache httpd. Sometimes my logs are spammed with errors such as:

unable to resolve address: System error

WARN: Mysql2::Error::ConnectionError: Unknown MySQL server host 'mariadb' (16)

WARN: PG::ConnectionBad: could not translate host name "postgres" to address: System error

WARN -- : Unable to record event with remote Sentry server (Errno::EBUSY - Failed to open TCP connection to o383708.ingest.sentry.io:443 (Device or resource busy - getaddrinfo)):

All these hosts (except the sentry service) are set to 127.0.0.1 in my /etc/hosts file.

Pinging the host names appears to work from the console, these errors pop up in various application logs during runtime.

lsof | wc -l => 700k (max 1.6M)

The VM is under no significant load (10% load average). No attacks or rootkits or anything like that.

My hosts file:

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

127.0.0.1 mariadb
127.0.0.1 postgres
127.0.0.1 mongodb
127.0.0.1 redis
127.0.0.1 memcached
127.0.0.1 socketcluster

Anyone know what’s going on? Why can’t getaddrinfo open the hosts file???

Adding a bounty to this question. Please no freeloading.


Get this bounty!!!

#StackBounty: #centos #vnc Unable to connect to CentOS 7/8 Screen Sharing (VNC) over work VPN

Bounty: 50

As with most people, we’re WFH. It’s getting difficult to troubleshoot issues via chat/phone, so we’d like to use the CentOS "Screen Sharing" feature, which comes bundled with the OS, to allow support personnel to connect to user machine’s to assist with their issues. The support personnel will also used to built in client vinagre with VNC selected as the connection type.

All users are connected to a VPN that is configured to allow internal hosts to communicate with one another. We can ping other hosts, view services they’re running, etc. Here is my machine’s Screen Share settings.

Screen Sharing settings window

When I look at netstat, I see port 5900 is listening on tcp6. I considered the issue was the underlying VNC server was listening on IPv6 when every hosts IPv4 interface is set as the default connection, but I recall reading somewhere that tcp6 connections map to tcp4 connections, so it’s supposedly a non-issue. Here’s my netstat output:

$ sudo netstat -nlt 
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State      
tcp        0      0 0.0.0.0:5355            0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN     
tcp        0      0 192.168.122.1:53        0.0.0.0:*               LISTEN     
tcp        0      0 127.0.0.1:10391         0.0.0.0:*               LISTEN     
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN     
tcp        0      0 127.0.0.1:29754         0.0.0.0:*               LISTEN     
tcp6       0      0 :::5355                 :::*                    LISTEN     
tcp6       0      0 :::5900                 :::*                    LISTEN     
tcp6       0      0 :::111                  :::*                    LISTEN     
tcp6       0      0 ::1:631                 :::*                    LISTEN     
tcp6       0      0 :::9090                 :::*                    LISTEN    

I considered it was the firewall, but both my machine and the client machine have firewalld disabled.

Here is the output of nmcli to show the settings of Wired Connection 1

enp57s0u1: connected to Wired connection 1
    "Realtek RTL8153"
    ethernet (r8152), 8C:04:BA:67:52:16, hw, mtu 1500
    ip4 default
    inet4 192.168.1.123/24
    route4 0.0.0.0/0
    route4 192.168.1.0/24
    inet6 fe80::xxxx:xxxx:xxxx:xxxx/64
    route6 fe80::/64
    route6 ff00::/8

Finally, I tested enabling SSH and it worked. Users were able to connect and were prompted to authenticate (we didn’t have them actually log-in). This leads me to believe it’s an issue with the underlying VNC server itself, something maybe related to it listening on tcp6 above?

Any idea what the issue may be?


Get this bounty!!!

#StackBounty: #centos #networking #docker #bridge #plesk Connecting to docker bridged container on CentOS 7 gives: Connection reset by …

Bounty: 50

As the title says I have a docker image which runs fine on my development machine in docker using network bridged to an another port (-p 8080:5000). But as soon as I am deploying this on my server connections fail.

-> Ruling out not hosting the application on 0.0.0.0:5000 IP’s.

When using --network host the images do run fine.

I would like to use the Plesk docker extension. The only supported behaviour in here is using the docker bridge network.

This server is running

  • Plesk => docker extension
  • CentOS 7

I did have some issues with the firewall settings (There are 2 active firewalls: firewalld and the Plesk Firewall). But the issue persists when both are disabled.

-> Ruling out firewall zone trust issues.

The last answer which came up while searching is a collision in network interface IP ranges..? But I have a simple setup with a single interface eth0 (public IP), local loopback and docker0.

What could be wrong here? Any ideas how to troubleshoot this further? I am out after many hours spent researching this issue.

Thanks!

> docker ps

CONTAINER ID        IMAGE                        COMMAND                  CREATED             STATUS              PORTS                    NAMES
8c3d3f32b8ef        savahdevelopment/savah_api   "dotnet savah_api.dll"   11 minutes ago      Up 11 minutes       0.0.0.0:8888->5000/tcp   sharp_lamarr

b355e8fef0ec        savahdevelopment/savah_api   "dotnet savah_api.dll"   7 hours ago         Up 14 minutes                                savah_api_prod

e38e1b01b039        savahdevelopment/savah_api   "dotnet savah_api.dll"   7 hours ago         Up 14 minutes                                savah_api_dev

> curl http://something.hostbeter.nl:5000/admin/test
YUUUUUUUUUUUUUUP!!

> curl http://something.hostbeter.nl:5100/admin/test
YUUUUUUUUUUUUUUP!!

> curl http://something.hostbeter.nl:8888/admin/test
curl: (56) Recv failure: Connection reset by peer

Some extra info:

netstat -tulp tells me the working containers did bind to the IPv6 addresses only. But connecting externally with the IPv4 works fine? So it seems to be something network related?


Get this bounty!!!