WAPT 1.3 to 1.5 Migration Error

Questions about WAPT Server / Requests and help related to the WAPT server
Forum Rules
Community Forum Rules
* English support on www.reddit.com/r/wapt
* French community support is available on this forum
* Please prefix the topic title with [RESOLVED] if it is resolved.
* Please do not edit a topic that is tagged [RESOLVED]. Open a new topic referencing the old one.
* Specify the installed WAPT version, full version, and build number (2.2.1.11957 / 2.2.2.12337 / etc.) as well as the Enterprise/Discovery edition.
* Versions 1.8.2 and earlier are no longer supported. The only questions accepted regarding version 1.8.2 are related to upgrading to a supported version (2.1, 2.2, etc.).
* Specify the server OS (Linux/Windows) and version (Debian Buster/Bullseye - CentOS 7 - Windows Server 2012/2016/2019).
* Specify the OS of the administration/package creation machine and the machine with the problematic agent, if applicable (Windows 7/10/11/Debian 11/etc.).
* Avoid asking multiple questions when opening a topic, otherwise it may be ignored. If there are multiple topics, open separate topics, preferably one after the other and not all at the same time (i.e., do not spam the forum).
* Include code snippets, screenshots, and other images directly in the post. Links to Pastebin, Bitly, and other third-party sites will be systematically removed.
* As with any community forum, support is provided voluntarily by members. If you require commercial support, you can contact Tranquil IT's sales department at 02.40.97.57.55
tech62
Messages: 21
Registration: December 8, 2017 - 1:40 PM

December 12, 2017 - 11:55

I performed an apt-get remove / update / clean / install again, but the error is still present.
I use this repository:

Code: Select all

deb  https://wapt.tranquil.it/debian/wapt-1.5/ stretch main
Is this the right deposit?

EDIT: Apparently, this is the right one

Code: Select all

Préparation du dépaquetage de .../tis-waptserver_1.5.1.9-tisdeb9-4425-ef7b7b4b_amd64.deb
The version corresponds to the one previously indicated in the topic (nightly build)

But the error is still there

Code: Select all

2017-12-12T12:07:36.536+0100    connected to: 127.0.0.1
2017-12-12T12:07:36.603+0100    exported 6 records
WARNING:root:Traceback (most recent call last):
  File "/opt/wapt/waptserver/waptserver_model.py", line 424, in update_host_data
    existing = Hosts.select(Hosts.uuid, Hosts.computer_fqdn).where(Hosts.uuid == uuid).first()
  File "/opt/wapt/lib/site-packages/peewee.py", line 4941, in select
    query = SelectQuery(cls, *selection)
  File "/opt/wapt/lib/site-packages/peewee.py", line 3016, in __init__
    self.require_commit = self.database.commit_select
  File "/opt/wapt/lib/site-packages/peewee.py", line 439, in __getattr__
    raise AttributeError('Cannot use uninitialized Proxy.')
AttributeError: Cannot use uninitialized Proxy.

CRITICAL:root:Error updating data for [SECRET] : AttributeError: Cannot use uninitialized Proxy.
Traceback (most recent call last):
  File "/opt/wapt/waptserver/scripts/postconf.py", line 511, in <module>
    main()
  File "/opt/wapt/waptserver/scripts/postconf.py", line 338, in main
    mongo_update_status = check_mongo2pgsql_upgrade_needed(waptserver_ini)
  File "/opt/wapt/waptserver/scripts/postconf.py", line 241, in check_mongo2pgsql_upgrade_needed
    run_verbose("sudo -u wapt /usr/bin/python /opt/wapt/waptserver/waptserver_upgrade.py upgrade2postgres")
  File "/opt/wapt/waptserver/scripts/postconf.py", line 68, in run_verbose
    output = subprocess.check_output(*args, shell=True, **kwargs)
  File "/usr/lib/python2.7/subprocess.py", line 219, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command 'sudo -u wapt /usr/bin/python /opt/wapt/waptserver/waptserver_upgrade.py upgrade2postgres' returned non-zero exit status 1
tech62
Messages: 21
Registration: December 8, 2017 - 1:40 PM

December 13, 2017 - 3:06 PM

Up =)
tech62
Messages: 21
Registration: December 8, 2017 - 1:40 PM

December 14, 2017 - 11:37

Reinstallation of packages attempted with the updated version in the repository

Code: Select all

tis-waptXXX_1.5.1.10-tisdeb9-4448-a4bdc9c2
The error has evolved

Code: Select all

2017-12-14T11:34:12.303+0100    connected to: 127.0.0.1
2017-12-14T11:34:12.390+0100    exported 6 records
Traceback (most recent call last):
  File "/opt/wapt/waptserver/scripts/postconf.py", line 511, in <module>
    main()
  File "/opt/wapt/waptserver/scripts/postconf.py", line 338, in main
    mongo_update_status = check_mongo2pgsql_upgrade_needed(waptserver_ini)
  File "/opt/wapt/waptserver/scripts/postconf.py", line 241, in check_mongo2pgsql_upgrade_needed
    run_verbose("sudo -u wapt /usr/bin/python /opt/wapt/waptserver/waptserver_upgrade.py upgrade2postgres")
  File "/opt/wapt/waptserver/scripts/postconf.py", line 68, in run_verbose
    output = subprocess.check_output(*args, shell=True, **kwargs)
  File "/usr/lib/python2.7/subprocess.py", line 219, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command 'sudo -u wapt /usr/bin/python /opt/wapt/waptserver/waptserver_upgrade.py upgrade2postgres' returned non-zero exit status 1

