ERROR: 'NoneType' attribute 'db' when installing AS

Post Reply
Himea
OpenVpn Newbie
Posts: 5
Joined: Wed Jul 31, 2019 10:13 pm

ERROR: 'NoneType' attribute 'db' when installing AS

Post by Himea » Thu Aug 01, 2019 1:57 am

Hello,

I posted this in another section but I think they were giving me the hint to move it here :?

I'm trying to install OVPN-AS on my Ubuntu18.10 server, when I run DPKG I get the following errors:

Code: Select all

(Reading database ... 154923 files and directories currently installed.)
Preparing to unpack openvpn-as-latest-ubuntu18.amd_64.deb ...
Unpacking openvpn-as (2.7.4-777bcfe6-Ubuntu18) ...
Setting up openvpn-as (2.7.4-777bcfe6-Ubuntu18) ...
Regenerating etc openvpnas script...
writing systemd service to /etc/systemd/system/openvpnas.service
Created symlink /etc/systemd/system/multi-user.target.wants/openvpnas.service → /etc/systemd/system/openvpnas.service.
Regenerating startup/shutdown scripts...
Backing up configuration and DB files to /usr/local/openvpn_as/etc/backup prior to update.
ERROR: 'NoneType' object has no attribute 'db': util/options:79,db/confdb_admin:322,db/confdb:758,db/confdb:746,db/confdb:740 (exceptions.AttributeError)
ERROR: 'NoneType' object has no attribute 'db': util/options:79,db/confdb_admin:322,db/confdb:758,db/confdb:746,db/confdb:740 (exceptions.AttributeError)
ERROR: 'NoneType' object has no attribute 'db': util/options:79,db/confdb_admin:322,db/confdb:758,db/confdb:746,db/confdb:740 (exceptions.AttributeError)
Beginning with OpenVPN AS 2.6.0 compression is disabled by default and on upgrades as security patch.
ERROR: 'NoneType' object has no attribute 'db': util/options:79,db/confdb_admin:322,db/confdb:758,db/confdb:746,db/confdb:740 (exceptions.AttributeError)

Code: Select all

Linux user 4.18.0-25-generic #26-Ubuntu SMP Mon Jun 24 09:32:08 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
I don't have any conf files since I can't even get the program to install.

I checked the sha256sum of the downloaded file and it matches up, and I cleared out the apt and dpkg on my server, still having issues getting it to install. I installed net-tools and NTP and checked the timezone on dpkp. Is there some type of library or program I need to have?

I'm not the most experienced Linux user and I couldn't find any answers after a couple of hours practicing my Google-Fu. Can anyone give me some pointers on what might be causing this issue?

novaflash
I should be on the dev team.
Posts: 952
Joined: Fri Apr 13, 2012 8:43 pm

Re: ERROR: 'NoneType' attribute 'db' when installing AS

Post by novaflash » Thu Aug 01, 2019 9:13 am

Yeah, this is the right board for questions regarding OpenVPN Access Server.

I don't know why it fails for you. Ubuntu 18 is our platform of choice. A fresh install of this version should cause no problems at all. All our images for ESXi, HyperV, DigitalOcean, Azure, GCP, and AWS, are all on Ubuntu 18, and almost all of them run this exact version of our software.

My guess is there is something 'unique' about your particular Ubuntu 18 installation that is somehow breaking Access Server.

If you get in contact with our support department through the website, and are willing to go through a process of debugging, we might be able to find whatever is broken about your Ubuntu 18 installation, and try to find a workaround for it. If it is something that can be blamed on Access Server, then we'll work on creating a fix for it. But given the extensive history and tests done on Ubuntu 18, I'm leaning heavily towards 'something' being off on your Ubuntu 18 installation.

Rajie
OpenVpn Newbie
Posts: 1
Joined: Thu Aug 01, 2019 1:11 pm

Re: ERROR: 'NoneType' attribute 'db' when installing AS

Post by Rajie » Thu Aug 01, 2019 1:12 pm

