Help Upgrading! Blank Screen acessing WSGI through Apache22
Forum » WikiPBX / Technical Support » Help Upgrading! Blank Screen acessing WSGI through Apache22
Started by: sstefflerssteffler
On: 1266172011|%e %b %Y, %H:%M %Z|agohover
Number of posts: 23
rss icon RSS: New posts
Summary:
Can't track down what the error is with this WikiPBX upgrade.
Help Upgrading! Blank Screen acessing WSGI through Apache22
sstefflerssteffler 1266172011|%e %b %Y, %H:%M %Z|agohover

Hi all,

Wow, for over a year I have been using WikiPBX and I must say I am impressed!

I have a functional installation on FreeBSD using a virtual server I purchased at Link2VoIP.com. It has been running the 0.5 version (r199) for a while and works great. However I want to migrate to the 0.8 trunk.

I installed mod_wsgi from source because the mod_wsgi that was in FreeBSD Ports was 2.6 (quite old). No problems there.

I have a postgres DB, called wikipbx, and I have created a new DB called wikipbx0.8 which I will use for this new version. I have exported my configuration to XML. The source for 0.8 has been downloaded into /usr/src/wikipbx0.8. I have been following along the guide on the Wiki and modifying the instructions slightly so they work on FreeBSD.

My Apache has the module loaded for WSGI and my vhost entry is as follows (The paths are correct and everything is actually located where I have defined it below):

WSGIPythonPath /usr/src/wikipbx0.8:/usr/src/wikipbx0.8/wikipbx:/usr/src/django:/usr/src/freeswitch/libs/esl/python

<VirtualHost *:80>
    ServerAdmin support@thirtytwenty.com
    ServerName MYHOSTNAMEHERE
    ErrorLog "/var/log/ipbx-error_log"
    CustomLog "/var/log/ipbx-access_log" common
<Directory "/usr/src/wikipbx0.8">
       Options Indexes FollowSymLinks
       AllowOverride FileInfo
       Order allow,deny
       Allow from all
</Directory>
# I Read online that this may be required - but I get same behaviour either way if it is commented out
    AddType text/html .wsgi
    WSGIScriptAlias / /usr/src/wikipbx0.8/wikipbx.wsgi
    LogLevel debug
</VirtualHost>

My new DB is blank and the user and permissions are set up. I can log into the DB and use it when testing with no problems.

When I got into /usr/src/wikipbx0.8/wikipbx and I run python manage.py syncdb this is all I see:

root# python manage.py syncdb
Loading 'initial_data' fixtures...
No fixtures found.
root#

The database is still blank, yet there are no errors. Here is a diff of my settings.py against the default settings_template:

root# diff settings_template.py settings.py
26,28c26,28
< DATABASE_NAME = 'wikipbx'             # Or path to database file if using sqlite3.
< DATABASE_USER = 'YOUR_DB_USER'             # Not used with sqlite3.
< DATABASE_PASSWORD = 'YOUR_DB_PASS'         # Not used with sqlite3.
---
> DATABASE_NAME = 'wikipbx0.8'             # Or path to database file if using sqlite3.
> DATABASE_USER = 'wikipbx'             # Not used with sqlite3.
> DATABASE_PASSWORD = 'thisisnotreallymyrealpassword'         # Not used with sqlite3.
124c124
< FREESWITCH_URL_PORT = "http://127.0.0.1"
---
> FREESWITCH_URL_PORT = "http://MYHOSTNAMEHERE"

The settings I have put into settings.py for the DB should be working. They are copied from my old DB except for the database name. I have added the wikipbx user to the allowed users on the new DB.

When I re-load Apache, and access my hostname in the browser, I was initially getting access denied entries in my Apache error log, until I set up a Directory definition for the /usr/src/wikipbx0.8 directory that allowed access. Now, after reloading again, when I hit http://MYHOSTNAMEHERE in my browser, I get a blank page (nothing appears in View Source either). I hit it with Lynx and Lynx says:

root# lynx http://MYHOSTNAMEHERE

Looking up MYHOSTNAMEHERE
Making HTTP connection to MYHOSTNAMEHERE
Sending HTTP request.
HTTP request sent; waiting for response.
Alert!: Unexpected network read error; connection aborted.
Can't Access `http://MYHOSTNAMEHERE/'
Alert!: Unable to access document.

lynx: Can't access startfile 

root#

Even with debug logging turned on in Apache, there are no errors appearing in the access or error logs for this attempt.

