google-app-engine 1.9.19 deploy failure - python

When trying to deploy using the new Python GoogleAppEngine-1.9.19 in the form of the GAE launcher on Windows 7, I'm not asked to authenticate. Instead, I get a page for accepting GAE management, and then I'm running locally. Moreover, clicking the close box on the launcher does nothing and I have to kill it externally.
I don't understand the error messages or what to do. I don't have a file named old_run.py. I uninstalled 1.9.19 and reinstalled 1.9.18, and deploy works as always. Is 1.9.19 broken?
2015-04-15 11:27:47 Running command: "['C:\\Python27\\python.exe', '-u', 'C:\\Program Files (x86)\\Google\\google_appengine\\appcfg.py', '--oauth2', 'update', 'M:\\HP_Cdrive\\workspace\\glowscript']"
11:27 AM Application: glowscript; version: 1
11:27 AM Host: appengine.google.com
11:27 AM
Starting update of app: glowscript, version: 1
11:27 AM Getting current resource limits.
2015-04-15 11:27:50,838 WARNING old_run.py:88 This function, oauth2client.tools.run(), and the use of the gflags library are deprecated and will be removed in a future version of the library.
Your browser has been opened to visit:
https://accounts.google.com/o/oauth2/auth?scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fappengine.admin+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcloud-platform&redirect_uri=http%3A%2F%2Flocalhost%3A8080%2F&response_type=code&client_id=550516889912.apps.googleusercontent.com&access_type=offline
If your browser is on a different machine then exit and re-run
this application with the command-line parameter
--noauth_local_webserver

It's an issue with Google App Engine SDK, which doesn't allow the user authentication process to be completed, if local server is running.
Step 1. Stop the local server.
Step 2. Click on 'Deploy'
Step 3. You should get a message "The authentication flow has completed."
Step 4. Close the Window.
Step 5. Deploy again using Google App Engine. You should receive a message You
can close this window now.

you just have to shut down the server I use the google app engine luncher run and stop then deploy

Sorry about that - the tooling is in the process of changing. The docs should be updated shortly.
Try gcloud preview app deploy path-to/your.yaml --project myProjectID

You can deploy successfully in 1.9.19 by using command line.
appcfg.py update myapp/
Use an application-specific password instead of your regular account password.
In any case, you'll get a message that:
now the recommended way to log in is using OAuth2. See
https://developers.google.com/appengine/docs/python/tools/uploadinganapp#Python_
Password-less_login_with_OAuth2

If you are having problems with the redirection to localhost:8085, you can try to use wget from the server you're trying to authenticate, something like:
wget http://localhost:8085/?code=4/SOMELONGKEY#
After this you should be logged.

In my case, there was not version parameter in app.yaml file. When I add the parameter it has worked.
application: myappname
runtime: python27
api_version: 1
threadsafe: true
version: 1

Related

install additional on azure for use with python webapp

I am creating a webapp using Dash. I have created the requirements file to install the different python modules I need.
One of the modules, Pyspice, works as interface to a program called ngspice. The question is how do I install ngspice on the azure app plan I have. I can see the app plan is running Linux. But how do I add this linux library so the python app can use it?
I have this documentation from pyspice, see 4.2
https://pyspice.fabrice-salvaire.fr/releases/v1.4/installation.html
But I don't know how to proceed.
UPDATE:
I created an startup.sh file which include
apt-get update
apt-get -y install ngspice
gunicorn --bind=0.0.0.0 --timeout 600 app:app
Looking in the application log in azure shows that it install ngspice and the app start. But pyspice in python cannot do the analysis. So still some more needs to be done.
UPDATE:
Using the above script then to connect the pyspice to ngspice just use this command:
simulator = circuit.simulator(temperature=25, nominal_temperature=25, simulator='ngspice-subprocess', spice_command='ngspice')
So when defining simulator as ngspice-subprocess and spice command as ngspice then it works ! :)
You can open an SSH session via azure portal, in your app service blade:
Also, you can open an SSH session in browser
Paste the following URL into your browser and replace with your app name:
https://<app-name>.scm.azurewebsites.net/webssh/host
More info: https://learn.microsoft.com/en-us/azure/app-service/configure-linux-open-ssh-session
UPDATED:
To configure the startup command you must add the script here
More info: https://learn.microsoft.com/en-us/azure/app-service/configure-common?tabs=portal#configure-general-settings
Hope this helps!

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.

how to diagnose Apache2.4 service error 7024 Incorrect function