Hi,
I get the same error on Debian.
Preparing to unpack openvpn-as-2.7.4-Debian9.amd_64.deb ...
Unpacking openvpn-as (2.7.4-777bcfe6-Debian9) ...
Setting up openvpn-as (2.7.4-777bcfe6-Debian9) ...
Automatic configuration failed, see /usr/local/openvpn_as/init.log
You can configure manually using the /usr/local/openvpn_as/bin/ovpn-init tool.
Beginning with OpenVPN AS 2.6.0 compression is disabled by default and on upgrades as security patch.
ERROR: 'NoneType' object has no attribute 'db': util/options:79,db/confdb_admin:322,db/confdb:758,db/confdb:746,db/confdb:740 (exceptions.AttributeError)

novaflash
I should be on the dev team.
Posts: 952
Joined: Fri Apr 13, 2012 8:43 pm

Re: ERROR: 'NoneType' attribute 'db' when installing AS

Post by novaflash » Thu Aug 01, 2019 3:24 pm

I can assure you that these packages install without errors on standard and expert installs of Debian 9 and Ubuntu 18. There is something wrong with your environment that we do not understand yet, and only debugging your environment sensibly will lead to a resolution. There may be something missing on your environment that is present by default on ordinary Debian 9 and Ubuntu 18 environments. To me it seems likely that there is simply something vital missing, something that got stripped out by whoever prepared/installed this Linux OS. Again I would urge you to contact support to work with them to figure out what exactly is missing.

Himea
OpenVpn Newbie
Posts: 5
Joined: Wed Jul 31, 2019 10:13 pm

Re: ERROR: 'NoneType' attribute 'db' when installing AS

Post by Himea » Sun Aug 04, 2019 5:19 am

novaflash wrote:
Thu Aug 01, 2019 9:13 am
Yeah, this is the right board for questions regarding OpenVPN Access Server.

I don't know why it fails for you. Ubuntu 18 is our platform of choice. A fresh install of this version should cause no problems at all. All our images for ESXi, HyperV, DigitalOcean, Azure, GCP, and AWS, are all on Ubuntu 18, and almost all of them run this exact version of our software.

My guess is there is something 'unique' about your particular Ubuntu 18 installation that is somehow breaking Access Server.

If you get in contact with our support department through the website, and are willing to go through a process of debugging, we might be able to find whatever is broken about your Ubuntu 18 installation, and try to find a workaround for it. If it is something that can be blamed on Access Server, then we'll work on creating a fix for it. But given the extensive history and tests done on Ubuntu 18, I'm leaning heavily towards 'something' being off on your Ubuntu 18 installation.
Thanks for the help. I'm the type who likes to determine why something isn't working as it should be - I figure reinstalling the OS will likely solve the problem but I want to determine how I got to the point where it won't install so it doesn't happen again. I'll keep troubleshooting and see if I can figure it out.

novaflash
I should be on the dev team.
Posts: 952
Joined: Fri Apr 13, 2012 8:43 pm

Re: ERROR: 'NoneType' attribute 'db' when installing AS

Post by novaflash » Sun Aug 04, 2019 9:31 am

Okay, that's your choice. Good luck, and please let us know what you found in your system that is the difference between failure and success. You can use a command like dpkg -l to list all packages installed on a debian/ubuntu system, so you can compare between a 'normal' system and the system that fails. Also check if you're using the standard kernel, or if it is a custom compiled static kernel, as that last type is not supported because it can't load necessary modules.

zuliasro
OpenVpn Newbie
Posts: 1
Joined: Thu Jul 06, 2017 6:57 pm

Re: ERROR: 'NoneType' attribute 'db' when installing AS

Post by zuliasro » Mon Aug 05, 2019 9:32 pm

Hi all,

Same issue under Debian 10:

Code: Select all

