Cant able to run the appliaction on appnegine SDK - python

I just tried to run the sample application(gustbook) on google app engine SDK. But it showing warning symbol for that apps.
I have re-insalled both python2.5 & GAE. Still app is not running.
Here is the Log:-
2011-12-07 11:15:51 Running command: "['C:\\Python25\\pythonw.exe', 'C:\\Program Files\\Google\\google_appengine\\dev_appserver.py', '--admin_console_server=', '--port=8080', u'C:\\Users\\Nijin\\Documents\\guestbook']"
WARNING 2011-12-07 03:16:00,286 urlfetch_stub.py:111] No ssl package found. urlfetch will not be able to validate SSL certificates.
WARNING 2011-12-07 03:16:02,512 rdbms_mysqldb.py:90] The rdbms API is not available because the MySQLdb library could not be loaded.
ERROR 2011-12-07 03:16:03,213 dev_appserver_main.py:632] <type 'exceptions.EOFError'>:
2011-12-07 11:16:03 (Process exited with code 1)
Screenshot: http://dl.dropbox.com/u/7384181/publish/sdk_error.JPG

I'm guessing you got invalid characters in one of your strings,
could you give us some code to work with and perhaps some working data?
I'm also guessing you're using the proper urlfetch function and not some home-brew socket solution because that wont work.
http://code.google.com/appengine/docs/python/urlfetch/fetchfunction.html
Try switching to Python 2.7, it's supported and should work better with most libs.
Are you using django-nonrel or something similar?

Related

503 Litespeed Python error: The server is temporarily busy, try again later

I am using shared linux hosting and I am trying to setup a Python app using the Python selector. Firstly, when you setup the app, the website should be saying:
It works! and the python version.
However I am getting a 503 error saying The server is temporarily busy, try again later!.
I tried setting up an app using the NodeJS selector and it worked without a problem. The server that the hosting uses is Litespeed. I have no root access.
If anyone can help, I will be very thankful!

While creating python file on IIS with django Error 500

When I try to create a Python file (.py) in my Django application, I get an error 500. The file is created, and the code isn't the problem. I can create a text file or any other format. It would need to be a Python file because I need it for further steps.
I am using Windows 10 and running the Django application on IIS. Windows, IIS and Django are all up-to-date.
I already tried to add permission to the folder I will edit. I tested around with some other settings but haven't figured out the problem yet. I think it should be something with permission of IIS or Django.
This is my error message:
d:\django\virtualenv0\scripts\python.exe - The FastCGI process exited unexpectedly
Most likely causes:
IIS received the request; however, an internal error occurred during the processing of the request. The root cause of this error depends on which module handles the request and what was happening in the worker process when this error occurred.
IIS was not able to access the web.config file for the Web site or application. This can occur if the NTFS permissions are set incorrectly.
IIS was not able to process configuration for the Web site or application.
The authenticated user does not have permission to use this DLL.
The request is mapped to a managed handler but the .NET Extensibility Feature is not installed.
Things you can try:
Ensure that the NTFS permissions for the web.config file are correct and allow access to the Web server's machine account.
Check the event logs to see if any additional information was logged.
Verify the permissions for the DLL.
Install the .NET Extensibility feature if the request is mapped to a managed handler.
Create a tracing rule to track failed requests for this HTTP status code. For more information about creating a tracing rule for failed requests, click here.
Detailed Error Information:
Module FastCgiModule
Notification ExecuteRequestHandler
Handler Python FastCGI
Error Code 0x00000000
Requested URL https://alpha.truningerag.ch:443/projects/realtest/
Physical Path D:\django\projects\realtest\
Logon Method Anonymous
Logon User Anonymous
More Information:
This error means that there was a problem while processing the request. The request was received by the Web server, but during processing a fatal error occurred, causing the 500 error.
View more information ยป
Microsoft Knowledge Base Articles:
294807
I was able to solve my problem. I switch from IIS to Apache which didnt had any problem with creating a .py file anymore. After that I got an empty models file. The only thing left to do was to add in the absolute path python in the os.system(command).
Now everything works fine.
you need to check some below settings:
1)you enable iis CGI feature.
2)ensure pip and setup tools are fully upgraded:
python -m pip install pip --upgrade && pip install setuptools --upgrade
3)install the virtualenv tool:
pip install virtualenv
4)Activate the virtualenv so all our commands affect this interpreter.
C:\inetpub\wwwroot\mydjangoproject\> venv\scripts\activate
5)Configured the WFast CGI in iis.
6)"d:\django\virtualenv0\" path has iis_iusrs and iusr full control permission.
7)check iis application pool identity which server Django project.
for more detail, you could refer this link.
and please share your web.config file for more detail about the issue.

Flask app fails to render when deploying code to Azure Web with a database connection, but works fine from local server