I am stuck here. Any tips?

Thanks,
Steve

Last edited on 1266192045|%e %b %Y, %H:%M %Z|agohover By ssteffler + Show more
Reply  |  Options
Re: Help Upgrading! Blank Screen acessing WSGI through Apache22
stas_shtinstas_shtin 1266175897|%e %b %Y, %H:%M %Z|agohover

I'm not sure what's going on here, but it's obvious from your report that for some reason the DB tables aren't created by syncdb command. So there's no point to look into apache configs. Please show us the output of

./manage.py sqlall wikipbxweb

command.

FYI, I've just tested that trunk creates DB as usually, it's not broken.

Reply  |  Options
Re: Help Upgrading! Blank Screen acessing WSGI through Apache22
sstefflerssteffler 1266191744|%e %b %Y, %H:%M %Z|agohover

Here are the results:

BEGIN;
CREATE TABLE "wikipbxweb_eventsocketconfig" (
    "id" serial NOT NULL PRIMARY KEY,
    "server_id" integer NOT NULL,
    "listen_ip" varchar(25) NOT NULL,
    "listen_port" integer CHECK ("listen_port" >= 0) NOT NULL,
    "password" varchar(25) NOT NULL
);
CREATE TABLE "wikipbxweb_sofiagateway" (
    "id" serial NOT NULL PRIMARY KEY,
    "name" varchar(100) NOT NULL,
    "account_id" integer NOT NULL,
    "username" varchar(25) NOT NULL,
    "password" varchar(25) NOT NULL,
    "proxy" varchar(50) NOT NULL,
    "register" boolean NOT NULL,
    "direction" varchar(20) NOT NULL,
    "extension" varchar(50) NOT NULL,
    "realm" varchar(50) NOT NULL,
    "from_domain" varchar(50) NOT NULL,
    "expire_seconds" integer CHECK ("expire_seconds" >= 0) NULL,
    "retry_seconds" integer CHECK ("retry_seconds" >= 0) NULL,
    "caller_id_in_from" boolean NOT NULL,
    "max_concurrent" integer CHECK ("max_concurrent" >= 0) NOT NULL,
    "in_progress_calls" integer CHECK ("in_progress_calls" >= 0) NULL
);
CREATE TABLE "wikipbxweb_account" (
    "id" serial NOT NULL PRIMARY KEY,
    "name" varchar(50) NOT NULL,
    "server_id" integer NOT NULL,
    "enabled" boolean NOT NULL,
    "ext_rtp_ip" varchar(50) NOT NULL,
    "ext_sip_ip" varchar(50) NOT NULL,
    "domain" varchar(50) NOT NULL,
    "accept_blind_reg" boolean NOT NULL,
    "sip_port" integer CHECK ("sip_port" >= 0) NOT NULL,
    UNIQUE ("sip_port", "ext_sip_ip")
);
ALTER TABLE "wikipbxweb_sofiagateway" ADD CONSTRAINT account_id_refs_id_7f3f62da9c27bf6d FOREIGN KEY ("account_id") REFERENCES "wikipbxweb_account" ("id") DEFERRABLE INITIALLY DEFERRED;
CREATE TABLE "wikipbxweb_endpoint" (
    "id" serial NOT NULL PRIMARY KEY,
    "userid" varchar(100) NOT NULL,
    "password" varchar(100) NOT NULL,
    "account_id" integer NOT NULL REFERENCES "wikipbxweb_account" ("id") DEFERRABLE INITIALLY DEFERRED,
    "userprofile_id" integer NULL,
    "is_registered" boolean NOT NULL,
    "last_registered" timestamp with time zone NULL,
    "contact_addr" varchar(100) NOT NULL
);
CREATE TABLE "wikipbxweb_voicemailtrigger" (
    "id" serial NOT NULL PRIMARY KEY,
    "name" varchar(100) NOT NULL,
    "callerid" varchar(100) NOT NULL
);
CREATE TABLE "wikipbxweb_extension" (
    "id" serial NOT NULL PRIMARY KEY,
    "account_id" integer NOT NULL REFERENCES "wikipbxweb_account" ("id") DEFERRABLE INITIALLY DEFERRED,
    "dest_num" varchar(75) NOT NULL,
    "desc" varchar(250) NOT NULL,
    "actions_xml" text NOT NULL,
    "is_temporary" boolean NOT NULL,
    "endpoint_id" integer NULL REFERENCES "wikipbxweb_endpoint" ("id") DEFERRABLE INITIALLY DEFERRED,
    "priority_position" integer NOT NULL
);
CREATE TABLE "wikipbxweb_emailconfig" (
    "id" serial NOT NULL PRIMARY KEY,
    "server_id" integer NOT NULL,
    "account_id" integer NULL REFERENCES "wikipbxweb_account" ("id") DEFERRABLE INITIALLY DEFERRED,
    "from_email" varchar(100) NOT NULL,
    "email_host" varchar(100) NOT NULL,
    "email_port" integer CHECK ("email_port" >= 0) NOT NULL,
    "auth_user" varchar(100) NOT NULL,
    "auth_password" varchar(100) NOT NULL,
    "use_tls" boolean NOT NULL
);
CREATE TABLE "wikipbxweb_soundclip" (
    "id" serial NOT NULL PRIMARY KEY,
    "account_id" integer NOT NULL REFERENCES "wikipbxweb_account" ("id") DEFERRABLE INITIALLY DEFERRED,
    "name" varchar(100) NOT NULL,
    "desc" varchar(100) NOT NULL
);
CREATE TABLE "wikipbxweb_phonecontact" (
    "id" serial NOT NULL PRIMARY KEY,
    "name" varchar(100) NOT NULL,
    "number" varchar(100) NOT NULL,
    "ext" varchar(20) NOT NULL,
    "userprofile_id" integer NULL,
    "is_explicit" boolean NOT NULL,
    "is_private" boolean NOT NULL
);
CREATE TABLE "wikipbxweb_server" (
    "id" serial NOT NULL PRIMARY KEY,
    "application_root" varchar(75) NOT NULL,
    "http_port" integer CHECK ("http_port" >= 0) NOT NULL,
    "ip" varchar(24) NOT NULL,
    "fqdn" varchar(100) NOT NULL
);
ALTER TABLE "wikipbxweb_eventsocketconfig" ADD CONSTRAINT server_id_refs_id_3f40fdf16445b95a FOREIGN KEY ("server_id") REFERENCES "wikipbxweb_server" ("id") DEFERRABLE INITIALLY DEFERRED;
ALTER TABLE "wikipbxweb_account" ADD CONSTRAINT server_id_refs_id_4b9a60cc52c7a6a4 FOREIGN KEY ("server_id") REFERENCES "wikipbxweb_server" ("id") DEFERRABLE INITIALLY DEFERRED;
ALTER TABLE "wikipbxweb_emailconfig" ADD CONSTRAINT server_id_refs_id_59aed97c3df98a27 FOREIGN KEY ("server_id") REFERENCES "wikipbxweb_server" ("id") DEFERRABLE INITIALLY DEFERRED;
CREATE TABLE "wikipbxweb_serverlog" (
    "id" serial NOT NULL PRIMARY KEY,
    "server_id" integer NOT NULL REFERENCES "wikipbxweb_server" ("id") DEFERRABLE INITIALLY DEFERRED,
    "account_id" integer NULL REFERENCES "wikipbxweb_account" ("id") DEFERRABLE INITIALLY DEFERRED,
    "logtime" timestamp with time zone NULL,
    "message" text NOT NULL
);
CREATE TABLE "wikipbxweb_completedcall" (
    "id" serial NOT NULL PRIMARY KEY,
    "account_id" integer NOT NULL REFERENCES "wikipbxweb_account" ("id") DEFERRABLE INITIALLY DEFERRED,
    "uuid" varchar(100) NOT NULL,
    "caller_id_number" varchar(100) NOT NULL,
    "destination_number" varchar(100) NOT NULL,
    "chan_name" varchar(100) NOT NULL,
    "answered_time" timestamp with time zone NOT NULL,
    "hangup_time" timestamp with time zone NOT NULL,
    "cdr_xml" text NOT NULL
);
CREATE TABLE "wikipbxweb_voicemaillabel" (
    "id" serial NOT NULL PRIMARY KEY,
    "name" varchar(100) NOT NULL,
    "incompatible_labels" varchar(200) NOT NULL
);
CREATE TABLE "wikipbxweb_ivr" (
    "id" serial NOT NULL PRIMARY KEY,
    "name" varchar(100) NOT NULL,
    "language_ext" varchar(20) NOT NULL,
    "account_id" integer NULL REFERENCES "wikipbxweb_account" ("id") DEFERRABLE INITIALLY DEFERRED
);
CREATE TABLE "wikipbxweb_voicemail" (
    "id" serial NOT NULL PRIMARY KEY,
    "account_id" integer NOT NULL REFERENCES "wikipbxweb_account" ("id") DEFERRABLE INITIALLY DEFERRED,
    "userprofile_id" integer NULL,
    "date_listened" timestamp with time zone NULL,
    "uuid" varchar(100) NOT NULL
);
CREATE TABLE "wikipbxweb_userprofile" (
    "user_id" integer NOT NULL PRIMARY KEY REFERENCES "auth_user" ("id") DEFERRABLE INITIALLY DEFERRED,
    "account_id" integer NOT NULL REFERENCES "wikipbxweb_account" ("id") DEFERRABLE INITIALLY DEFERRED,
    "mailbox" varchar(40) NOT NULL,
    "vm_password" varchar(100) NOT NULL
);
ALTER TABLE "wikipbxweb_endpoint" ADD CONSTRAINT userprofile_id_refs_user_id_18780d21781a98bf FOREIGN KEY ("userprofile_id") REFERENCES "wikipbxweb_userprofile" ("user_id") DEFERRABLE INITIALLY DEFERRED;
ALTER TABLE "wikipbxweb_phonecontact" ADD CONSTRAINT userprofile_id_refs_user_id_256522f5346dfd26 FOREIGN KEY ("userprofile_id") REFERENCES "wikipbxweb_userprofile" ("user_id") DEFERRABLE INITIALLY DEFERRED;
ALTER TABLE "wikipbxweb_voicemail" ADD CONSTRAINT userprofile_id_refs_user_id_5832b70c52f6936c FOREIGN KEY ("userprofile_id") REFERENCES "wikipbxweb_userprofile" ("user_id") DEFERRABLE INITIALLY DEFERRED;
CREATE TABLE "wikipbxweb_account_admins" (
    "id" serial NOT NULL PRIMARY KEY,
    "account_id" integer NOT NULL REFERENCES "wikipbxweb_account" ("id") DEFERRABLE INITIALLY DEFERRED,
    "userprofile_id" integer NOT NULL REFERENCES "wikipbxweb_userprofile" ("user_id") DEFERRABLE INITIALLY DEFERRED,
    UNIQUE ("account_id", "userprofile_id")
);
CREATE TABLE "wikipbxweb_voicemail_labels" (
    "id" serial NOT NULL PRIMARY KEY,
    "voicemail_id" integer NOT NULL REFERENCES "wikipbxweb_voicemail" ("id") DEFERRABLE INITIALLY DEFERRED,
    "voicemaillabel_id" integer NOT NULL REFERENCES "wikipbxweb_voicemaillabel" ("id") DEFERRABLE INITIALLY DEFERRED,
    UNIQUE ("voicemail_id", "voicemaillabel_id")
);
CREATE INDEX "wikipbxweb_eventsocketconfig_server_id" ON "wikipbxweb_eventsocketconfig" ("server_id");
CREATE INDEX "wikipbxweb_sofiagateway_account_id" ON "wikipbxweb_sofiagateway" ("account_id");
CREATE INDEX "wikipbxweb_account_server_id" ON "wikipbxweb_account" ("server_id");
CREATE INDEX "wikipbxweb_endpoint_account_id" ON "wikipbxweb_endpoint" ("account_id");
CREATE INDEX "wikipbxweb_endpoint_userprofile_id" ON "wikipbxweb_endpoint" ("userprofile_id");
CREATE INDEX "wikipbxweb_extension_account_id" ON "wikipbxweb_extension" ("account_id");
CREATE INDEX "wikipbxweb_extension_endpoint_id" ON "wikipbxweb_extension" ("endpoint_id");
CREATE INDEX "wikipbxweb_emailconfig_server_id" ON "wikipbxweb_emailconfig" ("server_id");
CREATE INDEX "wikipbxweb_emailconfig_account_id" ON "wikipbxweb_emailconfig" ("account_id");
CREATE INDEX "wikipbxweb_soundclip_account_id" ON "wikipbxweb_soundclip" ("account_id");
CREATE INDEX "wikipbxweb_phonecontact_userprofile_id" ON "wikipbxweb_phonecontact" ("userprofile_id");
CREATE INDEX "wikipbxweb_serverlog_server_id" ON "wikipbxweb_serverlog" ("server_id");
CREATE INDEX "wikipbxweb_serverlog_account_id" ON "wikipbxweb_serverlog" ("account_id");
CREATE INDEX "wikipbxweb_completedcall_account_id" ON "wikipbxweb_completedcall" ("account_id");
CREATE INDEX "wikipbxweb_ivr_account_id" ON "wikipbxweb_ivr" ("account_id");
CREATE INDEX "wikipbxweb_voicemail_account_id" ON "wikipbxweb_voicemail" ("account_id");
CREATE INDEX "wikipbxweb_voicemail_userprofile_id" ON "wikipbxweb_voicemail" ("userprofile_id");
CREATE INDEX "wikipbxweb_userprofile_user_id" ON "wikipbxweb_userprofile" ("user_id");
CREATE INDEX "wikipbxweb_userprofile_account_id" ON "wikipbxweb_userprofile" ("account_id");
COMMIT;

