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

Exception on uploading files, not working #171

Closed
ledzgio opened this issue Jan 6, 2019 · 18 comments
Closed

Exception on uploading files, not working #171

ledzgio opened this issue Jan 6, 2019 · 18 comments
Assignees
Milestone

Comments

@ledzgio
Copy link

ledzgio commented Jan 6, 2019

I have just configured the S3 as primary storage, following my settings:

'objectstore' => 
  array (
    'class' => 'OCA\\Files_Primary_S3\\S3Storage',
    'arguments' => 
    array (
      'bucket' => 'BUCKET_NAME',
      'options' => 
      array (
        'version' => 'latest',
        'region' => 'eu-west-2',
        'credentials' => 
        array (
          'key' => 'HIDDEN',
          'secret' => 'HIDDEN',
        ),
      ),
    ),
  ),

but when I try to upload a file I get the following:
"reqId":"Befhhf0MQ5nf18tv0bWI","level":3,"time":"2019-01-06T17:31:35+00:00","remoteAddr":"XXXXXX","user":"admin","app":"remote","method":"PUT","url":"\/remote.php\/webdav\/example-file.pdf","message":"Exception: {\"Exception\":\"Error\",\"Message\":\"Class 'Aws\\\\ClientSideMonitoring\\\\ApiCallAttemptMonitoringMiddleware' not found\",\"Code\":0,\"Trace\":\"#0 \\\/var\\\/www\\\/owncloud\\\/apps\\\/files_primary_s3\\\/vendor\\\/aws\\\/aws-sdk-php\\\/src\\\/AwsClient.php(171): Aws\\\\AwsClient->addClientSideMonitoring(Array)\\n#1 \\\/var\\\/www\\\/owncloud\\\/apps\\\/files_primary_s3\\\/vendor\\\/aws\\\/aws-sdk-php\\\/src\\\/S3\\\/S3Client.php(263): Aws\\\\AwsClient->__construct(Array)\\n#2 \\\/var\\\/www\\\/owncloud\\\/apps\\\/files_primary_s3\\\/vendor\\\/aws\\\/aws-sdk-php\\\/src\\\/AwsClient.php(356): Aws\\\\S3\\\\S3Client->__construct(Array)\\n#3 \\\/var\\\/www\\\/owncloud\\\/apps\\\/files_primary_s3\\\/lib\\\/s3storage.php(90): Aws\\\\AwsClient::factory(Array)\\n#4 \\\/var\\\/www\\\/owncloud\\\/apps\\\/files_primary_s3\\\/lib\\\/s3storage.php(118): OCA\\\\Files_Primary_S3\\\\S3Storage->init()\\n#5 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/Files\\\/ObjectStore\\\/ObjectStoreStorage.php(415): OCA\\\\Files_Primary_S3\\\\S3Storage->writeObject('urn:oid:15', Resource id #86)\\n#6 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/Files\\\/Stream\\\/Close.php(104): OC\\\\Files\\\\ObjectStore\\\\ObjectStoreStorage->writeBack('\\\/tmp\\\/oc_tmp_9T5...')\\n#7 [internal function]: OC\\\\Files\\\\Stream\\\\Close->stream_close()\\n#8 \\\/var\\\/www\\\/owncloud\\\/apps\\\/files_external\\\/3rdparty\\\/icewind\\\/streams\\\/src\\\/Wrapper.php(124): fclose(Resource id #77)\\n#9 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/Files\\\/Stream\\\/Checksum.php(171): Icewind\\\\Streams\\\\Wrapper->stream_close()\\n#10 [internal function]: OC\\\\Files\\\\Stream\\\\Checksum->stream_close()\\n#11 \\\/var\\\/www\\\/owncloud\\\/apps\\\/dav\\\/lib\\\/Connector\\\/Sabre\\\/File.php(201): fclose(Resource id #83)\\n#12 \\\/var\\\/www\\\/owncloud\\\/apps\\\/dav\\\/lib\\\/Connector\\\/Sabre\\\/Directory.php(172): OCA\\\\DAV\\\\Connector\\\\Sabre\\\\File->put(Resource id #73)\\n#13 \\\/var\\\/www\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(1095): OCA\\\\DAV\\\\Connector\\\\Sabre\\\\Directory->createFile('token-econ.pdf', Resource id #73)\\n#14 \\\/var\\\/www\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/CorePlugin.php(525): Sabre\\\\DAV\\\\Server->createFile('token-econ.pdf', Resource id #73, NULL)\\n#15 [internal function]: Sabre\\\\DAV\\\\CorePlugin->httpPut(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#16 \\\/var\\\/www\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\\n#17 \\\/var\\\/www\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(479): Sabre\\\\Event\\\\EventEmitter->emit('method:PUT', Array)\\n#18 \\\/var\\\/www\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(254): Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#19 \\\/var\\\/www\\\/owncloud\\\/apps\\\/dav\\\/appinfo\\\/v1\\\/webdav.php(64): Sabre\\\\DAV\\\\Server->exec()\\n#20 \\\/var\\\/www\\\/owncloud\\\/remote.php(165): require_once('\\\/var\\\/www\\\/ownclo...')\\n#21 {main}\",\"File\":\"\\\/var\\\/www\\\/owncloud\\\/apps\\\/files_primary_s3\\\/vendor\\\/aws\\\/aws-sdk-php\\\/src\\\/AwsClient.php\",\"Line\":318}"}

