Cannot deploy to GAE - python

08:38 AM Scanning files on local disk.
2013-01-30 08:38:30,884 ERROR appcfg.py:1856 Invalid character in filename: Icon
Error 409: --- begin server output ---
Another transaction by user SLim is already in progress for app: s~pekkylab, version: 1. That user can undo the transaction with "appcfg rollback".
--- end server output ---
Password for myemail#email.com: If deploy fails you might need to 'rollback' manually.
The "Make Symlinks..." menu option can help with command-line work.
*** appcfg.py has finished with exit code 1 ***
While i'm trying to upload i got this error and then follow its instructor to perform rollback then i getting the other error here
08:41 AM Application: pekkylab
08:41 AM Host: appengine.google.com
08:41 AM Rolling back the update.
Traceback (most recent call last):
File "/usr/local/bin/appcfg.py", line 171, in <module>
run_file(__file__, globals())
File "/usr/local/bin/appcfg.py", line 167, in run_file
execfile(script_path, globals_)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 4377, in <module>
main(sys.argv)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 4368, in main
result = AppCfgApp(argv).Run()
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 2605, in Run
self.action(self)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 4103, in __call__
return method()
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 3553, in Rollback
self._Rollback()
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 3569, in _Rollback
appversion.Rollback()
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 2151, in Rollback
self.Send('/api/appversion/rollback')
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 1842, in Send
return self.rpcserver.Send(url, payload=payload, **self.params)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appengine_rpc.py", line 391, in Send
f = self.opener.open(req)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 391, in open
response = self._open(req, data)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 409, in _open
'_open', req)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 369, in _call_chain
result = func(*args)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1181, in https_open
return self.do_open(httplib.HTTPSConnection, req)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/fancy_urllib/fancy_urllib/__init__.py", line 379, in do_open
url_error.reason.args[1])
fancy_urllib.InvalidCertificateException: Host appengine.google.com returned an invalid certificate (_ssl.c:499: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed):
To learn more, see http://code.google.com/appengine/kb/general.html#rpcssl
Any clue why is this happening?

I'm guessing you are working on a MacOS and this file is the Icon? (read more on SU answer). You can easily verify it if you list all the files from your terminal: ls.
In order to skip that file add this in end of your app.yaml file and redeploy:
skip_files:
- ^(.*/)?Icon\r
You can read more on skipping files in the docs.
Also you might need to rollback before redeploying:
appcfg.py rollback /path/to/project
And if nothing works out for you, just try to deploy to a new application and try again another day :)

Probably there is some exotic character in the filename of an icon, as the log states.
Rename it, and update your application to use the renamed version.
You should rollback the transaction manually ("appcfg rollback"), and then try to deploy again.

Try to deploy with the parameter no_cookies in that fashion appcfg.py update . --no_cookies

You probably have a custom icon for your app folder... That generate a "hidden" Icon file, delete it.

Related

zipfile.BadZipFile: File is not a zip file

