hi I have been trying to add twilio-python library to a google app engine project.As recommended I followed the steps from the link below:http://twilio-python.readthedocs.org/en/latest/appengine.html.
However,I am encountering error messages about which I am a bit clueless.I am providing the log of my app engine launcher
Please have a look and let me know what am I doing wrong.
Heres the log message :
*** Running dev_appserver with the following flags:
--skip_sdk_update_check=yes --port=12081 --admin_port=8005
Python command: /usr/bin/python2.7
Traceback (most recent call last):
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/dev_appserver.py", line 83, in <module>
_run_file(__file__, globals())
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/dev_appserver.py", line 79, in _run_file
execfile(_PATHS.script_file(script_name), globals_)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/devappserver2/devappserver2.py", line 1040, in <module>
main()
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/devappserver2/devappserver2.py", line 1033, in main
dev_server.start(options)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/devappserver2/devappserver2.py", line 758, in start
options.config_paths, options.app_id)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/devappserver2/application_configuration.py", line 831, in __init__
module_configuration = ModuleConfiguration(config_path, app_id)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/devappserver2/application_configuration.py", line 127, in __init__
self._config_path)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/devappserver2/application_configuration.py", line 424, in _parse_configuration
config, files = appinfo_includes.ParseAndReturnIncludePaths(f)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/api/appinfo_includes.py", line 82, in ParseAndReturnIncludePaths
appyaml = appinfo.LoadSingleAppInfo(appinfo_file)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/api/appinfo.py", line 2214, in LoadSingleAppInfo
raise appinfo_errors.EmptyConfigurationFile()
google.appengine.api.appinfo_errors.EmptyConfigurationFile
App Engine tried to load an empty configuration file, your app.yaml file. Hence it's throwing an EmptyConfigurationFile error. App engine needs to be informed about some basic configuration parameters to start serving your app, however basic it is.
The following is a basic app.yaml config file structured for your example:
application: twilio-demo
version: 1
runtime: python27
api_version: 1
threadsafe: true
handlers:
- url: .*
script: helloworld.app
You can read more on Configuring with app.yaml
Related
I am trying to start a socket connection in amazon AMI server, for that I have some existing code which is in python, I am a newbie to python and unable to start that, As I am trying to start that program using this command, I am facing some issues, please check this
from twisted.application import internet, service
from udpecho import Echo
application = service.Application("echo")
echoService = internet.UDPServer(7401, Echo())
echoService.setServiceParent(application)
but its showing error
Traceback (most recent call last):
File "/usr/lib64/python2.6/dist-packages/twisted/application/app.py", line 694, in run
runApp(config)
File "/usr/lib64/python2.6/dist-packages/twisted/scripts/twistd.py", line 23, in runApp
_SomeApplicationRunner(config).run()
File "/usr/lib64/python2.6/dist-packages/twisted/application/app.py", line 411, in run
self.application = self.createOrGetApplication()
File "/usr/lib64/python2.6/dist-packages/twisted/application/app.py", line 494, in createOrGetApplication
application = getApplication(self.config, passphrase)
--- <exception caught here> ---
File "/usr/lib64/python2.6/dist-packages/twisted/application/app.py", line 505, in getApplication
application = service.loadApplication(filename, style, passphrase)
File "/usr/lib64/python2.6/dist-packages/twisted/application/service.py", line 390, in loadApplication
application = sob.loadValueFromFile(filename, 'application', passphrase)
File "/usr/lib64/python2.6/dist-packages/twisted/persisted/sob.py", line 215, in loadValueFromFile
exec fileObj in d, d
File "udp_server.tac", line 4, in <module>
from udpecho import Echo
exceptions.ImportError: No module named udpecho
Failed to load application: No module named udpecho
What should I do for this to run?
Any Working solution is appreciable
I'm trying to make backup of files on my computer in onedrive with duplicity.
I have installed all dependencies, when running duplicity there is the auth link generated which I must open in browser and than in duplicity after giving permissions for app paste the return url.
I do all this steps but duplicity is returning me
Traceback (most recent call last):
File "/usr/bin/duplicity", line 1532, in <module>
with_tempdir(main)
File "/usr/bin/duplicity", line 1526, in with_tempdir
fn()
File "/usr/bin/duplicity", line 1364, in main
action = commandline.ProcessCommandLine(sys.argv[1:])
File "/usr/lib/python2.7/site-packages/duplicity/commandline.py", line 1116, in ProcessCommandLine
backup, local_pathname = set_backend(args[0], args[1])
File "/usr/lib/python2.7/site-packages/duplicity/commandline.py", line 1005, in set_backend
globals.backend = backend.get_backend(bend)
File "/usr/lib/python2.7/site-packages/duplicity/backend.py", line 223, in get_backend
obj = get_backend_object(url_string)
File "/usr/lib/python2.7/site-packages/duplicity/backend.py", line 209, in get_backend_object
return factory(pu)
File "/usr/lib/python2.7/site-packages/duplicity/backends/onedrivebackend.py", line 90, in __init__
self.initialize_oauth2_session()
File "/usr/lib/python2.7/site-packages/duplicity/backends/onedrivebackend.py", line 153, in initialize_oauth2_session
authorization_response=redirected_to)
File "/usr/lib/python2.7/site-packages/requests_oauthlib/oauth2_session.py", line 232, in fetch_token
self._client.parse_request_body_response(r.text, scope=self.scope)
File "/usr/lib/python2.7/site-packages/oauthlib/oauth2/rfc6749/clients/base.py", line 409, in parse_request_body_response
self.token = parse_token_response(body, scope=scope)
File "/usr/lib/python2.7/site-packages/oauthlib/oauth2/rfc6749/parameters.py", line 376, in parse_token_response
validate_token_parameters(params)
File "/usr/lib/python2.7/site-packages/oauthlib/oauth2/rfc6749/parameters.py", line 383, in validate_token_parameters
raise_from_error(params.get('error'), params)
File "/usr/lib/python2.7/site-packages/oauthlib/oauth2/rfc6749/errors.py", line 271, in raise_from_error
raise cls(**kwargs)
InvalidClientError: (invalid_client) The client does not exist. If you are the application developer, configure a new application through the application management site at https://manage.dev.live.com/.
It looks like there is no app with ID which duplicity generate auth link with.
But when I go to the link provided by duplicity I see that "Duplicity is asking for permissions".
So should I add my own app and in some way provide its id to duplicity? (I was searching how to do it but without result) or is it a duplicity bug?
All programmatic interaction with Windows Live requires a client ID,
which uniquely identifies your application to Windows Live. Your
application must include the client ID in every request that it sends
to the Messenger Connect API Service.
You have to register your application as shown in this official Windows Live tutorial:
https://msdn.microsoft.com/en-us/library/ff751474.aspx
And then pass your ID to the application to be able to authentificate in Windows Live in execution time when asking to the API.
You can use the code in
https://github.com/fkalis/bash-onedrive-upload
which also provide full support for upload files which size is bigger then 100MB
I have a pyramid project that works fine when hosted with development.ini, but as soon as I use production.ini I get this error in browser:
Internal Server Error
The server encountered an unexpected internal server error
(generated by waitress)
and this log in terminal:
Starting subprocess with file monitor
Starting server in PID 5912.
serving on http://0.0.0.0:6543
2014-05-26 16:54:23,139 ERROR [waitress][Dummy-2] Exception when serving /
Traceback (most recent call last):
File "/home/roman/Critical_ID/CCG_Map/local/lib/python2.7/site-packages/waitress-0.8.9-py2.7.egg/waitress/channel.py", line 337, in service
task.service()
File "/home/roman/Critical_ID/CCG_Map/local/lib/python2.7/site-packages/waitress-0.8.9-py2.7.egg/waitress/task.py", line 173, in service
self.execute()
File "/home/roman/Critical_ID/CCG_Map/local/lib/python2.7/site-packages/waitress-0.8.9-py2.7.egg/waitress/task.py", line 392, in execute
app_iter = self.channel.server.application(env, start_response)
File "/home/roman/Critical_ID/CCG_Map/local/lib/python2.7/site-packages/pyramid/router.py", line 242, in __call__
response = self.invoke_subrequest(request, use_tweens=True)
File "/home/roman/Critical_ID/CCG_Map/local/lib/python2.7/site-packages/pyramid/router.py", line 217, in invoke_subrequest
response = handle_request(request)
File "/home/roman/Critical_ID/CCG_Map/local/lib/python2.7/site-packages/pyramid/tweens.py", line 21, in excview_tween
response = handler(request)
File "/home/roman/Critical_ID/CCG_Map/local/lib/python2.7/site-packages/pyramid_tm-0.7-py2.7.egg/pyramid_tm/__init__.py", line 82, in tm_tween
reraise(*exc_info)
File "/home/roman/Critical_ID/CCG_Map/local/lib/python2.7/site-packages/pyramid_tm-0.7-py2.7.egg/pyramid_tm/__init__.py", line 63, in tm_tween
response = handler(request)
File "/home/roman/Critical_ID/CCG_Map/local/lib/python2.7/site-packages/pyramid/router.py", line 163, in handle_request
response = view_callable(context, request)
File "/home/roman/Critical_ID/CCG_Map/local/lib/python2.7/site-packages/pyramid/config/views.py", line 377, in rendered_view
context)
File "/home/roman/Critical_ID/CCG_Map/local/lib/python2.7/site-packages/pyramid/renderers.py", line 418, in render_view
return self.render_to_response(response, system, request=request)
File "/home/roman/Critical_ID/CCG_Map/local/lib/python2.7/site-packages/pyramid/renderers.py", line 441, in render_to_response
result = self.render(value, system_values, request=request)
File "/home/roman/Critical_ID/CCG_Map/local/lib/python2.7/site-packages/pyramid/renderers.py", line 421, in render
renderer = self.renderer
File "/home/roman/Critical_ID/CCG_Map/local/lib/python2.7/site-packages/pyramid/decorator.py", line 37, in __get__
val = self.wrapped(inst)
File "/home/roman/Critical_ID/CCG_Map/local/lib/python2.7/site-packages/pyramid/renderers.py", line 404, in renderer
'No such renderer factory %s' % str(self.type))
ValueError: No such renderer factory .mak
I copied over my sqlalchemy.url and mako.directories under the [app:main] section in the .ini files, and I can't see what is causing this error.
I start the server with: ../bin/pserve/production.ini --reload
What am I missing?
This is because the latest versions of Pyramid do not require/install Mako's templating engine by default. To fix this error, as documented HERE, you must do two things:
Make sure the pyramid_mako package is installed. One way to do this is by adding "pyramid_mako" to the install_requires section of your package's setup.py file and afterwards rerunning setup.py develop:
setup(
#...
install_requires=[
'pyramid_mako', # new dependency
'pyramid',
#...
],
)
Within the portion of your application which instantiates a Pyramid Configurator (often the main() function in your project's __init__.py file), tell Pyramid to include the pyramid_mako includeme:
config = Configurator(.....)
config.include('pyramid_mako')
When I try to deploy my app I get the following error:
Starting update of app: flyingbat123, version: 0-1
Getting current resource limits.
Password for avigmati: Traceback (most recent call last):
File "C:\Program Files (x86)\Google\google_appengine\appcfg.py", line 125, in
run_file(__file__, globals())
File "C:\Program Files (x86)\Google\google_appengine\appcfg.py", line 121, in run_file
execfile(script_path, globals_)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 4062, in
main(sys.argv)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 4053, in main
result = AppCfgApp(argv).Run()
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 2543, in Run
self.action(self)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 3810, in __call__
return method()
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 3006, in Update
self.UpdateVersion(rpcserver, self.basepath, appyaml)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 2995, in UpdateVersion
self.options.max_size)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 2122, in DoUpload
resource_limits = GetResourceLimits(self.rpcserver, self.config)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 355, in GetResourceLimits
resource_limits.update(GetRemoteResourceLimits(rpcserver, config))
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 326, in GetRemoteResourceLimits
version=config.version)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appengine_rpc.py", line 379, in Send
self._Authenticate()
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appengine_rpc.py", line 437, in _Authenticate
super(HttpRpcServer, self)._Authenticate()
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appengine_rpc.py", line 281, in _Authenticate
auth_token = self._GetAuthToken(credentials[0], credentials[1])
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appengine_rpc.py", line 233, in _GetAuthToken
e.headers, response_dict)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appengine_rpc.py", line 94, in __init__
self.reason = args["Error"]
AttributeError: can't set attribute
2012-04-25 19:30:15 (Process exited with code 1)
The following is my app.yaml:
application: flyingbat123
version: 0-1
runtime: python
api_version: 1
threadsafe: no
It seems like an authentication error, but I'm entering a valid email and password.
What am I doing wrong?
I had the same problem.
I'm using 2 factor authentication for my google account, so I previously had to enter a application specific password to deploy apps to GAE. If I entered my normal google password I got the AttributeError: can't set attribute error. However when I created an application specific password and used it, it worked
The error message indicates that there is a bug in our SDK. Because of this bug, you can not see the reason of the failure. However, this code block is called only when the authentication request ends up with 403 HTTP error.
You can temporary tweak the file C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appengine_rpc.py as follows to see the actual reason(add logger.warn(body) line).
except urllib2.HTTPError, e:
if e.code == 403:
body = e.read()
# Add a line bellow to see the actual error
logger.warn(body)
response_dict = dict(x.split("=", 1) for x in body.split("\n") if x)
raise ClientLoginError(req.get_full_url(), e.code, e.msg,
e.headers, response_dict)
else:
raise
Once if you find the reason, this issue must be much easier to solve. After you solve the problem, I'd appreciate it if you could create an issue about this mysterious error message in our issue tracker?
I know this doesn't answer the OP question, but it may help others who experience problems using --oauth2 mentioned by others in this question.
I have 2-step verification enabled, and I had been using the application-specific password, but found it tedious to look up and paste the long string every day or so. I found that using --oauth2 returns
This application does not exist (app_id=u'my-app-id')
but by adding the --no_cookies option
appcfg.py --oauth2 --no_cookies update my-app-folder\
I can now authenticate each time by just clicking [Allow access] in the browser window that is opened.
I'm using Python SDK 1.7.2 on Windows 7
NOTE: I found this solution elsewhere, but I can't remember where, so I can't properly attribute it. Sorry.
.
I had the same problem and after inserting logger.warn(body), I get this:
WARNING appengine_rpc.py:231 Error=BadAuthentication
Info=InvalidSecondFactor
The standard error message could have been more helpful, but this makes me wonder if I should not use an application specific password?
Add the --oauth2 flag to appcfg.py update for an easier fix
This also happens if your default_error value overlaps with your static_dirs in app.yaml.
After doing everything from here
http://code.google.com/appengine/docs/python/tools/appstats.html
I get
<class 'google.appengine.api.users.NotAllowedError'>:
Traceback (most recent call last):
File "/base/python_runtime/python_lib/versions/1/google/appengine/ext/appstats/ui.py", line 324, in <module>
main()
File "/base/python_runtime/python_lib/versions/1/google/appengine/ext/appstats/ui.py", line 320, in main
util.run_bare_wsgi_app(app)
File "/base/python_runtime/python_lib/versions/1/google/appengine/ext/webapp/util.py", line 116, in run_bare_wsgi_app
result = application(env, _start_response)
File "/base/python_runtime/python_lib/versions/1/google/appengine/ext/appstats/ui.py", line 308, in __call__
users.create_login_url(os.getenv('PATH_INFO', '')))])
File "/base/python_runtime/python_lib/versions/1/google/appengine/api/users.py", line 256, in create_login_url
raise NotAllowedError
when trying to access myapp.appspot.com/_ah/stats or just myapp.appspot.com/stats/
Most likely you have created your app with authentication set to only allow users from your Google Apps domain, but you're attempting to access appstats via the appspot.com subdomain. Try again using the URL for your app on your custom domain.