I am following the example python code for uploading and downloading files from google cloud storage. I can download a file from the cloud without a problem, but using the same python file, when I attempt to upload a file I get the following error. Any thoughts on what might be causing the permission error?
Thanks!
Adam
storage-file-transfer-json-python-master adamkglaser$ python chunked_transfer.py language_id.txt gs://adam_glaser_cloud_storage/test.txt
Authenticating...
Constructing Google Cloud Storage service...
Building upload request...
Uploading file: language_id.txt to bucket: adam_glaser_cloud_storage object: test.txt
Traceback (most recent call last):
File "chunked_transfer.py", line 217, in <module>
upload(sys.argv)
File "chunked_transfer.py", line 148, in upload
progress, response = request.next_chunk()
File "/Users/adamkglaser/anaconda/lib/python2.7/site-packages/oauth2client/util.py", line 132, in positional_wrapper
return wrapped(*args, **kwargs)
File "/Users/adamkglaser/anaconda/lib/python2.7/site-packages/apiclient/http.py", line 808, in next_chunk
raise ResumableUploadError(resp, content)
apiclient.errors.ResumableUploadError: <HttpError 403 "Insufficient Permission">
Related
Started coding a python program using BeautifulSoup to track GTA V price on Amazon.
Getting these errors:
Traceback (most recent call last):
File "scraper.py", line 68, in <module>
check_price()
File "scraper.py", line 35, in check_price
send_mail()
File "scraper.py", line 50, in send_mail
server.login('sathwikapps#gmail.com', 'Jaybeatx')
File "D:\Users\sathw\anaconda3\lib\smtplib.py", line 697, in login
"SMTP AUTH extension not supported by server.")
smtplib.SMTPNotSupportedError: SMTP AUTH extension not supported by server.
My github repository is : https://github.com/SathwikChiluveru/GTA-V-Price-Tracker
Try to activate on you gmail smtp access for thirdparty :)
I am getting an error while running the following command. I have updated gcloud SDK but still facing same error.
kubectl get nodes
Unable to connect to the server: error executing access token command "/Users/salayhin/google-cloud-sdk/bin/gcloud config config-helper --format=json": err=exit status 1 output= stderr=Traceback (most recent call last):
File "/Users/salayhin/google-cloud-sdk/lib/gcloud.py", line 95, in <module>
main()
File "/Users/salayhin/google-cloud-sdk/lib/gcloud.py", line 54, in main
from googlecloudsdk.core.util import encoding
File "/Users/salayhin/google-cloud-sdk/lib/googlecloudsdk/__init__.py", line 23, in <module>
from googlecloudsdk.core.util import lazy_regex
File "/Users/salayhin/google-cloud-sdk/lib/googlecloudsdk/core/util/lazy_regex.py", line 25, in <module>
from googlecloudsdk.core.util import lazy_regex_patterns
ImportError: cannot import name lazy_regex_patterns
It seems like it's just an error from the Google Cloud SDK happening here indicating that you are probably missing this file on the same directory.
I would recommend re-install the Google Cloud SDK on whatever system you are using.
I'm working on a fastlane lane using pink-room's fastlane firebase test lab plugin which needs a gcloud service account to connect to firebase and upload files to a bucket.
The service account is needed because the script runs in a docker container which must not be worked by humans.
Gcloud command seem to work, because the test are launched as intended, but the gsutil command which is use to upload raw results is failing.
When this service account is loaded, gsutil commands stop working because they throw a ConfigParser.ParsingError "File contains parsing errors".
Here is what I get when trying to execute gsutil version -l in order to gather more informations:
Exit status of command 'gsutil version -l' was 1 instead of 0.
Traceback (most recent call last):
File "/usr/local/gcloud/google-cloud-sdk/platform/gsutil/gsutil", line 22, in <module>
gsutil.RunMain()
File "/usr/local/gcloud/google-cloud-sdk/platform/gsutil/gsutil.py", line 116, in RunMain
import gslib.__main__
File "/usr/local/gcloud/google-cloud-sdk/platform/gsutil/gslib/__main__.py", line 39, in <module>
import boto
File "/usr/local/gcloud/google-cloud-sdk/platform/gsutil/third_party/boto/boto/__init__.py", line 53, in <module>
config = Config()
File "/usr/local/gcloud/google-cloud-sdk/platform/gsutil/third_party/boto/boto/pyami/config.py", line 63, in __init__
self.read(BotoConfigLocations)
File "/usr/lib/python2.7/ConfigParser.py", line 305, in read
self._read(fp, filename)
File "/usr/lib/python2.7/ConfigParser.py", line 546, in _read
raise e
ConfigParser.ParsingError: File contains parsing errors: /builds/project-0/gcloud
/legacy_credentials/<service account mail>/.boto
[line 3]: '/legacy_credentials/<service account mail>/adc.json'
Here is my .boto file :
[Credentials]
gs_service_key_file = /builds/project-0/gcloud/legacy_credentials/<service account mail>/adc.json
Do someone knows where this error comes from, and how I can fix it ?
You say your boto file only has 2 lines, but I don't think that's the case, based on your error message :) I'm guessing either there's whitespace in there that you're not seeing (some unicode character that might not render correctly in your editor, perhaps?), or you didn't copy/paste the contents exactly as they appear in your file.
After finding a similar issue in this blog post, I noticed that the error you're seeing will print out the entire content of each problematic line that it found. It says it's printing line 3 (that shouldn't be possible if the boto file has only 2 lines), but doesn't show the gs_service_key_file = text. I'm guessing there's some sort of line break between gs_service_key_file = and /build/project-0/... in your boto file.
I have installed Google Cloud SDK but having an issue running "gsutil". Here are the error I'm getting:
~/gcloud/google-cloud-sdk#> gsutil
Traceback (most recent call last):
File "/Users/gonyi/Desktop/gonyyi/gcloud/google-cloud-sdk/bin/bootstrapping/gsutil.py", line 13, in <module>
import bootstrapping
File "/Users/gonyi/Desktop/gonyyi/gcloud/google-cloud-sdk/bin/bootstrapping/bootstrapping.py", line 40, in <module>
from googlecloudsdk.core import execution_utils
File "/Users/gonyi/Desktop/gonyyi/gcloud/google-cloud-sdk/lib/googlecloudsdk/core/execution_utils.py", line 33, in <module>
from googlecloudsdk.core import log
File "/Users/gonyi/Desktop/gonyyi/gcloud/google-cloud-sdk/lib/googlecloudsdk/core/log.py", line 810, in <module>
_log_manager = _LogManager()
File "/Users/gonyi/Desktop/gonyyi/gcloud/google-cloud-sdk/lib/googlecloudsdk/core/log.py", line 526, in __init__
self._file_formatter = _LogFileFormatter()
File "/Users/gonyi/Desktop/gonyyi/gcloud/google-cloud-sdk/lib/googlecloudsdk/core/log.py", line 315, in __init__
super(_LogFileFormatter, self).__init__(fmt=_LogFileFormatter.FORMAT)
TypeError: must be type, not classobj
~/gcloud/google-cloud-sdk#>
I have Python 2.7 installed, also tried to install this with "brew cask" as well as download it directly from Google Cloud site and install, but no luck either.
I googled this error but it seems like I'm the only one with this error..
"gcloud" command works just fine; but it's just "gsutil" that's not working.
Thank you
I am trying to run a basic lambda function (using article blueprint in AWS serverless project creator in Eclipse). When I try to run the project as AWS SAM Local, I get an error:
Traceback (most recent call last):
File "/Users/bliu4/.local/bin/sam", line 11, in <module>
sys.exit(cli())
File "/Users/bliu4/anaconda3/lib/python3.6/site-packages/click/core.py", line 722, in __call__
return self.main(*args, **kwargs)
File "/Users/bliu4/anaconda3/lib/python3.6/site-packages/click/core.py", line 676, in main
_verify_python3_env()
File "/Users/bliu4/anaconda3/lib/python3.6/site-packages/click/_unicodefun.py", line 118, in _verify_python3_env
'for mitigation steps.' + extra)
RuntimeError: Click will abort further execution because Python 3 was configured to use ASCII as encoding for the environment. Consult http://click.pocoo.org/python3/for mitigation steps.
Has anyone else run into this issue? Any idea how to change the python version sam is calling? Thanks.