Server error when accessing admin

72 views
Skip to first unread message

Ian W. Scott

unread,
Apr 29, 2020, 11:39:36 AM4/29/20
to web2py-users
I'm setting up a fresh install of web2py (on webfaction) on centos7 with Apache 2.4.6 and PostgreSQL under Python 3.8. I've followed the server configuration section of the web2py manual and the welcome app itself is working fine. But when I try to navigate to Admin or appadmin I get a 500 error and a message that the server is misconfigured. When I look in the apache error logs I see this error:

mod_wsgi (pid=14846): Exception occurred processing WSGI script '/<obfuscated>/web2py/wsgihandler.py'.                                                         TypeError: sequence of byte string values expected, value of type str found

Searching that error on the group here brings up a couple of similar past errors, but without any helpful information. Two of the questions went unanswered and the third suggests that an underlying python 3 error was being fixed in a pr last year. 

Can anyone suggest how I go about debugging this?

Here's my complete apache config file:
ServerRoot "<obfuscated>"                                                                                                                                                                                                                                                                                                       #mime type for mpeg4 files                                                                                                                                      
Addtype audio/mp4 .m4a                                                                                                                                                                                                                                                                                                          
LoadModule authz_core_module modules/mod_authz_core.so                                                                                                          
LoadModule dir_module        modules/mod_dir.so                                                                                                                
LoadModule env_module        modules/mod_env.so                                                                                                                
LoadModule log_config_module modules/mod_log_config.so                                                                                                          
LoadModule mime_module       modules/mod_mime.so                                                                                                                
LoadModule rewrite_module    modules/mod_rewrite.so                                                                                                            
LoadModule setenvif_module   modules/mod_setenvif.so                                                                                                            
LoadModule wsgi_module       modules/mod_wsgi.so                                                                                                                
LoadModule unixd_module      modules/mod_unixd.so                                                                                                              
                                                                                                                                                               
LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined                                                              
CustomLog /
<obfuscated>/access_paideia.log combined                                                                                                
ErrorLog /<obfuscated>
/error_paideia.log  


DirectoryIndex index.py                                                                                                                                        
DocumentRoot /<obfuscted>/htdocs                                                                                                                                                                                                                                                                            
Listen 13075                                                                                                                                                    
KeepAlive Off                                                                                                                                                  
SetEnvIf X-Forwarded-SSL on HTTPS=1                                                                                                                            
ServerLimit 1                                                                                                                                                  
StartServers 1
                                                                                                                                               
MaxRequestWorkers 5                                                                                                                                            
MinSpareThreads 1                                                                                                                                              
MaxSpareThreads 3                                                                                                                                              
ThreadsPerChild 5                                                                                                                                              
                                                                                                                                                               
WSGIDaemonProcess paideia processes=2 threads=12 python-path=/
<obfuscated>/python3.8                                                      
WSGIProcessGroup paideia                                                                                                                                        
WGIRestrictEmbedded On                                                                                                                                          
WSGILazyInitialization On                                                                                                                                      
                                                                                                                                                               
# Use web2py's wsgi handler                                                                                                                                    
WSGIScriptAlias / /<obfuscated>/web2py/wsgihandler.py                                                                                                          
                                                                                                                                                               
# Allow no access to web2py folder contents except through handler script                                                                                      
<Directory /<obfuscated>/web2py>                                                                                                          
    AllowOverride None                                                                                                                                          
    Require all denied                                                                                                                                          
    <Files wsgihandler.py>                                                                                                                                      
        Require all granted                                                                                                                                    
    </
Files>                                                                                                                                                    
</Directory>                                                                                                                                                    
                                                                                                                                                               
# Allow direct access to anything in the static folder of any application                                                                                      
<Directory /
<obfuscated>/web2py/applications/*/static/>                                                                                
    Require all granted                                                                                                                                        
</Directory>                                                                                                                                                                            



Annet

unread,
Apr 30, 2020, 5:39:06 AM4/30/20
to web2py-users
Why didn't you use the web2py install/unstall script that webfaction provides?
It installs web2py served via nginx and uWSGI.

The script mentions 2 caveats:

Web2py won't work properly if it is mounted to a sub-URL like
http://domain.com/web2py/. Instead, it must be mounted to the
website root, e.g. http://domain.com/

For the administrative interface to work, the web2py app must be
mounted to and accessed through an HTTPS-enabled site. You would
usually mount the app to two websites - HTTPS-disabled one for
normal access, and HTTPS-enabled one for admin logins


Kind regards,

Annet


Ian W. Scott

unread,
Apr 30, 2020, 10:05:35 AM4/30/20
to web2py-users
Thanks Annet for your help. Webfaction doesn't seem currently to make that install script available when you're creating a new application in a server. Web2py doesn't appear anywhere on the list of available application types. Do you know if it's available somewhere else on their service?

Thanks too for the pointer about subdomains and ssl. I was aware of those and they don't seem to be the problem.

Annet

unread,
Apr 30, 2020, 10:33:23 AM4/30/20
to web2py-users
Hi Ian,

I do have a copy of the script, it's a bit old, but I'll attach
it anyway, maybe it's of help.


Kind regards,

Annet
install.py

Ian W. Scott

unread,
Apr 30, 2020, 10:37:58 AM4/30/20
to web...@googlegroups.com
Thanks very much
--
Resources:
- http://web2py.com/book (Documentation)
---
You received this message because you are subscribed to a topic in the Google Groups "web2py-users" group.
To unsubscribe from this group and all its topics, send an email to web2py+unsubscribe@googlegroups.com.

Ian W. Scott

unread,
Apr 30, 2020, 3:02:58 PM4/30/20
to web2py-users
Unfortunately I don't know anything about nginx. I've always worked with apache2. Can anyone suggest how to debug this? I'm really at the end of my rope here.

On Thursday, April 30, 2020 at 10:37:58 AM UTC-4, Ian W. Scott wrote:
Thanks very much

Ian W. Scott, PhD
Associate Professor of New Testament
Tyndale Seminary, Toronto, Canada
Paul's Way of Knowing: Story Experience and the Spirit (Baker Academic [Mohr Siebeck], 2006)
The Online Critical Pseudepigrapha (SBL, 2006-; pseudepigrapha.org)
Sent from Mailspring, the best free email app for work

Ian W. Scott

unread,
May 1, 2020, 10:24:12 AM5/1/20
to web...@googlegroups.com
Okay, I'm narrowing down what the problem might be. The site is presently using webfaction's shared SSL certificate for https, which browsers don't recognize as secure. Could that be causing the admin interface to throw the 500 error?



On Thursday, April 30, 2020 at 3:02:58 PM UTC-4, Ian W. Scott wrote:
Unfortunately I don't know anything about nginx. I've always worked with apache2. Can anyone suggest how to debug this? I'm really at the end of my rope here.

On Thursday, April 30, 2020 at 10:37:58 AM UTC-4, Ian W. Scott wrote:
Thanks very much

Reply all
Reply to author
Forward
0 new messages