@ownclouders ownclouders added the bug label Jan 6, 2019
@ownclouders
Copy link
Contributor

GitMate.io thinks possibly related issues are #69 (Cannot upload a file of 10GB), #128 (files are uploaded to ceph even when wrong checksum given), #100 (original file disappear when upload with overwrite is stoped by files_antivirus), and #73 (Error on first logging if folder was shared beforehand).

@DeepDiver1975
Copy link
Member

to which S3 service are you connecting to?

'version' => 'latest',

Please give it a try with

'version' => '2006-03-01',

@DeepDiver1975
Copy link
Member

which version of the app are you using?
did you grab it from the marketplace or from git?

@ledzgio
Copy link
Author

ledzgio commented Jan 7, 2019

to which S3 service are you connecting to?

Amazon S3 bucket

'version' => 'latest',

Please give it a try with

'version' => '2006-03-01',

I tried also with version 'version' => '2006-03-01', same result

@ledzgio
Copy link
Author

ledzgio commented Jan 7, 2019

which version of the app are you using?
did you grab it from the marketplace or from git?

I am using the version from the marketplace

@DeepDiver1975
Copy link
Member

I am using the version from the marketplace

1.0.2 I assume?

@ledzgio
Copy link
Author

ledzgio commented Jan 7, 2019

I am using the version from the marketplace

1.0.2 I assume?

Yes exactly, version 1.0.2

@DeepDiver1975
Copy link
Member

please make sure this file exists:
apps/files_primary_s3/vendor/aws/aws-sdk-php/src/ClientSideMonitoring/ApiCallAttemptMonitoringMiddleware.php

@ledzgio
Copy link
Author

ledzgio commented Jan 7, 2019

please make sure this file exists:
apps/files_primary_s3/vendor/aws/aws-sdk-php/src/ClientSideMonitoring/ApiCallAttemptMonitoringMiddleware.php

That file was missing the "php" suffix at the end of the filename, how is that possible?? anyway I have renamed the file and now it works. Thank you.

@PVince81
Copy link
Contributor

PVince81 commented Jan 7, 2019

@ledzgio uh oh... looks like the tar bug where long paths are truncated when extracted on some envs.

Will schedule another release using tar --gnu which should fix that.

@PVince81 PVince81 self-assigned this Jan 7, 2019
@PVince81 PVince81 added this to the development milestone Jan 7, 2019
@PVince81
Copy link
Contributor

PVince81 commented Jan 7, 2019

@ledzgio did you see a warning about integrity check ?

@davitol can you verify whether you can observe this in the test env ? I suspect that it doesn't happen in all PHP versions / env. To test: install the app and check the vendor folder for the above path.

@PVince81
Copy link
Contributor

PVince81 commented Jan 7, 2019

PR to fix the makefile to use GNU tar format: #174

@ledzgio
Copy link
Author

ledzgio commented Jan 7, 2019

@ledzgio did you see a warning about integrity check ?

No warnings when I installed the app

@davitol can you verify whether you can observe this in the test env ? I suspect that it doesn't happen in all PHP versions / env. To test: install the app and check the vendor folder for the above path.

@ledzgio uh oh... looks like the tar bug where long paths are truncated when extracted on some envs.

Will schedule another release using tar --gnu which should fix that.

Using Debian 9 and PHP 7.0

@PVince81
Copy link
Contributor

PVince81 commented Jan 7, 2019

No warnings when I installed the app

Strange, because the integrity checker also covers the vendor folder so it should at least have shown you a yellow banner about missing files.

Assuming you didn't disable the integrity check in config.php ?

@ledzgio
Copy link
Author

ledzgio commented Jan 7, 2019

No warnings when I installed the app

Strange, because the integrity checker also covers the vendor folder so it should at least have shown you a yellow banner about missing files.

Assuming you didn't disable the integrity check in config.php ?

No I didn't

@PVince81 PVince81 modified the milestones: development, QA Jan 8, 2019
@PVince81
Copy link
Contributor

PVince81 commented Jan 8, 2019

makefile fixed, there will be a new release of the app: #175

@PVince81
Copy link
Contributor

PVince81 commented Jan 8, 2019

seems there's a bug in the integrity check, needs investigation: owncloud/core#34075

@asheroto
Copy link

ping. Getting this issue.

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

No branches or pull requests

5 participants