QATrack+ install Problem (IIS 8_5 Detailed Error - 502_3 - Bad Gateway)

215 views
Skip to first unread message

Jostin Crass

unread,
May 6, 2020, 2:47:28 PM5/6/20
to QATrack+
We followed the instructions on installing and deploying QATrack+ on a Windows Server 2012 R2 and when finished we get the attached error when going to http://localhost/.  We did noticed that the QATrack3CherryPyService service was not showing up in the windows services list.  We did go through the instructions on configuring CherryPy to serve QATrack+ and everything ran without error, but apparently the service did not install for some reason.  Looking in the deploy\qatrackplus\logs directory at the std_err log we get the following error:

Traceback (most recent call last):
     File "QATrack3CherryPyService.py", line 100, in <module>
          setup()
     File "QATrack3CherryPyService.py", line 43, in setup
          pywin32_postinstall.install()
TypeError: install() missing 1 required positional argument: 'lib_dir'
Traceback (most recent call last):
     File "QATrack3CherryPyService.py", line 100, in <module>
          setup()
     File "QATrack3CherryPyService.py", line 43, in setup
          pywin32_postinstall.install()
TypeError: install() missing 1 required positional argument: 'lib_dir'


Not exactly sure what is going on, but we think it has something to do with pywin32 and or CherryPy.  Any help that could be provided would be greatly appreciated.

Thanks,

Jostin
IIS 8_5 Detailed Error - 502_3 - Bad Gateway.htm

Randle Taylor

unread,
May 6, 2020, 4:06:03 PM5/6/20
to Jostin Crass, QATrack+
Hi Jostin,

Thanks for the report/error traceback! It looks like pywin32 was updated recently and that function needs to be called differently now.  Can you try the following workaround:

1) Open a PowerShell window as administrator (right click on PowerShell icon and Run as Administrator
2) cd C:\deploy
3) .\venvs\qatrack3\Scripts\Activate.ps1
4) .\venvs\qatrack\Scripts\pywin32_postinstall.py -install
5) cd qatrackplus
6) python QATrack3CherryPyService.py install

and report back.

Thanks,
Randy

--
You received this message because you are subscribed to the Google Groups "QATrack+" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qatrack+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/qatrack/427937b2-6a67-4111-b36d-b4ba6979b3cf%40googlegroups.com.

Jostin Crass

unread,
May 7, 2020, 9:42:32 AM5/7/20
to QATrack+
Randy,

Thanks for the reply!  It definitely worked and allowed the QATrack3CherryPyService to install.  Now when I go to http://localhost/ I get a bad request (400) error.  Not sure what's going on, I've changed my allowed hosts to ALLOWED_HOSTS=['*'] but I'm still getting the bad request 400.  I'll keep digging but at least the service is running now.

Thanks,

Jostin
To unsubscribe from this group and stop receiving emails from it, send an email to qat...@googlegroups.com.

Randle Taylor

unread,
May 7, 2020, 3:14:09 PM5/7/20
to Jostin Crass, QATrack+
Thanks for the update, that's good to know! You need to restart the CherryPy service after any changes are made to local_settings.py. 

To unsubscribe from this group and stop receiving emails from it, send an email to qatrack+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/qatrack/599b5691-8413-4154-8a27-21183e261680%40googlegroups.com.

Jostin Crass

unread,
May 8, 2020, 12:49:53 AM5/8/20
to QATrack+
Now that I’ve restarted CherryPy I am getting an HTTP500 internal server error.  I changed the local_settings to Debug mode and I get the following error:

InterfaceError at /accounts/login

(‘IM002’, ‘[IM002]’ [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified (0)
(SQLDriverConnect)’)

Not sure what I’ve don now, lol!

Randle Taylor

unread,
May 8, 2020, 4:12:29 PM5/8/20
to QATrack+
Hmmm that's a new one for me.  Can you try adding the 'provider' option to your database settings like this:


DATABASES = {
    'default': {
        #....other settings then add OPTIONS section
 'OPTIONS': {
             'driver': 'SQL Server Native Client 11.0'
}
    }
}


Your may also be missing the ODBC drivers which you can get here:  https://www.microsoft.com/en-us/download/details.aspx?id=36434

Jostin Crass

unread,
May 18, 2020, 2:48:04 PM5/18/20
to QATrack+
Here is a copy of my local_settings.py file:

# Set to True to enable debug mode (not safe for regular use!)
DEBUG = True
DATABASES = {
    'default': {
        'ENGINE': 'sql_server.pyodbc',
        'NAME': 'qatrackplus',
        'USER': '',#'qatrack',  # USER/PWD can usually be left blank if SQL server is running on the same server as QATrack+
        'PASSWORD': '',#'qatrackpass',
        'HOST':
            'jsmc7826\\SQLExpress',  # leave blank unless using remote server or SQLExpress (use 127.0.0.1\\SQLExpress or COMPUTERNAME\\SQLExpress)
        'PORT': '',  # Set to empty string for default. Not used with sqlite3.
        'OPTIONS': {
            'driver': 'SQL Server Native Client 11.0',
            }
    }
}
ALLOWED_HOSTS = ['jsmc7826','127.0.0.1', 'localhost']
# needs to be set to True when running behind reverse proxy (normal deploy)
# set to False when not running behind reverse proxy
# Use True for e.g. CherryPy/IIS and False for Apache/mod_wsgi
USE_X_FORWARDED_HOST = True
# Set to False to disable the Service Log functionality
USE_SERVICE_LOG = True
# Set to False to disable the Parts Log functionality
USE_PARTS = True

And here is the error I get when going to http://localhost:8080:

OperationalError at /accounts/login/

('08001', '[08001] [Microsoft][SQL Server Native Client 11.0]SQL Server Network Interfaces: Error Locating Server/Instance Specified [xFFFFFFFF].  (-1) (SQLDriverConnect); [08001] [Microsoft][SQL Server Native Client 11.0]Login timeout expired (0); [08001] [Microsoft][SQL Server Native Client 11.0]Invalid connection string attribute (0); [08001] [Microsoft][SQL Server Native Client 11.0]A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online. (-1)')
Request Method:GET
Request URL:http://localhost:8080/accounts/login/?next=/
Django Version:1.11.20
Exception Type:OperationalError
Exception Value:
('08001', '[08001] [Microsoft][SQL Server Native Client 11.0]SQL Server Network Interfaces: Error Locating Server/Instance Specified [xFFFFFFFF].  (-1) (SQLDriverConnect); [08001] [Microsoft][SQL Server Native Client 11.0]Login timeout expired (0); [08001] [Microsoft][SQL Server Native Client 11.0]Invalid connection string attribute (0); [08001] [Microsoft][SQL Server Native Client 11.0]A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online. (-1)')
Exception Location:C:\deploy\venvs\qatrack3\lib\site-packages\sql_server\pyodbc\base.py in get_new_connection, line 314
Python Executable:C:\deploy\venvs\qatrack3\Scripts\pythonservice.exe
Python Version:3.6.6
Python Path:
['C:\\deploy\\qatrackplus',
 'C:\\deploy\\venvs\\qatrack3\\Scripts',
 'C:\\deploy\\venvs\\qatrack3\\Scripts\\python36.zip',
 'C:\\Program Files (x86)\\Python36-32\\DLLs',
 'C:\\Program Files (x86)\\Python36-32\\lib',
 'C:\\Program Files (x86)\\Python36-32',
 'C:\\deploy\\venvs\\qatrack3',
 'C:\\deploy\\venvs\\qatrack3\\lib\\site-packages',
 'c:\\deploy\\venvs\\qatrack3\\src\\django-formtools',
 'c:\\deploy\\venvs\\qatrack3\\src\\django-genericdropdown-master',
 'c:\\deploy\\venvs\\qatrack3\\src\\django-listable',
 'C:\\deploy\\venvs\\qatrack3\\lib\\site-packages\\win32',
 'C:\\deploy\\venvs\\qatrack3\\lib\\site-packages\\win32\\lib',
 'C:\\deploy\\venvs\\qatrack3\\lib\\site-packages\\Pythonwin',
 'C:/deploy/venvs/qatrack3/',
 'C:/deploy/venvs/qatrack3/Scripts',
 'C:/deploy/qatrackplus/']
Server time:Mon, 18 May 2020 14:41:17 -0400

Jostin Crass

unread,
May 18, 2020, 3:05:31 PM5/18/20
to QATrack+
I got it!  Removed the computername\\SQLExpress and typed in credintials in the USER and PASSWORD section.  NOW IT WORKS!! Thanks

Randle Taylor

unread,
May 19, 2020, 12:40:31 PM5/19/20
to Jostin Crass, QATrack+
Nice work!   Interesting that you didn't need the '\\SQLExpress' in this case.  The default instance name is .\SQLExpress I think, but looks like that doesn't apply in this case.  Thanks for the update.

To unsubscribe from this group and stop receiving emails from it, send an email to qatrack+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/qatrack/be0f0701-ef4c-462a-b2d0-09edfeb4ccac%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages