[RESOLVED] Version 1.3.13 to 1.6

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
Locked
James
Messages: 23
Registration: Sep 18, 2018 - 4:37 p.m.

September 25, 2018 - 4:38 PM

Hello,
I just tested the upgrade from version 1.3.13 to 1.6 and it's crashing during the migration of the MongoDB database to PostgreSQL. As a result, when I install the WAPT console, I no longer have my old machines... :(

https://framapic.org/gallery#D3y4xUzl1O ... s7pa74.PNG

Regards
User avatar
sfonteneau
WAPT Expert
Messages: 2318
Registered: July 10, 2014 - 11:52 PM
Contact :

September 25, 2018 - 5:12 PM

Oops, can you run:

Code: Select all

sudo -u wapt PYTHONPATH=/opt/wapt PYTHONHOME=/opt/wapt /opt/wapt/bin/python /opt/wapt/waptserver/upgrade.py upgrade2postgres -c "/opt/wapt/conf/waptserver.ini"'
James
Messages: 23
Registration: Sep 18, 2018 - 4:37 p.m.

September 25, 2018 - 6:34 PM

It works much better this way. :D
Will you make the change in a future version?
User avatar
sfonteneau
WAPT Expert
Messages: 2318
Registered: July 10, 2014 - 11:52 PM
Contact :

September 25, 2018 - 6:48 PM

Exactly
iutlps-informatique
Messages: 2
Registration: Oct 25, 2018 - 12:31

October 25, 2018 - 12:37

Good morning

I also had a problem during the database migration with the postconf.sh script.

So I tried the command you indicated, namely:

Code: Select all

sudo -u wapt PYTHONPATH=/opt/wapt PYTHONHOME=/opt/wapt /opt/wapt/bin/python /opt/wapt/waptserver/upgrade.py upgrade2postgres -c "/opt/wapt/conf/waptserver.ini"
This does not work (see below).

Code: Select all

dumping mongodb data
If you are running a mongod on the same path you should connect to that instead of direct data file access
2018-10-25T12:28:43.130+0200 [tools] dbexit:
2018-10-25T12:28:43.130+0200 [tools] shutdown: going to close listening sockets...
2018-10-25T12:28:43.130+0200 [tools] shutdown: going to flush diaglog...
2018-10-25T12:28:43.130+0200 [tools] shutdown: going to close sockets...
2018-10-25T12:28:43.131+0200 [tools] shutdown: waiting for fs preallocator...
2018-10-25T12:28:43.131+0200 [tools] shutdown: closing all files...
2018-10-25T12:28:43.131+0200 [tools] closeAllFiles() finished
2018-10-25T12:28:43.131+0200 [tools] shutdown: removing fs lock...
2018-10-25T12:28:43.131+0200 [tools] couldn't remove fs lock errno:9 Bad file descriptor
2018-10-25T12:28:43.131+0200 [tools] dbexit: really exiting now
Traceback (most recent call last):
  File "/opt/wapt/waptserver/upgrade.py", line 190, in <module>
    upgrade2postgres()
  File "/opt/wapt/waptserver/upgrade.py", line 152, in upgrade2postgres
    jsondata = create_import_data()
  File "/opt/wapt/waptserver/upgrade.py", line 71, in create_import_data
    data = subprocess.check_output('mongoexport -d wapt -c hosts --jsonArray --dbpath=%s' % mongo_datadir,shell=True)
  File "/usr/lib/python2.7/subprocess.py", line 574, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command 'mongoexport -d wapt -c hosts --jsonArray --dbpath=/var/lib/mongodb/' returned non-zero exit status 45
I have the impression that a mongod.lock file is created each time and causes a problem, or perhaps I'm mistaken?

Code: Select all

drwxr-xr-x  3 mongodb mongodb      4096 oct.  25 12:17 ./
drwxr-xr-x 42 root    root         4096 oct.  24 15:27 ../
drwxr-xr-x  2 mongodb mongodb      4096 oct.  25 12:17 journal/
-rw-------  1 mongodb mongodb  67108864 oct.  25 12:17 local.0
-rw-------  1 mongodb mongodb  16777216 oct.  25 12:17 local.ns
-rwxr-xr-x  1 mongodb mongodb         6 oct.  25 12:17 mongod.lock*
-rw-------  1 mongodb mongodb  67108864 oct.  24 13:49 wapt.0
-rw-------  1 mongodb mongodb 134217728 oct.  24 13:46 wapt.1
-rw-------  1 mongodb mongodb 268435456 oct.  24 13:34 wapt.2
-rw-------  1 mongodb mongodb  16777216 oct.  24 13:34 wapt.ns
iutlps-informatique
Messages: 2
Registration: Oct 25, 2018 - 12:31

October 25, 2018 - 2:19 PM

I found it, I had to delete this line in the /opt/wapt/waptserver/upgrade.py file!

Code: Select all

 data = subprocess.check_output('mongoexport -d wapt -c hosts --jsonArray --dbpath=%s' % mongo_datadir,shell=True)
        else:
User avatar
dcardon
WAPT Expert
Messages: 1932
Registration: June 18, 2014 - 09:58
Location: Saint Sébastien sur Loire
Contact :

October 25, 2018 - 6:08 PM

iutlps-informatique wrote: Oct 25, 2018 - 2:19 PM I found it, I had to delete this line in the /opt/wapt/waptserver/upgrade.py file!

Code: Select all

 data = subprocess.check_output('mongoexport -d wapt -c hosts --jsonArray --dbpath=%s' % mongo_datadir,shell=True)
        else:
This line retrieves data from the MongoDB database and integrates it into PostgreSQL. Removing it bypasses the retrieval of the existing inventory. That said, in version 1.3, all information contained in MongoDB is retrieved by the workstations. So, if you wait a little while, the database will be completely rebuilt.

I think your problem was related to the fact that MongoDB was still running. The shutdown would probably have been enough to resolve the issue.

Sincerely,

Denis

PS: It's best to avoid necroposting this thread; feel free to start a new topic!
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
Locked