I suspect, as tleyden does, that the upgrade process is reading my old DB and settings, despite the new information being in the settings.py, since none of these tables are actually in the new DB that I have defined when I look in it. When I ran ./manage.py diffsettings it shows the 0.5 database user instead of the one I have defined in the new settings.py.

Steve

Last edited on 1266192091|%e %b %Y, %H:%M %Z|agohover By ssteffler + Show more
Reply  |  Options
Re: Help Upgrading! Blank Screen acessing WSGI through Apache22
tleydentleyden 1266177899|%e %b %Y, %H:%M %Z|agohover

Lets focus on the "syncdb" command not working.

So you are trying upgrade from 0.5 to 0.8? Are you doing it "side by side" style or "in place" style? (eg, from this doc: http://wikipbx.subwiki.com/0-5-to-0-8-migration-guide)

I think what is happening is this:

  • Due to a misconfigured python path, it's actually pulling the OLD code (0.5 version), as well as the OLD settings.py, which means its talking to the OLD database.
  • With old code and old database, syncdb thinks there's nothing to do, and so does nothing

From the command line, echo $PYTHONPATH and post what it says. Or if you created a symlink in your /usr/lib/python2.x/site-packages directory, or multiple symlinks, please specify what you have there.

Reply  |  Options
Re: Help Upgrading! Blank Screen acessing WSGI through Apache22
sstefflerssteffler 1266191506|%e %b %Y, %H:%M %Z|agohover

I am trying to upgrade "side by side" because I don't want to disrupt my existing DB until I know the new installation works. I have created a seperate DB and configured it in the settings.py for 0.8. My old 0.5 is in /usr/src/wikipbx and the new 0.8 is in /usr/src/wikipbx0.8.

$PYTHONPATH is:
PYTHONPATH=/usr/src:/usr/src/freeswitch/scripts/python:/usr/local/lib/python2.5/site-packages

I have this symlink in /usr/local/lib/python2.5/site-packages:
lrwxr-xr-x 1 root wheel 22 Feb 21 2009 django -> /usr/src/django/django

The django in /usr/src/django is the 5024 rev, but is the same one that I set up for wikipbx 0.5.

Thank you for your prompt reply.

Reply  |  Options
Re: Help Upgrading! Blank Screen acessing WSGI through Apache22
sstefflerssteffler 1266191849|%e %b %Y, %H:%M %Z|agohover

Just an update, I have confirmed that the manage.py is using the old installations' settings.py by running ./manage.py diffsettings. It revealed that the DB settings were the ones from the 0.5 settings.py file.

Where do I go from here?

Last edited on 1266192128|%e %b %Y, %H:%M %Z|agohover By ssteffler + Show more
Reply  |  Options
Re: Help Upgrading! Blank Screen acessing WSGI through Apache22
stas_shtinstas_shtin 1266194248|%e %b %Y, %H:%M %Z|agohover

So syncdb works fine, you just where running it on existing database and it didn't have to change anything.

In order to run the new code you should include path to wikiPBX 0.8 in the head of your PYTHONPATH variable when you run ./manage.py commands as well as WSGIPythonPath in your apache config.

Reply  |  Options
Re: Help Upgrading! Blank Screen acessing WSGI through Apache22
sstefflerssteffler 1266195596|%e %b %Y, %H:%M %Z|agohover

stas_shtin: Is that something that needs to be added to the upgrading guide to help others who may run into this issue? Because I wasn't explicitly running it on the old database. I was running it in the new directory of a new installation of 0.8 and the settings.py in that directory had correct DB info for the new database. It chose to run against the old DB, potentially based on my PYTHONPATH but I don't see what's wrong with it.

UPDATE: OK, since upgrading side by side didn't work, I made some backups and attempted an "in place" upgrade.

I followed the "in place" upgrade instructions on the installation guide exactly, edited WSGIPythonPath in my apache config, dropped/re-created the DB, re-ran the manage.py (it created a new DB structure this time, asked for django auth setup, etc as per the Installation guide). Still, after restarting Apache, I get a blank page in my browser, with no errors in any logs.

Last edited on 1266195931|%e %b %Y, %H:%M %Z|agohover By ssteffler + Show more
Reply  |  Options
Re: Help Upgrading! Blank Screen acessing WSGI through Apache22
stas_shtinstas_shtin 1266227066|%e %b %Y, %H:%M %Z|agohover

It chose to run against the old DB, potentially based on my PYTHONPATH but I don't see what's wrong with it.

There's no path to wikipbx in your PYTHONPATH, that's definitely wrong :-) You didn't add it, so the only module that could be imported is the old version that you've symlinked in python's site-packages directory. And if there was no symlink in site-packages you'd probably get an ImportError.