System:
Windows 10 x64 (enterprise computer with some restrictions)
Apache 2.4 64-bit
Python 3.7.1 64-bit
mod_wsgi (built today from github using python setup.py install)
I am working on getting an Apache server with Python on a Windows machine and I have the server configured correctly in order to get the Hello World! example from mod_wsig documentation working.
If I simply launch C:\Apache24\bin\httpd.exe, this works and I see Hello World at http://localhost:5000/
Then I wanted to get it running as a service, so I call
httpd.exe -k install
In the ApacheMonitor I start the new Apache2.4 service but I get a failed to start error. In the Windows system event log it says Event ID: 7024 with a service specific error: Incorrect function.
When I run httpd.exe -k start -n "Apache2.4" -t it says Syntax OK
What I can't find is any more information about the service error. Nothing populates in the error.log file and I don't know where else to look, and I am asking for any further information on how to diagnose this.
Before I started configuring Apache to use mod_wsgi, launching the service was successful, so this happened after doing that, and I haven't configured anything else at this point.
Go to the Command Prompt move to the apache/bin folder and type
>httpd -t
This will give you more information about the error preventing Apache from start.
I was getting this error after updating my httpd.conf file. The problem was that my final xml tag in httpd.conf was unclosed </directory without the closing >.
This days I was facing the same situation, windows 10, apache24, django app, python3.8, failing to start as service, service events showing error 7024...
So, after a lot of struggling and research, I would like to add my solution even this is an old question.
The solution was to add two environment variables, no in httpd.conf, not in python code/conf but at SO level (windows > environment variables)
PYTHONHOME = c:\your\path\to\installed\python
PYTHONPATH = c:\your\path\to\installed\virtualenv
And magic! apache now works as service and the django app is always available on localhost

Google cloud SDK stalls without error message

I am trying to learn how to use Google Appengine with python, using PyCharm Pro as trial. In have installed the Cloud SDK and it is active as indicated by getting access to both admin page and the Hello World! page. I had to overcome cannot bind problem by changing the port using dev_appserver.py
After that when I try to run the app in python, I get the following lines
INFO 2017-05-16 03:23:13,314 sdk_update_checker.py:231] Checking for updates to the SDK.
INFO 2017-05-16 03:23:13,458 sdk_update_checker.py:259] The SDK is up to date.
INFO 2017-05-16 03:23:13,517 api_server.py:272] Starting API server at: http://localhost:51009
INFO 2017-05-16 03:23:13,520 dispatcher.py:205] Starting module "default" running at: http://127.0.0.1:9000
INFO 2017-05-16 03:23:13,522 admin_server.py:116] Starting admin server at: http://localhost:8000
and it stalls there, nothing else happens and I get no error messages. I tried taking all the code out of the app.py file and just put a simple print('hello') and still does the same. tried restarting and reinitializing the Cloud SDK as well as the whole computer and still the same.
I am using MacOS and python venv as interpreter with webapp2 installed.
I looked in this forum and in multiple others and didn't see this problem described any where.
Also worth mentioning that the firewall is off

google app engine - permission denied error

The problem
my appication won't update on the dev server or the live server unless I do step 3 (below), every single time. Otherwise, I will get permission problems as shown below
e2016-01-08 12:47:58,781 ERROR appcfg.py:2438 An error occurred processing file '': HTTP Error 403: Forbidden Unexpected HTTP status 403. Aborting.
Error 403: --- begin server output ---
You do not have permission to modify this app (app_id=u's~project-name').
--- end server output ---
I'd ideally like to test just using dev_appserver.py
Things I've already tried
appcfg.py update --no_cookies . after the webpage opened for me to sign in, I got
No data received
ERR_EMPTY_RESPONSE
and my terminal was stuck on " --noauth_local_webserver "
appcfg.py rollback . That leaves me with the same error:
Error 403: --- begin server output ---
You do not have permission to modify this app (app_id=u's~').
--- end server output ---
appcfg.py -A <project name> update . This just returns error from step above
appcfg.py --no_cookies --oauth2 --email=myemail --noauth_local_webserver update . this uploads the project to my server, but, I'm tired of having to 'allow' then paste the code back into the terminal every single time
shutting down app engine launcher, removing project from launcher then adding back
restarting computer, turing off computer
launching from the terminal, launching from app engine launcher
Note: I'm already signed into google chrome
What should I try next?
Every time you use the '--no_cookies' option, you are telling appcfg to never save your credentials, so it's always going to prompt you every time you upload your app.
Running appcfg.py update app.yaml or appcfg.py update <dir_name> just once should be sufficient, since the '--oauth2' option is now the default and currently the only support authentication method.
On a side note, appcfg stores certain files under your user directory (C:\Users\<username> on Windows, or /home/<username> on Linux / Mac) named '.appcfg_*' for its cookies and saved auth tokens. You may need to show hidden files / extensions to see them. Sometimes deleting these files and re-running appcfg can help with auth not working.

Categories

Resources