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

"Unknown error." with S3 adapter #60

Open
Askancy opened this issue Dec 19, 2020 · 3 comments
Open

"Unknown error." with S3 adapter #60

Askancy opened this issue Dec 19, 2020 · 3 comments
Assignees

Comments

@Askancy
Copy link

Askancy commented Dec 19, 2020

im trying to configure my ckfinder with my DigitalOcean Spaces/ S3 space, but i get the error:

"Unknown error."

when I try to open the ckfinder.

this is the configuration:

$config['backends']['default'] = array(
    'name'         => 'default',
    'adapter'      => 's3',
    'bucket'       => 'projectx',
    'region'       => 'ams3',
    'key'          => '****',
    'secret'       => '*****',
    'visibility'   => 'public',
    'baseUrl'      => 'https://ams3.digitaloceanspaces.com/projectx/',
  function selectFileWithCKFinder( elementId ) {
    CKFinder.modal( {
      chooseFiles: true,
      width: 800,
      height: 600,
      rememberLastFolder: false,
      startupPath: "kk/gallery:"+ values,
      skin: 'jquery-mobile',

      onInit: function( finder ) {
        finder.on( 'files:choose', function( evt ) {
          var file = evt.data.files.first();
          var output = document.getElementById( elementId );
          output.value = file.getUrl();
        } );
        finder.on( 'file:choose:resizedImage', function( evt ) {
          var output = document.getElementById( elementId );
          output.value = evt.data.resizedUrl;
        } );
      }
    } );
  }

the pictures are respectively in: https://ams3.digitaloceanspaces.com/projectx/kk/gallery/id(value selected)

how come I can't view any images? any ideas? bucket access data is correct and tested.

@Askancy
Copy link
Author

Askancy commented Dec 20, 2020

Doing further research:

VM1292:1 GET https://project.it/ckfinder/connector?command=GetFiles&lang=it&type=Gallery&currentFolder=%2F1%2F&hash=2a12bd16454bdc38 500

log error:

cURL error 6: Could not resolve host: projectnet.s3.ams3.amazonaws.com (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) {"url":"https://project.it/ckfinder/connector","precedente":"https://project.it/admin/articoli/add","input":{"command":"GetFolders","lang":"it","type":"Gallery","currentFolder":"/","hash":"2a12bd16454bdc38"}}

Error executing "PutObject" on "https://projectnet.s3.ams3.amazonaws.com/gallery/"; AWS HTTP error: cURL error 6: Could not resolve host: projectnet.s3.ams3.amazonaws.com (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) {"userId":2,"exception":"[object] (Aws\\S3\\Exception\\S3Exception(code: 0): Error executing \"PutObject\" on \"https://projectnet.s3.ams3.amazonaws.com/gallery/\"; AWS HTTP error: cURL error 6: Could not resolve host: projectnet.s3.ams3.amazonaws.com (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) at /var/www/vhosts/project.it/httpdocs/vendor/aws/aws-sdk-php/src/WrappedHttpHandler.php:195)

how come it sets as amazonaws endpoint and not digitaloceanspaces, as set by filesystem config and ckfinder config?

I found this as well: ckfinder/ckfinder#340

but I don't quite understand what to do, i put IF control as said by the user in

\vendor\ckfinder\ckfinder-laravel-package_connector\Backend\BackendFactory.php

to line 206, without solving the problem...

@bmlotek
Copy link
Contributor

bmlotek commented Nov 23, 2022

Hello, do you still have the problem?

@bmlotek bmlotek self-assigned this Nov 23, 2022
@Askancy
Copy link
Author

Askancy commented Nov 24, 2022

Hi bmlotek,

Given the poor support I have dropped ckfinder, preferring alexusmai/laravel-file-manager, if you can guarantee me that the package will not be dropped again I will come back...

Anyway I solved it with:

$config['backends']['default'] = array(
    'name'         => 'awss3',
    'adapter'      => 's3',
    'bucket'       => '***',
    'region'       => 'fra1',
    'endpoint'     => 'https://fra1.digitaloceanspaces.com',
    'key'          => '***',
    'secret'       => '****',
    'visibility'   => 'public',
    'root'         => '***'
);
        's3' => [
            'driver' => 's3',
            'key' => env('AWS_ACCESS_KEY_ID'),
            'secret' => env('AWS_SECRET_ACCESS_KEY'),
            'region' => env('AWS_DEFAULT_REGION'),
            'bucket' => env('AWS_BUCKET'),
            'url' => env('AWS_URL'),
            'endpoint' => env('AWS_ENDPOINT'),
            'visibility' => 'public-read',
        ]

I hope this will help someone.

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

No branches or pull requests

2 participants