Reply  |  Options
Re: Help Upgrading! Blank Screen acessing WSGI through Apache22
sstefflerssteffler 1266251340|%e %b %Y, %H:%M %Z|agohover

I didn't get an import error, and there aren't any symlinks in site-packages besides the one to /usr/src/django (which is the same version of django the new version depends on).

The part of my PYTHONPATH that says /usr/src (the first entry) is where wikipbx is. There is /usr/src/wikipbx and /usr/src/wikipbx0.8 there. The installation instructions said I could put them side by side with eachother. My PYTHONPATH worked for the old version, and the new version is still located in the PYTHONPATH because it is in /usr/src.

Reply  |  Options
Re: Help Upgrading! Blank Screen acessing WSGI through Apache22
sstefflerssteffler 1266197583|%e %b %Y, %H:%M %Z|agohover

tleyden,

I managed to get more debugging info out of apache. Here is what is happening when it tries to run the WSGI script:

[Mon Feb 15 01:30:00 2010] [info] mod_wsgi (pid=61553): Attach interpreter ''.
[Mon Feb 15 01:30:00 2010] [info] mod_wsgi (pid=61553): Adding '/usr/src/wikipbx0.8' to path.
[Mon Feb 15 01:30:00 2010] [info] mod_wsgi (pid=61553): Adding '/usr/src/django' to path.
[Mon Feb 15 01:30:00 2010] [info] mod_wsgi (pid=61553): Adding '/usr/src/freeswitch/libs/esl/python' to path.
[Mon Feb 15 01:30:00 2010] [debug] proxy_util.c(1801): proxy: grabbed scoreboard slot 1 in child 61553 for worker proxy:reverse
[Mon Feb 15 01:30:00 2010] [debug] proxy_util.c(1820): proxy: worker proxy:reverse already initialized
[Mon Feb 15 01:30:00 2010] [debug] proxy_util.c(1914): proxy: initialized single connection worker 1 in child 61553 for (*)
[Mon Feb 15 01:30:05 2010] [info] mod_wsgi (pid=61551): Create interpreter 'MYHOSTNAMEHERE|'.
[Mon Feb 15 01:30:05 2010] [info] mod_wsgi (pid=61551): Adding '/usr/src/wikipbx0.8' to path.
[Mon Feb 15 01:30:05 2010] [info] mod_wsgi (pid=61551): Adding '/usr/src/django' to path.
[Mon Feb 15 01:30:05 2010] [info] mod_wsgi (pid=61551): Adding '/usr/src/freeswitch/libs/esl/python' to path.
[Mon Feb 15 01:30:05 2010] [notice] child pid 61551 exit signal Segmentation fault (11)
[Mon Feb 15 01:30:05 2010] [info] mod_wsgi (pid=61689): Attach interpreter ''.
[Mon Feb 15 01:30:05 2010] [info] mod_wsgi (pid=61689): Adding '/usr/src/wikipbx0.8' to path.
[Mon Feb 15 01:30:05 2010] [info] mod_wsgi (pid=61689): Adding '/usr/src/django' to path.
[Mon Feb 15 01:30:05 2010] [info] mod_wsgi (pid=61689): Adding '/usr/src/freeswitch/libs/esl/python' to path.
[Mon Feb 15 01:30:05 2010] [debug] proxy_util.c(1801): proxy: grabbed scoreboard slot 1 in child 61689 for worker proxy:reverse
[Mon Feb 15 01:30:05 2010] [debug] proxy_util.c(1820): proxy: worker proxy:reverse already initialized
[Mon Feb 15 01:30:05 2010] [debug] proxy_util.c(1914): proxy: initialized single connection worker 1 in child 61689 for (*)