I am installing Prodigy,
( a software for data annotation). I am using windows 10, Python 3.7. pip is updated I need to use wheel python:
https://github.com/MacPython/wiki/wiki/Spinning-wheels
when I write in my anaconda
:
'''
pip install prodigy-1.7.1-cp35.cp36.cp37-cp35m.cp36m.cp37m-win_amd64.whl
'''
(based on instruction in website)
https://prodi.gy/docs/
I faced with this error (zipfile.BadZipFile: File is not a zip file)
'''
ERROR: Exception: Traceback (most recent call last): File “c:\users\moha\anaconda3\lib\site-packages\pip_internal\cli\base_command.py”, line 178, in main status = self.run(options, args) File “c:\users\moha\anaconda3\lib\site-packages\pip_internal\commands\install.py”, line 352, in run resolver.resolve(requirement_set) File “c:\users\moha\anaconda3\lib\site-packages\pip_internal\resolve.py”, line 131, in resolve self._resolve_one(requirement_set, req) File “c:\users\moha\anaconda3\lib\site-packages\pip_internal\resolve.py”, line 294, in _resolve_one abstract_dist = self._get_abstract_dist_for(req_to_install) File “c:\users\moha\anaconda3\lib\site-packages\pip_internal\resolve.py”, line 242, in _get_abstract_dist_for self.require_hashes File “c:\users\moha\anaconda3\lib\site-packages\pip_internal\operations\prepare.py”, line 353, in prepare_linked_requirement progress_bar=self.progress_bar File “c:\users\moha\anaconda3\lib\site-packages\pip_internal\download.py”, line 873, in unpack_url unpack_file_url(link, location, download_dir, hashes=hashes) File “c:\users\moha\anaconda3\lib\site-packages\pip_internal\download.py”, line 807, in unpack_file_url unpack_file(from_path, location, content_type, link) File “c:\users\moha\anaconda3\lib\site-packages\pip_internal\utils\misc.py”, line 628, in unpack_file flatten=not filename.endswith(’.whl’) File “c:\users\moha\anaconda3\lib\site-packages\pip_internal\utils\misc.py”, line 505, in unzip_file zip = zipfile.ZipFile(zipfp, allowZip64=True) File “c:\users\moha\anaconda3\lib\zipfile.py”, line 1222, in init self._RealGetContents() File “c:\users\moha\anaconda3\lib\zipfile.py”, line 1289, in _RealGetContents raise BadZipFile(“File is not a zip file”) zipfile.BadZipFile: File is not a zip file
'''
can anyone let me know what should I do?
This exception means that there was a problem reading the package source file when installing. Although they are referred as wheels they are actually zip files.
There are many reasons why you might see this exception. The most common reason is that there was a problem with downloading/storing.
The most common solution is to try install again. This might need removing old download in some cache. Read logs to see where the cache is. You can also look for the the file by its name.

Google App Engine (python) - Connecting to local datastore via python script

I've been able to connect from a local script directly to the Google App Engine (GAE) ndb store on the server as described in this article.
But I'm trying to do the same thing to access my local dev server but am not able to. My dev API server runs at http://localhost:42020 but when I try to connect using the following command:
$ remote_api_shell.py -s http://localhost:42020
I get the following error:
Traceback (most recent call last):
File "/home/myuser/google_appengine/remote_api_shell.py", line 127, in <module>
run_file(__file__, globals())
File "/home/myuser/google_appengine/remote_api_shell.py", line 123, in run_file
execfile(_PATHS.script_file(script_name), globals_)
File "/home/myuser/google_appengine/google/appengine/tools/remote_api_shell.py", line 150, in <module>
main(sys.argv)
File "/home/myuser/google_appengine/google/appengine/tools/remote_api_shell.py", line 146, in main
appengine_rpc.HttpRpcServer)
File "/home/myuser/google_appengine/google/appengine/tools/remote_api_shell.py", line 74, in remote_api_shell
rpc_server_factory=rpc_server_factory)
File "/home/myuser/google_appengine/google/appengine/ext/remote_api/remote_api_stub.py", line 874, in ConfigureRemoteApi
app_id = GetRemoteAppIdFromServer(server, path, rtok)
File "/home/myuser/google_appengine/google/appengine/ext/remote_api/remote_api_stub.py", line 569, in GetRemoteAppIdFromServer
response = server.Send(path, payload=None, **urlargs)
File "/home/myuser/google_appengine/google/appengine/tools/appengine_rpc.py", line 424, in Send
f = self.opener.open(req)
File "/usr/lib/python2.7/urllib2.py", line 401, in open
response = self._open(req, data)
File "/usr/lib/python2.7/urllib2.py", line 419, in _open
'_open', req)
File "/usr/lib/python2.7/urllib2.py", line 379, in _call_chain
result = func(*args)
File "/usr/lib/python2.7/urllib2.py", line 1211, in http_open
return self.do_open(httplib.HTTPConnection, req)
File "/usr/lib/python2.7/urllib2.py", line 1181, in do_open
raise URLError(err)
urllib2.URLError: <urlopen error [Errno -2] Name or service not known>
Is it not possible to connect locally?
Looks like I was doing it wrong. This answer solved my problem.
In short, I had to connect to the regular web server for it to work without the leading http. This asks for my email and password and once I enter that, it works!
$ remote_api_shell.py -s localhost:8080

