Socket error #10061 Connection Refused.

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
knpc
Messages: 63
Registration: Nov. 20, 2015 - 4:40 p.m.

November 20, 2015 - 4:43 PM

Hello,

I'm completely new to WAPT and when I try to create a custom installer, I get a socket error message. When I acknowledge the error, I get the following message:

Error loading the WAPT agent to the repository.

Thank you for your help.

Patrice
Floflobel
Messages: 135
Registration: Oct 15, 2015 - 5:32 p.m.

November 24, 2015 - 11:56

Hello,

could you please provide us with the configuration of your setup.py file located in C:\wapt? This will allow us to view your repository configuration from your WAPT server.
knpc
Messages: 63
Registration: Nov. 20, 2015 - 4:40 p.m.

November 25, 2015 - 4:26 PM

Good morning,

Thank you for your help. I can only find the setup.py file in the WAPT\WAPTUPGRADE folder.
I don't have any files with that name directly in the WAPT directory

I'm attaching an image of the py files located in my wapt folder
I'm including the contents of the setup.py file because I can't paste it as an attachment

Thank you for your help

Knpc
contents of the wapt folder
contents of the wapt folder
File extension py.JPG (43.89 KB) Viewed 9064 times
SETUP.PY FILE

# -*- coding: utf-8 -*-
import from setuphelpers *
import os
import _winreg
import tempfile
import shutil

# registry key(s) where WAPT will find how to remove the application(s)
uninstallkey = []

def update_sources():
files = [
'common.py',
'setuphelpers.py',
'wapt-get.exe',
'wapt-get.exe.manifest',
'wapt-get.py',
'waptdevutils.py',
'waptpackage.py',
'windnsquery.py',
'wapttray.exe',
'waptexit.exe',
'keyfinder.py',
'COPYING.txt',
'templates',
'waptconsole.exe',
'waptconsole.exe.manifest',
'waptservice',
'languages',


r'lib\site-packages\babel\__init__.py',
r'lib\site-packages\babel\_compat.py',
r'lib\site-packages\babel\core.py',
r'lib\site-packages\babel\global.dat',
r'lib\site-packages\babel\localtime',
r'lib\site-packages\babel\plural.py',
r'lib\site-packages\babel\localedata\en.dat',
r'lib\site-packages\babel\localedata\fr.dat',
r'lib\site-packages\babel\messages',
r'lib\site-packages\babel\support.py',
r'lib\site-packages\babel\compat.py',
r'lib\site-packages\babel\dates.py',
r'lib\site-packages\babel\localedata.py',
r'lib\site-packages\babel\numbers.py',
r'lib\site-packages\babel\util.py',

r'lib\site-packages\flask_babel',
r'lib\site-packages\pytz',
r'lib\site-packages\speaklater',
r'lib\site-packages\requests_kerberos_sspi',
r'lib\site-packages\lib\site-packages\flask_kerberos_sspi.py',
r'lib\site-packages\kerberos_sspi.py',
r'lib\site-packages\wapt.pth',
]

def ignore(src,names):
result = []
for name in names:
for pattern in ['*.pyc','*.exe']:
if glob.fnmatch.fnmatch(name,pattern):
result.append(name)
return result

checkout_dir = os.path.abspath(os.path.join(os.getcwd(),'..'))
# cleanup patches dir
if os.path.exists(os.path.join(checkout_dir,'waptupgrade','patches')):
shutil.rmtree(os.path.join(checkout_dir,'waptupgrade','patches'))

os.makedirs(os.path.join(checkout_dir,'waptupgrade','patches'))
for f in files:
fn = os.path.join(checkout_dir,f)
target_fn = os.path.join(checkout_dir,'waptupgrade','patches',f)
if os.path.isfile(fn):
if not os.path.exists(os.path.dirname(target_fn)):
os.makedirs(os.path.dirname(target_fn))
filecopyto(fn,target_fn)
elif os.path.isdir(fn):
copytree2(
src=fn,
dst=target_fn,
onreplace = default_overwrite,
ignore=ignore)
return True