Note the segfault that is happening there. I believe this is what is causing the blank screen in my browser upon loading. But… I have no idea how to fix that! According to the mod_wsgi FAQ here http://code.google.com/p/modwsgi/wiki/FrequentlyAskedQuestions, I have to essentially rebuild all my Apache modules to make sure that nothing in any of the older modules on my system is linked against a different version of a library than what is currently on my system. Not a lot of fun. :(

I guess I will get back to the other problem (my PYTHONPATH?) after I fix my apache up.

Steve

Last edited on 1266201491|%e %b %Y, %H:%M %Z|agohover By ssteffler + Show more
Reply  |  Options
Re: Help Upgrading! Blank Screen acessing WSGI through Apache22
tleydentleyden 1266252699|%e %b %Y, %H:%M %Z|agohover

The short answer is to change your PYTHONPATH from:

PYTHONPATH=/usr/src:/usr/src/freeswitch/scripts/python:/usr/local/lib/python2.5/site-packages

to

PYTHONPATH=/usr/src/wikipbx0.8:/usr/src/freeswitch/scripts/python:/usr/local/lib/python2.5/site-packages

The part of my PYTHONPATH that says /usr/src (the first entry) is where wikipbx is. There is /usr/src/wikipbx and /usr/src/wikipbx0.8 there. The installation instructions said I could put them side by side with eachother. My PYTHONPATH worked for the old version, and the new version is still located in the PYTHONPATH because it is in /usr/src.