I have an Azure web app with a Flask template. I want it to connect to a SQL database. I made one. I installed pymssql. For testing purposes I added to the views.py in the root folder:
import pymssql
conn = pymssql.connect(server='mydb.database.windows.net', user='mydbnameadmin#mydb', password='secret', database='mydb')
I first tested locally on my kubuntu box. To make sure I was getting a connection, I entered the wrong password, and the server threw an error. I entered it correctly and the error disappeared. Cool. Also the SQL dashboard on the azure portal reported sucessfull connections. So then I pushed my changes (including updating the requirements.txt) to my github repo and it was sucked into my web application. When I tried running the web app, on the index page:
The page cannot be displayed because an internal server error has
occurred.
After turning on and inspecting the detailed logs all I get it:
HTTP Error 500.0 - Internal Server Error
The page cannot be displayed because an internal server error has occurred.
Most likely causes:
IIS received the request; however, an internal error occurred during the processing of the request. The root cause of this error depends on which module handles the request and what was happening in the worker process when this error occurred.
IIS was not able to access the web.config file for the Web site or application. This can occur if the NTFS permissions are set incorrectly.
IIS was not able to process configuration for the Web site or application.
The authenticated user does not have permission to use this DLL.
The request is mapped to a managed handler but the .NET Extensibility Feature is not installed.
IIS. What's that doing here? I thought MS was trendy and hosted this service on a linux box 0_0
I remove the second line
conn = pymssql.connect(server='mydb.database.windows.net', user='mydbnameadmin#mydb', password='secret', database='mydb')
and the error disappeared. If I run a server locally, which still uses the Azure SQL server, I don't have any issues.
This seems to be the same issue I have:
https://social.msdn.microsoft.com/Forums/sqlserver/en-US/e20bb2a3-bdbe-4e49-8b92-b36fe50577da/having-trouble-deploying-flask-app-into-azure-with-azure-database?forum=windowsazurewebsitespreview&prof=required
but they say whether they actually got it working with a SQL database...
what do people think?
Thanks
my requirements.txt
alembic==0.7.7
azure==0.11.1
Flask==0.10.1
Flask-Migrate==1.5.0
Flask-Script==2.0.5
Flask-SQLAlchemy==2.0
futures==3.0.3
itsdangerous==0.24
Jinja2==2.8
Mako==1.0.1
MarkupSafe==0.23
pymssql==2.1.1
python-dateutil==2.4.2
six==1.9.0
SQLAlchemy==1.0.8
Werkzeug==0.10.4
wheel==0.24.0
Per my understanding, Azure Web sites are hosted on Windows Server 2012 VM by default, which would not install FreeTDS and also we don't have permission to install it. And the pymssql is based on FreeTDS.
So we can use pyodbc to connect the Azure SQL as a workaround way to handle it in ease.
I was able to successfully connect my Python code to a SQL Database on Azure using the pymssql 2.1 library.
I don't know if this is what is causing the problem but I did include a couple of extra parameters in my connection string... maybe that will help. I specified the driver explicitly and the Encrypt parameter since SSL is always enabled for SQL Azure (I believe)
myConnection = pyodbc.connect('Driver={SQL Server};'
'Server=tcp:1234567.database.windows.net,1433;'
'Database=MyAzureDatabase;'
'Uid=geekgirl#123456;Pwd=abcdef;'
'Encrypt=yes')
If that doesn't work, maybe try adding some error handling around the connect statement to try and get a more specific error message.
Fingers crossed!
I had this problem, but I eventually realized it was because I was using the 64-bit version of Python in Visual Studio, but Azure only supports the 32-bit version.
I was seeing:
DLL load failed: %1 is not a valid Win32 application.
Once I switched to installing and using the 32-bit version I was able to use Flask and pyodbc with no problems.

Google App Engine local development server SSL warning (Python 2.7)

Each time I upload my app to Google App Engine, the logs always show this warning:
WARNING appengine_rpc.py:435 ssl module not found. Without the ssl
module, the identity of the remote host cannot be verified, and
connections may NOT be secure. To fix this, please install the ssl
module from http://pypi.python.org/pypi/ssl .
I'm running a virtualenv with Python 2.7. When I'm in it, I try to run
$ pip install ssl
but this produces an error:
ValueError: This extension should not be used with Python 2.6 or later
(already built in), and has not been tested with Python 2.3.4 or earlier.
If ssl is built in to Python 2.7, how do I tell the local development server to use the built in ssl module?
It sounds like appcfg.py is not using your virtualenv correctly. You can try editing the appcfg.py script so that it prints sys.version and sys.path, to confirm that it's using your virtualenv correctly. (The shebang line is "#!/usr/bin/env python", so that should use your active environment, but it's worth checking.)
If you're using the Launcher, you need to tell it explicitly where to look for your virtualenv's Python. Go to Preferences, and set the Python Path to your virtualenv's Python 2.7. The Launcher prints which Python path it is using in the Logs (at least when starting the dev server).

Segmentation Fault (11) on httpd when python-ldap is initialized

I'm using mod_wsgi for a Django application (OSQA) on RHEL 5 with Python 2.43 (cannot upgrade).
I had the site set up and working fine, and then tried to integrate the authentication with python-ldap for accessing Active Directory attributes e.g. a user's name, email address etc.
Apache httpd crashes with the following message:
[notice] child pid 18705 exit signal Segmentation fault (11)
I originally thought this was due to inconsisten expat libraries between Apache and Python, but I have since upgraded the libexpat.so module to match the Python version of pyexpat (1.95.8).
From heavy logging in the django log, I can see the seg fault occurs when this line is executed:
con = ldap.initialize(AD_LDAP_URL)
Is there something specific with python-ldap causing this issue? Any other thoughts on how to debug?
Thanks
Try disabling any Apache modules for auth which use LDAP. Also try disabling mod_php if being used and it is loading a LDAP extension. In short, library version conflict may be because of LDAP libraries rather than expat, so disable the other Apache modules and see if problem goes away. That will narrow it down.

Categories

Resources