root@oxnard:~# dpkg -i openvpn-as-latest-debian9.amd_64.deb
Selecting previously unselected package openvpn-as.
(Reading database ... 34910 files and directories currently installed.)
Preparing to unpack openvpn-as-latest-debian9.amd_64.deb ...
Unpacking openvpn-as (2.7.4-777bcfe6-Debian9) ...
Setting up openvpn-as (2.7.4-777bcfe6-Debian9) ...
Automatic configuration failed, see /usr/local/openvpn_as/init.log
You can configure manually using the /usr/local/openvpn_as/bin/ovpn-init tool.
Beginning with OpenVPN AS 2.6.0 compression is disabled by default and on upgrades as security patch.
ERROR: 'NoneType' object has no attribute 'db': util/options:79,db/confdb_admin:322,db/confdb:758,db/confdb:746,db/confdb:740 (exceptions.AttributeError)
root@oxnard:~# 
From the init.log file (last few lines...):

Code: Select all

Initializing OpenVPN...
Removing Cluster Admin user login...
userdel "admin_c"
Adding new user login...
useradd -s /sbin/nologin "openvpn"
Writing as configuration file...
Perform sa init...
Error: Could not initialize sa.
root@oxnard:~# 
It's a "brand new" VPS, after update/upgrade/restart.
Any help please?

novaflash
I should be on the dev team.
Posts: 952
Joined: Fri Apr 13, 2012 8:43 pm

Re: ERROR: 'NoneType' attribute 'db' when installing AS

Post by novaflash » Tue Aug 06, 2019 8:28 am

Contact technical support on our website. Really.

What kind of VPS is this - what provider is this? The problem is with the software that comes with this VPS, it is non-standard. It is not a standard Debian 10 installation. Something has been ripped out.

mharcek
OpenVpn Newbie
Posts: 1
Joined: Tue Aug 06, 2019 11:54 am

Re: ERROR: 'NoneType' attribute 'db' when installing AS

Post by mharcek » Tue Aug 06, 2019 11:59 am

Hi,

try running /usr/local/openvpn_as/scripts/sa . There is a chance that some libraries are missing in your install. For me it was libncurses5.
If this is the case install those libraries and then recreate config again using /usr/local/openvpn_as/bin/ovpn-init or reinstall the package again.

novaflash
I should be on the dev team.
Posts: 952
Joined: Fri Apr 13, 2012 8:43 pm

Re: ERROR: 'NoneType' attribute 'db' when installing AS

Post by novaflash » Tue Aug 06, 2019 12:28 pm

Yeah if that was ripped out of Debian, that would cause a problem like that.

Himea
OpenVpn Newbie
Posts: 5
Joined: Wed Jul 31, 2019 10:13 pm

Re: ERROR: 'NoneType' attribute 'db' when installing AS

Post by Himea » Sat Aug 10, 2019 8:46 pm

--SOLUTION--

I tried running the /usr/local/openvpn_as/scripts/sa command and this is the result I got:

Code: Select all

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "build/bdist.linux-x86_64/egg/pyovpn/sagent/sagent_entry.py", line 57, in sa
  File "build/bdist.linux-x86_64/egg/pyovpn/sa/sacmd.py", line 2, in <module>
  File "build/bdist.linux-x86_64/egg/pyovpn/sa/sa.py", line 3, in <module>
  File "build/bdist.linux-x86_64/egg/pyovpn/db/db.py", line 3, in <module>
  File "/usr/local/openvpn_as/lib/python2.7/curses/__init__.py", line 15, in <module>
    from _curses import *
ImportError: libncurses.so.5: cannot open shared object file: No such file or directory
This prompted me to reinstall libncurses5 library using sudo apt-get install libncurses5
However, when attempting to install openvpn-as again, I still got the following error:

Code: Select all