You only want to have the new wikipbx0.8 on your PYTHONPATH. (see above)

The docs need to be updated to clarify this, but please try the change mentioned above and report new behavior with the syncdb command. At this point it should now pickup the correct settings.py and we can go from there.

Reply  |  Options
Re: Help Upgrading! Blank Screen acessing WSGI through Apache22
stefflersteffler 1266453851|%e %b %Y, %H:%M %Z|agohover

OK, editing the PYTHONPATH as you described caused the ./manage.py to work correctly! Thanks for that tip!

Reply  |  Options
Re: Help Upgrading! Blank Screen acessing WSGI through Apache22
tleydentleyden 1266339634|%e %b %Y, %H:%M %Z|agohover

I would try to get a "hello world" python script running under mod_wsgi and see if that segfaults. If you google around or check the mod_wsgi docs you can probably find one.

I've personally never seen that happen.. so I'm not sure what to advise.

Reply  |  Options
Re: Help Upgrading! Blank Screen acessing WSGI through Apache22
stefflersteffler 1266455333|%e %b %Y, %H:%M %Z|agohover

I had to disable mod_python, which was enabled on my Apache because I use it on some of my other virtual hosted sites.

Disabling mod_python made the WSGI connection work.

HOWEVER… :-)

Now I get this error when I hit my domain in the browser:

ViewDoesNotExist at /
Could not import wikipbx.wikipbxweb.views. Error was: No module named _ESL
Request Method:     GET
Request URL:     http://MYHOSTNAMEHERE/
Exception Type:     ViewDoesNotExist
Exception Value:     Could not import wikipbx.wikipbxweb.views. Error was: No module named _ESL
Exception Location:     /usr/src/django/django/core/urlresolvers.py in _get_callback, line 128

When I go into a Python terminal with the PYTHONPATH set to the new one that works :), I see this happening when I try to import esl:

# python
Python 2.5.4 (r254:67916, Nov  5 2009, 18:40:44) 
[GCC 4.2.1 20070719  [FreeBSD]] on freebsd7
Type "help", "copyright", "credits" or "license" for more information.
>>> import ESL
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/src/freeswitch/libs/esl/python/ESL.py", line 7, in <module>
    import _ESL
ImportError: No module named _ESL

As you can see, it's reading the PYTHONPATH and seeing /usr/src/freeswitch/libs/esl/python/ESL.py, but something is causing it not to load it correctly. This is the exact same ESL.py and the exact same django, Python, and FS installation that works with the older WikiPBX.

Any ideas on this one? I really appreciate your help so far! I'm almost there…

Reply  |  Options
Re: Help Upgrading! Blank Screen acessing WSGI through Apache22
tleydentleyden 1266461063|%e %b %Y, %H:%M %Z|agohover

