Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File Upload to Google Drive fails. [rt.cpan.org #100789] #27

Open
atoomic opened this issue Jan 3, 2019 · 1 comment
Open

File Upload to Google Drive fails. [rt.cpan.org #100789] #27

atoomic opened this issue Jan 3, 2019 · 1 comment
Labels

Comments

@atoomic
Copy link
Collaborator

atoomic commented Jan 3, 2019

Migrated from rt.cpan.org#100789 (status was 'open')

Requestors:

Attachments:

From [email protected] on 2014-12-09 00:05:50
:

OS: Windows 7 (64)/Cygwin 1.7.32
Perl version: 5.14
Net::Google::Drive::Simple: 0.11

The file upload method in Net::Google::Drive::Simple fails with a 403 
HTTP error.

This has been test on several scripts, including the distributed test 
script file_upload_test.pl.

Other Net::Google::Drive::Simple operations, such as find children 
appear to work.

An empty file is created on google drive.

Also, there is a bug in error handling in the module, as a call to 
is_error on a response returns an undefined.

Below is a quick example output.  Attached is the source of the test 
code, and a more detailed dump (produced by enabling logging).

 > perl file_upload_test.pl test.file.txt  /test
Failed with 403: Forbidden at 
/usr/lib/perl5/site_perl/5.14/Net/Google/Drive/Simple.pm line 518.
Failed with 403: Forbidden at 
/usr/lib/perl5/site_perl/5.14/Net/Google/Drive/Simple.pm line 518.
Failed with 403: Forbidden at 
/usr/lib/perl5/site_perl/5.14/Net/Google/Drive/Simple.pm line 518.
Failed with 403: Forbidden at 
/usr/lib/perl5/site_perl/5.14/Net/Google/Drive/Simple.pm line 518.
Can't call method "is_error" on an undefined value at 
/usr/lib/perl5/site_perl/5.14/Net/Google/Drive/Simple.pm line 243.


-- 
SzsSignature
Stephen Montsaroff , Ph.D 	[email protected]
Swimming Bear Consulting 	
711 23rd Ave. E 	206/568-1641 (h)
Seattle, WA 98112 	206/437-2427 (c)





From [email protected] on 2014-12-14 06:14:37
:

On Mon Dec 08 19:05:50 2014, [email protected] wrote:
> OS: Windows 7 (64)/Cygwin 1.7.32
> The file upload method in Net::Google::Drive::Simple fails with a 403 
> HTTP error.

Interesting, your script works fine on my Linux distro, I just uploaded a file without problems with it.

Since you said that you were able to read the content of your gdrive without getting a 403 error, I presume your ~/.google-drive.yml file has the correct tokens, but please double-check.

I wonder if it's related to the Cygwin platform, unfortunately, I don't have a test environment with this setup, is there a way you can verify that your script works on something more unix-y?

From [email protected] on 2014-12-14 06:23:16
:

WRT the bug, I've added a fix for that:

https://github.com/mschilli/net-google-drive-simple/commit/b295c62eabf7f8eba84256b4a51155fb58a46693

From [email protected] on 2014-12-17 06:18:29
:

WRT to the error message bug, it has been changed, but not I think fixed.

Now, I get

2014/12/16 22:16:10 Out of retries.
Can't locate object method "message" via package 
"Net::Google::Drive::Simple" at 
/usr/lib/perl5/site_perl/5.14/Net/Google/Drive/Simple.pm line 244.

I am still looking into the security type issues.

-------- Original Message --------
Subject: [rt.cpan.org Michael_Schilli via RT00789] File Upload to Google 
Drive fails.
From: Michael_Schilli via RT <[email protected]>
To: [email protected]

Date: Saturday, December 13, 2014 10:23:17 PM
> <URL: https://rt.cpan.org/Ticket/Display.html?id=100789 >
>
> WRT the bug, I've added a fix for that:
>
> https://github.com/mschilli/net-google-drive-simple/commit/b295c62eabf7f8eba84256b4a51155fb58a46693
>



From [email protected] on 2014-12-19 05:16:20
:

I am afraid I don't have a unix box at my disposal.  I have tried and 
used PERL "native to windows" (e.g. Strawberry), with the same problems.

-------- Original Message --------
Subject: [rt.cpan.org Michael_Schilli via RT00789] File Upload to Google 
Drive fails.
From: Michael_Schilli via RT <[email protected]>
To: [email protected]

Date: Saturday, December 13, 2014 10:14:38 PM
> <URL: https://rt.cpan.org/Ticket/Display.html?id=100789 >
>
> On Mon Dec 08 19:05:50 2014, [email protected] wrote:
>> OS: Windows 7 (64)/Cygwin 1.7.32
>> The file upload method in Net::Google::Drive::Simple fails with a 403
>> HTTP error.
> Interesting, your script works fine on my Linux distro, I just uploaded a file without problems with it.
>
> Since you said that you were able to read the content of your gdrive without getting a 403 error, I presume your ~/.google-drive.yml file has the correct tokens, but please double-check.
>
> I wonder if it's related to the Cygwin platform, unfortunately, I don't have a test environment with this setup, is there a way you can verify that your script works on something more unix-y?
>



@atoomic atoomic added the bug label Jan 3, 2019
@atoomic
Copy link
Collaborator Author

atoomic commented Jan 3, 2019

A first attempt fix attempt was performed via b295c62
need to investigate and fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant