0
votes

Linux n00b here having trouble pulling a file from the server to my local Windows 7 professional 64 bit machine. I am using Wowza to stream live video and I am recording these live videos to my Google Cloud instance located here:

/usr/local/WowzaStreamingEngine/content/myStream.mp4  

When I ssh:

gcutil --project=”myprojectname” pull “my instance”      
“/usr/local/WowzaStreamingEngine/content/myStream.mp4”  “/folder1” 

I receive a permission denied error. When I try saving another folder deep on my local machine i.e "/folder1/folder2" the error returned is file or directory not found. I've checked that I have write permisions set on my local Windows 7 machine so I do not think it is a permissions error. Again, apologize for the n00b question, I'm just been stuck here for hours.

Thx, ~Greg

Comment added 7/18: I enter the following through ssh:

gcutil --project=”Myproject” pull “instance-1”        "/usr/local/WowzaStreamingEngine/content/myStream.mp4” “/content" 

By entering this I'm expecting the file mystream.mp4 to be copied to my C:/content folder. The following is returned: Warning: Permanently added '107.178.218.8' (ECDSA) to the list of known hosts. Enter passphrase for key '/home/Greg/.ssh/google_compute_engine':

Here I enter the passphrase and the following error is returned: /content: Permission denied Have write set up on this folder. Thanks! – Greg

-=-=-==->

To answer the question about using Cygwin, I'm not familiar with Cygwin and I do not believe it was used in this instance. I ran these commands through the Google Cloud SDK shell which I installed per the directions found here: https://developers.google.com/compute/docs/gcutil/.

What I am doing:

After setting up my google cloud instance I open Google CLoud SDK and enter the following:

gcutil --service_version="v1" --project="myproject" ssh --zone="us-central1-a" "instance-1"

I then am prompted for a passphrase which I create and then run the following:

curl http://metadata/computeMetadata/v1/instance/id -H "X-Google-Metadata-Request:True"

This provides the password I use to login to the Wowza live video streaming engine. All of this works beautifully, I can stream video and record the video to the following location: /usr/local/WowzaStreamingEngine/content/myStream.mp4

Next I attempt to save the .mp4 file to my local drive and that is where I'm having issues. I attempt to run:

gcutil --project=”myproject” pull “instance-1”  “/usr/local/WowzaStreamingEngine/content/myStream.mp4”  “C:/content”  

also tried, C:/content C:\content and C:\content

These attempts threw the following error:

Could not resolve hostname C: Name or service not known

Thanks again for your time, I know it is valuable, I really appreciate you helping out a novice.

Update I believe I am close thanks to your help. Switched to local C drive, entered the command as you displayed in your Answer update. Now returning a new, not before seen error:

Error: API rate limit exceeded

I did some research on S.O. and some suggestions made were that billing is not enabled or the relevant API is not enabled and I could solve by turning on Google Compute Engine. Billing has been enabled for a few weeks now on my project. In terms of Google Compute Engine, below are what I believe to be the relevant items turned on:

User Info: Enabled

Compute: Read Write

Storage: Full

Task Queue: Enabled

BigQuery: Enabled

Cloud SQL: Enabled

Cloud Database: Enabled

The test video I recorded was short and small in size. I also have not done anything else with this instance so at a loss as to why I am getting the API rate exceeded error.

I also went to the Google APIs console. I see very limited usage reported so, again, not sure why I am exceeding the API limit. Perhaps I do not have something set appropriately in the APIs console?

1
Please post the exact error message because it's unclear which permission (read, write, execute) is denied and by whom (server, client, etc.). - Misha Brukman
Thanks again Misha. Attempted your fix. Placed relevant information as an edit to my question. thx. - Greg
I've updated my answer; please see below. (Note: for some reason, my comments keep being deleted, so I'm not sure if you've seen my earlier comments. Apologies for duplicates, if you see this more than once.) - Misha Brukman
I think I am oh so close thanks to your help. Made edits to original question above. Thanks again. - Greg
Are you specifying the --zone=[...] flag to the gcutil pull command? Looks like some of your commands have it and some do not. - Misha Brukman

1 Answers

1
votes

I'm guessing you're using Cygwin here (please correct me if I'm wrong).

The root directory for your Cygwin installation is most likely C:\cygwin (see FAQ) and not C: so when you say /content on the command line, you're referring to C:\cygwin\content and not C:\content.

Secondly, since you're likely running as a regular user (and not root) you cannot write to /content so that's why you're getting the permission denied error.

Solution: specify the target directory as C:/content (or C:\\content) rather than /content.


Update: from the update to the question, you're using the Google Cloud SDK shell, not Cygwin, so the above answer does not apply. The reason you're seeing the error:

Could not resolve hostname C: Name or service not known

is because gcutil (like ssh) parses destinations which include : as having the pattern [hostname]:[path]. Thus, you should avoid : in the destination, which means we need to drop the drive spec.

In this case, the following should suffice, assuming that you're currently at a prompt that looks like C:\...>:

gcutil --project=myproject pull instance-1 /usr/local/WowzaStreamingEngine/content/myStream.mp4 \content

If not, first switch to the C: drive by issuing the command:

C:

and then run the above command.

Note: I removed the quotes from the command line because you don't need it in the case where parameters don't have spaces in them.