In my case I have the following in my apache config:

WSGIPythonPath [snip]:/usr/src/freeswitch_13501/libs/esl/python

and when I list contents of /usr/src/freeswitch_13501/libs/esl/python I see

-rw-r--r--  1 tleyden src 4.8K 2009-05-28 19:08 ESL.py
-rwxr-xr-x  1 tleyden src 199K 2009-07-10 12:16 _ESL.so

How is your setup different? (aside from the fact you are hopefully using a new fs :)

Did you run "make pymod" as described here: http://wikipbx.subwiki.com/installation-manual-0-8#toc35

Reply  |  Options
Re: Help Upgrading! Blank Screen acessing WSGI through Apache22
sstefflerssteffler 1266513153|%e %b %Y, %H:%M %Z|agohover

Ahh, I didn't see that additional step (make pymod). I have ran gmake pymod and I had to make some edits to the Makefile, even though I am running an SVN build of FreeSWITCH from last week.

So, the new WikiPBX loaded successfully after all of that! :D

Just a suggestion: It would be great if the line in the Wiki that has the "Run make pymod" text was not just a bullet point, as it is a crucial step maybe it should have the same treatment as the "Start Apache2" section below it (where the command the user is meant to type is in a code/PRE block and not just part of a point form note.) I wouldn't have missed this if the formatting were consistent. Nothing major just thought I'd mention it.

I will start a new thread now on another problem I have ran into…;-)

Last edited on 1266513164|%e %b %Y, %H:%M %Z|agohover By ssteffler + Show more
Reply  |  Options
Re: Help Upgrading! Blank Screen acessing WSGI through Apache22
tleydentleyden 1266523486|%e %b %Y, %H:%M %Z|agohover

So, the new WikiPBX loaded successfully after all of that! :D

Excellent!

I will start a new thread now on another problem I have ran into…;-)

Saw that one, will try to get back to you tonight. That import script has been tested (I used it), I'm surprised it's not working. We'll have to debug it. (PS: the profile name doesn't matter)

I wouldn't have missed this if the formatting were consistent. Nothing major just thought I'd mention it.

Yeah, that was badly done, but now it's fixed — thanks for pointing it out. As Stas mentioned you can also update the wiki yourself, but mentioning it in the forum is fine too. The important thing is that it gets fixed and the next user has an improved experience.

Reply  |  Options
Re: Help Upgrading! Blank Screen acessing WSGI through Apache22
stas_shtinstas_shtin 1266489387|%e %b %Y, %H:%M %Z|agohover

Older versions of wikipbx didn't use ESL (Freeswitch's Event Socket Library). It looks like you haven't compiled it. ESL.py is the python wrapper that is present in Freeswitch sources, but it uses _ESL.so shared library that needs to be compiled first.

Reply  |  Options
Re: Help Upgrading! Blank Screen acessing WSGI through Apache22
stas_shtinstas_shtin 1266498455|%e %b %Y, %H:%M %Z|agohover

Btw, mod_wsgi installation inssues page describes how you should build mod_python and mod_wsgi in order for them to coexist without problems.

Reply  |  Options
Re: Help Upgrading! Blank Screen acessing WSGI through Apache22
sstefflerssteffler 1266513271|%e %b %Y, %H:%M %Z|agohover

stas_shtin, That would have been great if it were linked on the mod_wsgi installation instructions page… Can a link be added for other users like me who have never heard of mod_wsgi before attempting to get it working with WikiPBX?

Sorry for all the confusion, I appreciate the hands-on help you have provided.

Reply  |  Options
Re: Help Upgrading! Blank Screen acessing WSGI through Apache22
stas_shtinstas_shtin 1266514961|%e %b %Y, %H:%M %Z|agohover

There's nothing stopping you from making our documentation better - it's a wiki, after all.

Re: Help Upgrading! Blank Screen acessing WSGI through Apache22
stefflersteffler 1267060628|%e %b %Y, %H:%M %Z|agohover

I didn't realize it was editable by anyone. I will try to add what I learned from my experiences, and maybe I can prepare a page about FreeBSD.

Thanks!

Reply  |  Options
New Post
page_revision: 0, last_edited: 1226259295|%e %b %Y, %H:%M %Z (%O ago)
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License