google-cloud-storage

Error Response: [13] An internal error occurred while creating a Google Cloud Storage bucket

江枫思渺然 提交于 2020-01-21 05:32:07
问题 I am trying to push a Nodejs sample app Hello World but after pushing I am getting error. ERROR: (gcloud.app.deploy) Error Response: [13] An internal error occurred while creating a Google Cloud Storage bucket. There is nothing wrong with the code as it is just a sample app downloaded from google. I have seen other SO posts related to this error but none of them helped. Can anyone please tell me a Fix for this error. I also tried to run command in debug using command and got following output.

TypeError: string argument without an encoding

我的梦境 提交于 2020-01-20 07:55:25
问题 I want to upload compressed gzip of Json into Google Storage. I have this code: import datalab.storage as storage import gzip path = prefix + '/orders_newline.json.gz' storage.Bucket('orders').item(path).write_to(gzip.compress(bytes(create_jsonlines(source)),encoding='utf8'), 'application/json') The create_jsonlines(source) is a function that returns Json Newline Delimited. Running this code gives: TypeError: string argument without an encoding The Python docs says the format is: bytes(

App Engine Java - Extract thumbnail from mp4 video

孤者浪人 提交于 2020-01-16 19:43:11
问题 I have some video stored on Google Cloud Storage in mp4, i need the extract a thumbnail from them. I looked to a number of solutions, and looks like they don't work with App Engine. for example: http://www.xuggle.com/xuggler/ Do you have library that i could use to do this on Google App Engine in Java? 回答1: I finally went with Google Compute Engine and ffmpeg, implementation is in progress... 回答2: This question looks related to Is there a Java API for mp4 files? Xuggler says their project is

NoClassDefFoundError: com/google/api/client/extensions/appengine/http/UrlFetchTransport?

坚强是说给别人听的谎言 提交于 2020-01-16 18:40:33
问题 I have a web service on google app engine and I am trying to read a file from the google cloud store from the web service. This is the code I am using: public static byte[] readFile2(String bucket, String filepath) throws IOException { GcsService gcsService = GcsServiceFactory.createGcsService(RetryParams.getDefaultInstance()); GcsFilename fileName = new GcsFilename(bucket, filepath); logger.warning(fileName.toString() + "<br>"); logger.warning(String.format("/gs/%s/%s", fileName

Shared Access for Home Directory in google cloud Shell

纵饮孤独 提交于 2020-01-16 14:55:33
问题 I am currently using the Google Cloud Shell, and I wish to access the persistent disk of another user. (Not using local shell) More info on topic of inquiry: https://medium.com/google-cloud/no-localhost-no-problem-using-google-cloud-shell-as-my-full-time-development-environment-22d5a1942439 回答1: Cloud Shell is a micro vm dedicated to you, free, and with a mounted personal disk. EDITED : Thanks to @Johnhanley comment, you can access to the cloud shell file of someone else with this code

Shared Access for Home Directory in google cloud Shell

↘锁芯ラ 提交于 2020-01-16 14:55:17
问题 I am currently using the Google Cloud Shell, and I wish to access the persistent disk of another user. (Not using local shell) More info on topic of inquiry: https://medium.com/google-cloud/no-localhost-no-problem-using-google-cloud-shell-as-my-full-time-development-environment-22d5a1942439 回答1: Cloud Shell is a micro vm dedicated to you, free, and with a mounted personal disk. EDITED : Thanks to @Johnhanley comment, you can access to the cloud shell file of someone else with this code

How to Read .json file in python code from google cloud storage bucket

[亡魂溺海] 提交于 2020-01-16 08:44:49
问题 I'm trying to read a .json file as dict() in a python code from VM instance stored in google cloud storage bucket. I tried reading json file as blob: client = storage.Client() bucket = client.get_bucket('bucket-id-here') blob = bucket.get_blob('remote/path/to/file.json') str_json = blob.download_as_string() But I'm unable to decode the str_json . Is my approach correct? if any other approach available please let me know. I need something like: # Method to load json dict = load_json(gcs_path=

How to generate Signed URL for google cloud storage objects using service-accounts-for-instances

不想你离开。 提交于 2020-01-16 08:07:24
问题 I am using signed-urls to give my clients temporary access to google cloud storage objects I have a service account json which looks like this: { "type": "service_account", "project_id": "my-project", "private_key_id": "abcdef1234567890", "private_key": "-----BEGIN PRIVATE KEY-----\n<key...>\n-----END PRIVATE KEY-----\n", "client_email": "my-app@my-project.iam.gserviceaccount.com", "client_id": "1234567890", "auth_uri": "https://accounts.google.com/o/oauth2/auth", "token_uri": "https://oauth2

How to change to “Next page” on Google storage api?

 ̄綄美尐妖づ 提交于 2020-01-15 20:15:48
问题 I'm using this API(https://www.googleapis.com/storage/v1/b/$bucketId/o/) to fetch data from my bucket, but I found out that List is incomplete and a " nextPageToken " is returned to me too. I googled it and it appear to be the key to next page, but I tried to put it into the Header or put it to the URL afterward(eg: https://www.googleapis.com/storage/v1/b/$bucketId/o/pageToken=Ci1yZXZxagenuio46432abt8IamwMi5jc3Y=), they didn't work. Can anyone tell me how to do that? thanks! 回答1: You're close

GAE PHP application: Unable to find the wrapper “gs”

半腔热情 提交于 2020-01-15 10:24:07
问题 I am writing some very simple code in the standard php73 Google App engine environment, following the documentation here: https://cloud.google.com/appengine/docs/standard/php/googlestorage/ and https://cloud.google.com/appengine/docs/standard/php/googlestorage/setup php.ini (not required according to docs for this scenario, but just in case) google_app_engine.allow_include_gs_buckets = "#default#" index.php: file_put_contents("gs://#default#/hello.txt", "some text"); and getting the following