GAE SDK 1.8.3 Python: InvalidCertificateException on deploy

I keep getting the below error every time I do a deploy after updating GAE to a new version (1.8.3 in this case).
I have read other questions about this and the going recommendation is to delete /Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/cacerts/*cacerts.txt
Does anyone know of a better fix than deleting these files after every update?
Note: I have the Python SSL module installed
*** Running appcfg.py with the following flags:
--no_cookies --email=joshainglis#gmail.com --passin update
10:52 AM Host: appengine.google.com
10:52 AM Application: josha-search-py-demo; version: 1
Traceback (most recent call last):
File "google_appengine/appcfg.py", line 171, in <module>
run_file(__file__, globals())
File "google_appengine/appcfg.py", line 167, in run_file
execfile(script_path, globals_)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 4282, in <module>
main(sys.argv)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 4273, in main
result = AppCfgApp(argv).Run()
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 2409, in Run
self.action(self)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 4003, in __call__
return method()
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 2987, in Update
updatecheck.CheckForUpdates()
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/sdk_update_checker.py", line 259, in CheckForUpdates
runtime=runtime))
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appengine_rpc.py", line 393, in Send
f = self.opener.open(req)
File "/Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/urllib2.py", line 400, in open
response = self._open(req, data)
File "/Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/urllib2.py", line 418, in _open
'_open', req)
File "/Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/urllib2.py", line 378, in _call_chain
result = func(*args)
File "/Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/urllib2.py", line 1215, in https_open
return self.do_open(httplib.HTTPSConnection, req)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/fancy_urllib/fancy_urllib/__init__.py", line 383, in do_open
url_error.reason.args[1])
fancy_urllib.InvalidCertificateException: Host appengine.google.com returned an invalid certificate (_ssl.c:504: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed):
To learn more, see http://code.google.com/appengine/kb/general.html#rpcssl
If deploy fails you might need to 'rollback' manually.
The "Make Symlinks..." menu option can help with command-line work.
*** appcfg.py has finished with exit code 1 ***
There is a copy of fancy_urllib inside fancy_urllib where the __init__.py is with InvalidCertificateException class definition.
Just copy .../fancy_urllib/fancy_urllib/__init__.py to .../fancy_urllib/__init__.py

Google App Engine throws this InvalidURL("nonnumeric port: '%s'" % host[i+1:]) exception when I try to deploy. How do I fix it?

When I click the Deploy button for my project, it gives me the following error: File "C:\Python27\lib\httplib.py", line 721, in _set_hostport
raise InvalidURL("nonnumeric port: '%s'" % host[i+1:])
httplib.InvalidURL: nonnumeric port: 'port'.
I've successfully deployed this project before, so I tried reverting the files so that I would have the same files when it worked properly. No dice, it seems. That was just a jab in the dark, though -- the full trace shows this starting in Google App Engine's files, not mine.
Anyone know how I can deploy my project?
Traceback (most recent call last):
File "C:\Program Files (x86)\Google\google_appengine\appcfg.py", line 171, in <module>
run_file(__file__, globals())
File "C:\Program Files (x86)\Google\google_appengine\appcfg.py", line 167, in run_file
execfile(script_path, globals_)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 4191, in <module>
main(sys.argv)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 4182, in main
result = AppCfgApp(argv).Run()
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 2579, in Run
self.action(self)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 3927, in __call__
return method()
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 3040, in Update
updatecheck.CheckForUpdates()
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 596, in CheckForUpdates
runtime=self.config.runtime)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appengine_rpc.py", line 383, in Send
f = self.opener.open(req)
File "C:\Python27\lib\urllib2.py", line 400, in open
response = self._open(req, data)
File "C:\Python27\lib\urllib2.py", line 418, in _open
'_open', req)
File "C:\Python27\lib\urllib2.py", line 378, in _call_chain
result = func(*args)
File "C:\Python27\lib\urllib2.py", line 1215, in https_open
return self.do_open(httplib.HTTPSConnection, req)
File "C:\Program Files (x86)\Google\google_appengine\lib\fancy_urllib\fancy_urllib\__init__.py", line 370, in do_open
req)
File "C:\Python27\lib\urllib2.py", line 1146, in do_open
h = http_class(host, timeout=req.timeout) # will parse host:port
File "C:\Program Files (x86)\Google\google_appengine\lib\fancy_urllib\fancy_urllib\__init__.py", line 78, in __init__
httplib.HTTPSConnection.__init__(self, *args, **kwargs)
File "C:\Python27\lib\httplib.py", line 1149, in __init__
source_address)
File "C:\Python27\lib\httplib.py", line 693, in __init__
self._set_hostport(host, port)
File "C:\Python27\lib\httplib.py", line 721, in _set_hostport
raise InvalidURL("nonnumeric port: '%s'" % host[i+1:])
httplib.InvalidURL: nonnumeric port: 'port'
2012-10-22 16:55:29 (Process exited with code 1)
You can close this window now.
I'll preface this by saying I'm not familiar with the GUI, so feel free to completely disregard :).
The error seems to indicate that you are trying to specify a particular port for deployment, and furthermore, the value of that setting is the word 'port'. When using the commnand line with the dev server, port is an argument you can use to specify a particular port to use; my best guess is that this keyword parameter is still defined (as port) when you are trying to deploy. Is there a section where you can specify command-line flags? Is it possible that port is defined there when deploying?
I've resolved this by completely uninstalling and reinstalling both Python 2.7 and GAE. This complete wipe should include the deletion of any environment variables that have been set since your usage of GAE.
In my case, I think it was particularly the creation of environment proxy variables. A complete wipe of Python and GAE resolved this.

urllib error of Google App Engine & python.[Errno 11003] getaddrinfo failed

Thanks for your help in advance!
I want to get contents of a website, so I use urllib.urlopen(url).
set url='http://localhost:8080'(tomcat page)
If I use Google App Engine Launcher, run the application, browse http://localhost:8082 , it works well.
But if I specify the address and port for the application:
python `"D:\Program Files\Google\google_appengine\dev_appserver.py" -p 8082 -a 10.96.72.213 D:\pagedemon\videoareademo`
there's something wrong:
Traceback (most recent call last):
File "D:\Program Files\Google\google_appengine\google\appengine\ext\webapp\_webapp25.py", line 701, in __call__
handler.get(*groups)
File "D:\pagedemon\videoareademo\home.py", line 76, in get
wp = urllib.urlopen(url)
File "C:\Python27\lib\urllib.py", line 84, in urlopen
return opener.open(url)
File "C:\Python27\lib\urllib.py", line 205, in open
return getattr(self, name)(url)
File "C:\Python27\lib\urllib.py", line 343, in open_http
errcode, errmsg, headers = h.getreply()
File "D:\Program Files\Google\google_appengine\google\appengine\dist\httplib.py", line 334, in getreply
response = self._conn.getresponse()
File "D:\Program Files\Google\google_appengine\google\appengine\dist\httplib.py", line 222, in getresponse
deadline=self.timeout)
File "D:\Program Files\Google\google_appengine\google\appengine\api\urlfetch.py", line 263, in fetch
return rpc.get_result()
File "D:\Program Files\Google\google_appengine\google\appengine\api\apiproxy_stub_map.py", line 592, in get_result
return self.__get_result_hook(self)
File "D:\Program Files\Google\google_appengine\google\appengine\api\urlfetch.py", line 365, in _get_fetch_result
raise DownloadError(str(err))
DownloadError: ApplicationError: 2 [Errno 11003] getaddrinfo failed
The strangest thing is when I change the url form "http://localhost:8080" to "http://127.0.0.1:8080", it works well!
I googled a lot, but I didn't find any good solutions.Hoping for some help!
Also, I didn't configure any proxy.IE works well.
Your system doesn't necessarily know that localhost should resolve to 127.0.0.1. You might need to put an entry into your hosts file. On Windows, it's located at C:\Windows\System32\drivers\etc\hosts

Categories