def update_control(entry):
"""Update package control file before build-upload"""
if update_sources():
waptget = get_file_properties(r'patches\wapt-get.exe')
rev = open('../version').read().strip()
entry.package = '%s-waptupgrade' % WAPT.config.get('global','default_package_prefix')
entry.version = '%s-%s' % (waptget['FileVersion'],rev)
else:
print(u'Keeping current control data %s (%s)'%(control.package,control.version))

def update_registry_version(version):
# updatethe registry
with _winreg.CreateKeyEx(HKEY_LOCAL_MACHINE,r'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\WAPT_is1',\
0, _winreg.KEY_READ| _winreg.KEY_WRITE ) as waptis:
reg_setvalue(waptis,"DisplayName","WAPT %s" % version)
reg_setvalue(waptis,"DisplayVersion","WAPT %s" % version)
reg_setvalue(waptis,"InstallDate",currentdate())



def copytree2(src, dst, ignore=None, onreplace=default_skip, oncopy=default_oncopy, enable_replace_at_reboot=True, onerror=None):
"""Copy src directory to dst directory. dst is created if it doesn't exist
src can be relative to installation temporary dir
oncopy is called for each file copy. if False is returned, copy is skipped
onreplace is called when a file will be overwritten.
"""
logger.debug('Copy tree from "%s" to "%s"' % (ensure_unicode(src),ensure_unicode(dst)))
# path relative to temp directory...
tempdir = os.getcwd()
if not os.path.isdir(src) and os.path.isdir(os.path.join(tempdir,src)):
src = os.path.join(tempdir,src)

names = os.listdir(src)
if callable(ignore) and ignore is not None:
ignored_names = ignore(src, names)
else:
ignored_names = set()

if not os.path.isdir(dst):
if oncopy('create directory',src,dst):
os.makedirs(dst)
errors = []
for name in names:
if name in ignored_names:
continues
srcname = os.path.join(src, name)
dstname = os.path.join(dst, name)
try:
if os.path.isdir(srcname):
if oncopy('directory',srcname,dstname):
copytree2(srcname, dstname, ignore = ignore, onreplace=onreplace, oncopy=oncopy)
else:
if os.path.isfile(dstname):
if onreplace(srcname,dstname) and oncopy('overwrites',srcname,dstname):
os.unlink(dstname)
shutil.copy2(srcname, dstname)
else:
if oncopy('copy',srcname,dstname):
shutil.copy2(srcname, dstname)

except (IOError, os.error) as why:
#print(u'IO Error copying from "%s" to "%s": %s' % (ensure_unicode(src),ensure_unicode(dst),ensure_unicode(why)))
if onerror is not None and callable(onerror):
try:
onerror(srcname,dstname,why)
except Exception as e:
errors.append((srcname,dstname,ensure_unicode(e)))
else:
errors.append((srcname,dstname,ensure_unicode(why)))

# catch the Error from the recursive copytree so that we can
# continue with other files
except shutil.Error as err:
logger.critical(u'shutil Error copying from "%s" to "%s": %s' % (ensure_unicode(srcname),ensure_unicode(dstname),ensure_unicode(err)))
errors.extend(err.args[0])
try:
shutil.copystat(src, dst)
Except for OSError, why?
if WindowsError is not None and isinstance(why, WindowsError):
# Copying file access times may fail on Windows
pass
else:
print(u'Error copying stats from "%s" to "%s": %s' % (ensure_unicode(src),ensure_unicode(dst),ensure_unicode(why)))
errors.append((src, dst, str(why)))
if errors:
raise shutil.Error, errors



def add_at_cmd(cmd,delay=1):
import datetime
at_time = (datetime.datetime.now() + datetime.timedelta(minutes=delay)).strftime('%H:%M:%S')
print(run('at %s "%s"'%(at_time,cmd)))


