Page 2 of 4

Re: WAPT 1.3 to 1.5 Migration Error

Published: Dec 12, 2017 - 11:55 AM
by tech62
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

Re: WAPT 1.3 to 1.5 Migration Error

Published: Dec 13, 2017 - 3:06 PM
by tech62
Up =)

Re: WAPT 1.3 to 1.5 Migration Error

Published: Dec 14, 2017 - 11:37
by tech62
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

Re: WAPT 1.3 to 1.5 Migration Error

Published: Dec 19, 2017 - 10:21
by tech62
No idea what the problem is? Bump!

Re: WAPT 1.3 to 1.5 Migration Error

Published: Dec 19, 2017 - 2:38 PM
by sfonteneau
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

Re: WAPT 1.3 to 1.5 Migration Error

Published: Dec 19, 2017 - 2:48 PM
by tech62
Hello, thanks for the reply!

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

Edit: I ran a mongodump ;)

Re: WAPT 1.3 to 1.5 Migration Error

Published: Dec 19, 2017 - 6:15 PM
by dcardon
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

Re: WAPT 1.3 to 1.5 Migration Error

Published: Dec 19, 2017 - 6:21 PM
by tech62
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)

Re: WAPT 1.3 to 1.5 Migration Error

Published: Dec 20, 2017 - 12:12
by tech62
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.

Re: WAPT 1.3 to 1.5 Migration Error

Published: Dec 21, 2017 - 5:33 PM
by tech62
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!