(Reading database ... 158029 files and directories currently installed.)
Removing openvpn-as (2.7.4-777bcfe6-Ubuntu18) ...
Removing scripts...
Removed /etc/systemd/system/multi-user.target.wants/openvpnas.service.
Removing files ...
Removing custom users and groups...
userdel: openvpn_as mail spool (/var/mail/openvpn_as) not found
root@jinora:~# dpkg -i openvpn-as-latest-ubuntu18.amd_64.deb
Selecting previously unselected package openvpn-as.
(Reading database ... 154951 files and directories currently installed.)
Preparing to unpack openvpn-as-latest-ubuntu18.amd_64.deb ...
Unpacking openvpn-as (2.7.4-777bcfe6-Ubuntu18) ...
Setting up openvpn-as (2.7.4-777bcfe6-Ubuntu18) ...
Regenerating etc openvpnas script...
writing systemd service to /etc/systemd/system/openvpnas.service
Created symlink /etc/systemd/system/multi-user.target.wants/openvpnas.service → /etc/systemd/system/openvpnas.service.
Regenerating startup/shutdown scripts...
Backing up configuration and DB files to /usr/local/openvpn_as/etc/backup prior to update.
ERROR: 'NoneType' object has no attribute 'db': util/options:79,db/confdb_admin:322,db/confdb:758,db/confdb:746,db/confdb:740 (exceptions.AttributeError)
ERROR: 'NoneType' object has no attribute 'db': util/options:79,db/confdb_admin:322,db/confdb:758,db/confdb:746,db/confdb:740 (exceptions.AttributeError)
ERROR: 'NoneType' object has no attribute 'db': util/options:79,db/confdb_admin:322,db/confdb:758,db/confdb:746,db/confdb:740 (exceptions.AttributeError)
Beginning with OpenVPN AS 2.6.0 compression is disabled by default and on upgrades as security patch.
ERROR: 'NoneType' object has no attribute 'db': util/options:79,db/confdb_admin:322,db/confdb:758,db/confdb:746,db/confdb:740 (exceptions.AttributeError)
When running /usr/local/openvpn_as/scripts/sa again, this time I get the following result indicating to me that it at least has the correct libraries:

Code: Select all

sa: Wrong number of arguments.
SA tool 1.1
NOTE: This tool is intended for diagnostic usage only.
NOTE: Please use sacli for production usage.
Usage: sa [options] cmd [args...]
Commands:
  Init                           -> initialize DB, write server output files to dest_dir
  AddClient client_name          -> add client to DB, write client output files to dest_dir
  GetFiles client_name|'server'  -> write files associated with client or server to dest_dir
  DeleteClient client_name       -> delete client from DB
  ListClients                    -> list all clients in DB
  Dump                           -> dump DB
Options:
      --autologin   Don't require a username/password from this client
  -c, --comment=    Comment for AddClient (optional)
      --ca_cn=      CA certificate Common Name for Init [default: OpenVPN CA]
  -d, --db=         Certificate DB [default:
                    sqlite:////usr/local/openvpn_as/etc/db/certs.db]
  -e, --exp=        Days till cert expiration [default: 3650]
      --help        Display this help and exit.
  -l, --lic_dir=    License store directory [default:
                    /usr/local/openvpn_as/etc/licenses]
      --no_ovpn     Disable OpenVPN-specific functionality
  -o, --dest_dir=   Output directory for Init, AddClient, and GetFiles
  -p, --cert_pass=  Private key passphrase for AddClient (optional)
  -s, --keysize=    Key Size (1024 or 2048) for Init [default: 1024]
      --server_cn=  Server certificate Common Name for Init [default: OpenVPN
                    Server]
  -u, --user=       Username for AddClient
      --unique_ca   Append machine name and date/time to CA common name
      --version

Edit: I initially thought this meant that the install had still failed, however when running ovpn-init the setup worked and I now have access to the web server so I guess the missing libraries was the issue.

novaflash
I should be on the dev team.
Posts: 952
Joined: Fri Apr 13, 2012 8:43 pm

Re: ERROR: 'NoneType' attribute 'db' when installing AS

Post by novaflash » Sun Aug 11, 2019 10:40 am

Yeah, the libncurses5 library requirement is the issue. I believe we can find a solution in Access Server to either require it for installation or to do without it.

Post Reply