def install():
# if you want to modify the keys depending on environment (win32/win64... params..)
print(u'Partial upgrade of WAPT client')
killalltasks('wapttray.exe')
killalltasks('waptconsole.exe')

def onerror(srcname,dstname,e):
print u"Error %s %s %s" %(srcname,dstname,ensure_unicode(e))
if e[0] == 5: # locked
filecopyto(srcname,dstname+'.pending')
replace_at_next_reboot(None, dstname)
else:
raise e

def check_exe_version(src,dst):
if os.path.splitext(dst)[1] in ('.exe','.dll'):
try:
ov = get_file_properties(dst)['FileVersion']
nv = get_file_properties(src)['FileVersion']
return Version(ov)
except:
return True
else:
return True

copytree2('patches',WAPT.wapt_base_dir,
onreplace = check_exe_version,
onerror = onerror)

update_registry_version(control.version)

# restart of service cannot be done by service...
if service_installed('waptservice') and service_is_running('waptservice'):
import requests,json
try:
res = json.loads(requests.get('http://127.0.0.1:8088/waptservicerestart.json').text)
except:
tmp_bat = tempfile.NamedTemporaryFile(prefix='waptrestart',suffix='.cmd',mode='wt',delete=False)
tmp_bat.write('net stop waptservice\n')
tmp_bat.write('net start waptservice\n')
tmp_bat.write('del "%s"\n'%tmp_bat.name)
tmp_bat.close()
add_at_cmd(tmp_bat.name)
print(u'Upgrade done')
Floflobel
Messages: 135
Registration: Oct 15, 2015 - 5:32 p.m.

November 26, 2015 - 12:17

Hello,

I just found the file in question, which is "wapt-get.ini".
Could you post it here?

Thanks
knpc
Messages: 63
Registration: Nov. 20, 2015 - 4:40 p.m.

November 26, 2015 - 2:49 PM

Here it is :-)

: WAPT-GET.INI FILE:


[global]
waptupdate_task_period=120
use_hostpackages=1
repo_url=https://srvwapt.mont-tremblant.local/wapt
wapt_server=https://srvwapt.mont-tremblant.local
private_key=C:\private\monttremblant.pem
templates_repo_url=http://wapt.tranquil.it/wapt
default_sources_root=E:\wapt\WaptDev
default_package_prefix=mtt
loglevel=warning

[options]
server_uuid=f444b1ab-6e89-47f9-8d3a-8f8d3ffe1a49

- Just to clarify, I'm on an IIS server
- I get the same "connection refused" message when trying to connect to the console. Are the two related?

In this .ini file, I don't have a database entry. Is that normal?

Thank you.
Floflobel
Messages: 135
Registration: Oct 15, 2015 - 5:32 p.m.

November 30, 2015 - 1:09 PM

You can ping: https://srvwapt.mont-tremblant.local/wapt
and see what the URL returns?
knpc
Messages: 63
Registration: Nov. 20, 2015 - 4:40 p.m.

November 30, 2015 - 2:35 PM

Hi,

I can ping srvwapt.mont-tremblant.local
but I can't ping https://srvwapt.mont-tremblant.local/wapt. I think that's normal.
The console I'm using is directly on the Wapt server.

Just FYI, it works with localhost:8088; I have access to the console.

Thanks.
knpc
Messages: 63
Registration: Nov. 20, 2015 - 4:40 p.m.

December 7, 2015 - 3:53 PM

Hi everyone,

I'm still having trouble solving my problem so I hope to get some help by bumping my post.

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

December 7, 2015 - 4:57 PM

Hello,

can you tell us more?

Is it a Windows server or a Linux server?

Are any services other than WAPT hosted on these servers?

Simon
knpc
Messages: 63
Registration: Nov. 20, 2015 - 4:40 p.m.

December 7, 2015 - 10:07 PM

With pleasure:

It's a 2008 server with only WSUS installed.
IIS was configured following the Wapt guide.

If you need any further information, just ask.

Thank you
Locked