Code: Select all

sudo -u wapt /usr/bin/python /opt/wapt/waptserver/waptserver_upgrade.py upgrade2postgres

Code: Select all

upgrading data from mongodb to postgresql
could not change directory to "/root": Permission non accordée
dumping mongodb data in /tmp/waptupgrade_20171214-Dec:50:1513248632.json
Read mongo data from 127.0.0.1...
2017-12-14T11:50:32.872+0100    connected to: 127.0.0.1
2017-12-14T11:50:32.940+0100    exported 6 records
6 records read.
File /tmp/waptupgrade_20171214-Dec:50:1513248632.json done.
Loading /tmp/waptupgrade_20171214-Dec:50:1513248632.json
6 recs to load
{'computer_fqdn': u'nomachine', 'uuid': u'uuidmachine'}
Traceback (most recent call last):
  File "/opt/wapt/waptserver/waptserver_upgrade.py", line 154, in upgrade2postgres
    load_json(filenames=data_import_filename)
  File "/opt/wapt/waptserver/waptserver_upgrade.py", line 99, in load_json
    uuid = rec.get('uuid', rec['wmi']['Win32_ComputerSystemProduct']['UUID'])
KeyError: 'wmi'
Exception while loading data, please check current configuration
tech62
Messages: 21
Registration: December 8, 2017 - 1:40 PM

December 19, 2017 - 10:21

No idea what the problem is? Bump!
User avatar
sfonteneau
WAPT Expert
Messages: 2318
Registered: July 10, 2014 - 11:52 PM
Contact :

December 19, 2017 - 2:38 PM

I'm watching

The problem seems to lie here:

Code: Select all

          uuid = rec.get('uuid', rec['wmi']['Win32_ComputerSystemProduct']['UUID'])

Is it possible for you to send us (privately) the contents of /var/lib/mongodb/

Stop MongoDB first!

You can send it to the address sfonteneau@tranquil.it

Simon
Tranquil it systems
tech62
Messages: 21
Registration: December 8, 2017 - 1:40 PM

December 19, 2017 - 2:48 PM

Hello, thanks for the reply!

Where is the default database stored? (json / bson / .db format?)

Edit: I ran a mongodump ;)
User avatar
dcardon
WAPT Expert
Messages: 1930
Registration: June 18, 2014 - 09:58
Location: Saint Sébastien sur Loire
Contact :

December 19, 2017 - 6:15 PM

Good evening tech62,

the script you ran that crashed must have created a file /tmp/waptupgrade_20171214-Dec:50:1513248632.json. You can send this file to Simon. However, it seems to only contain 6 hosts according to the logs; is it a test server? Otherwise, it would mean that the MongoDB export didn't work either...

Denis
Denis Cardon - Tranquil IT
Share your experiences on WAPT! Send us your blog and article URLs in the "Your Opinion of the forum, and we'll feature them on the WAPT
tech62
Messages: 21
Registration: December 8, 2017 - 1:40 PM

December 19, 2017 - 6:21 PM

I'll look into it and get back to you soon. The 6 workstations are normal; I was just starting to integrate the system. Things went wrong when I tried to upgrade to get the websocket functionality (to be able to deploy behind a NAT)
tech62
Messages: 21
Registration: December 8, 2017 - 1:40 PM

December 20, 2017 - 12:12

I did an update/install again last night and was able to install version 1.5, but now I get an HTTP code 1.1/404 from the administration console, however I can successfully remove/install packages from the machine:8088

from the address https://urlserveur/ping the result is positive on both internal and external networks.
tech62
Messages: 21
Registration: December 8, 2017 - 1:40 PM

December 21, 2017 - 5:33 PM

The latest releases from the repository have made the migration possible.
Now what remains is this bug
Initially, certificate verification was not active on my end, but a Wireshark query revealed that the agent attempted to contact the following during a `wapt-get register` command:

Code: Select all

_wapt-host._tcp.wapt.domaine.lan: type SRV, class IN
wapt-host.wapt.domaine.lan
wapt.wapt.domaine.lan
16:27:29.020990	DNS	192.168.1.1	53	192.168.1.101	59931	59931	59931	Standard query response 0xd256 No such name A wapt.wapt.domaine.lan SOA passerelle.domaine.lan	173
My agent configuration file:

Code: Select all

repo_url=https://wapt.domaine.lan/wapt
wapt_server=https://wapt.domain.lan
Since the URLs don't match, the agent is sending me back

Code: Select all

C:\WINDOWS\system32>wapt-get register
FATAL ERROR : Exception: Wapt server url not defined or not found in DNS
Thank you again for your attention to this issue!
Locked