Extension talk:AWS

From MediaWiki.org
Jump to: navigation, search
Start a new discussion

Contents

Thread titleRepliesLast modified
Not working - Don't bother downloading020:39, 2 August 2014
UploadStashFileException317:58, 30 June 2014
Could not create directory mwstore://localS3/public1022:44, 23 May 2014
Has anyone gotten this extension to work?002:52, 24 March 2014
autoload.php is is missing312:01, 20 December 2013

Not working - Don't bother downloading

This extension does not work, you don't have to download it and waste your time. Tested with the current version of MediaWiki 1.23.2 and an older version 1.22.5 - both PHP 5.5.9 and MySQL 5.6.17-log on AWS instances.

UploadStashFileException

Hello, I have Fatal exception of type UploadStashFileException when trying to upload a file.

Config is:

$wgAWSCredentials = array(
    'key' => '***',
    'secret' => '****'
);
 
$wgAWSRegion = 'eu-west-1';
 
$wgFileBackends['s3']['containerPaths'] = array(
    'wiki_id-local-public' => 'mysuperuniquename-public',
    'wiki_id-local-thumb' => 'mysuperuniquename-thumb',
    'wiki_id-local-deleted' => 'mysuperuniquename-deleted',
    'wiki_id-local-temp' => 'mysuperuniquename-temp'
);
 
// Make MediaWiki use Amazon S3 for file storage.
$wgLocalFileRepo = array (
    'class'             => 'LocalRepo',
    'name'              => 'local',
    'backend'           => 's3',
    'scriptDirUrl'      => $wgScriptPath,
    'scriptExtension'   => $wgScriptExtension,
    'url'               => $wgScriptPath . '/img_auth.php',
    'zones'             => array(
        'public'  => array( 'url' => 'http://mysuperuniquename-public.s3-eu-west-1.amazonaws.com/' ),
        'thumb'   => array( 'url' => 'http://mysuperuniquename-thumb.s3-eu-west-1.amazonaws.com/' ),
        'temp'    => array( 'url' => 'http://mysuperuniquename-temp.s3-eu-west-1.amazonaws.com/' ),
        'deleted' => array( 'url' => 'http://mysuperuniquename-deleted.s3-eu-west-1.amazonaws.com/' )
    )
);
Sasha bar (talk)21:11, 21 October 2013

Hi ,

I am facing the same problem. Have u fixed this issue?

122.164.83.11906:12, 21 December 2013

If you could provide more information about the error (like a full stack trace of the error) maybe it would be easier to know the reason. Read Manual:How to debug

Ciencia Al Poder (talk)10:37, 21 December 2013

[aa6fbc3d] /index.php?title=Especial:Carregar_arquivo Exception from line 244 of /home/historia/public_html/includes/upload/UploadStash.php: Error storing file in '/tmp/phpKbA0jD': Não foi possível criar o diretório "mwstore://s3/local-temp/2/2b". Backtrace:

  1. 0 /home/historia/public_html/includes/upload/UploadBase.php(844): UploadStash->stashFile(string, string)
  2. 1 /home/historia/public_html/includes/upload/UploadBase.php(857): UploadBase->stashFile()
  3. 2 /home/historia/public_html/includes/upload/UploadBase.php(866): UploadBase->stashFileGetKey()
  4. 3 /home/historia/public_html/includes/specials/SpecialUpload.php(340): UploadBase->stashSession()
  5. 4 /home/historia/public_html/includes/specials/SpecialUpload.php(433): SpecialUpload->showUploadWarning(array)
  6. 5 /home/historia/public_html/includes/specials/SpecialUpload.php(179): SpecialUpload->processUpload()
  7. 6 /home/historia/public_html/includes/SpecialPage.php(631): SpecialUpload->execute(NULL)
  8. 7 /home/historia/public_html/includes/SpecialPageFactory.php(488): SpecialPage->run(NULL)
  9. 8 /home/historia/public_html/includes/Wiki.php(298): SpecialPageFactory::executePath(Title, RequestContext)
  10. 9 /home/historia/public_html/includes/Wiki.php(602): MediaWiki->performRequest()
  11. 10 /home/historia/public_html/includes/Wiki.php(467): MediaWiki->main()
  12. 11 /home/historia/public_html/index.php(49): MediaWiki->run()
  13. 12 {main}
41.190.168.9017:58, 30 June 2014
 
 
 

Could not create directory mwstore://localS3/public

This is my configuration

$wgFileBackends[] = array(
    'name'        => 'myAWSfoldername',
    'class'       => 'AmazonS3FileBackend',
    'lockManager' => 'nullLockManager',
    'awsKey     ' => '*****',
    'awsSecret'   => '*****',
    'awsRegion'   => 'us-east-1'
);
 
 
 
$wgLocalFileRepo = array (
    'class'             => 'LocalRepo',
    'name'              => 'local',
    'backend'           => 'localS3',
    'scriptDirUrl'      => $wgScriptPath,
    'scriptExtension'   => $wgScriptExtension,
    'url'               => $wgScriptPath . '/img_auth.php',
    'hashLevels'        => 0,
    'deletedHashLevels' => 0,
    'zones'             => array(
        'public'  => array( 'container' => 'public' ),
        'thumb'   => array( 'container' => 'thumb' ),
        'temp'    => array( 'container' => 'temp' ),
        'deleted' => array( 'container' => 'deleted' )
    )
);

I keep getting this Could not create directory mwstore://localS3/public this is what I did

  1. I have created the LocalS3/public on the root and gave it full permission, I think the extension is super useful when it will work,
  2. It seems like the mwstore point to somewhere not clear to me.
  3. also I never got the files to show up on AWS server, any specific setting for the AWS container to make it work.

I would truly appreciate your help

Laith (talk)14:11, 1 June 2013
Edited by author.
Last edit: 13:30, 15 August 2013

Hi Laith,

I found what was causing the problem and will try to fix it as soon as I can.

Edit: Should probably mention that I fixed the problem. The extension should be working properly now.

Thai (talk)12:44, 14 July 2013

I'm having the same kind of problem. My config is:

$wgAWSCredentials = array(
    'key' => '*****',
    'secret' => '*****'
);
 
$wgAWSRegion = 'us-west-2';
 
$wgFileBackends['s3']['containerPaths'] = array(
    'wiki_id-local-public' => 'public',
    'wiki_id-local-thumb' => 'thumb',
    'wiki_id-local-temp' => 'temp',
    'wiki_id-local-deleted' => 'deleted',
);
 
$wgLocalFileRepo = array (
    'class'             => 'LocalRepo',
    'name'              => 'local',
    'backend'           => 'AmazonS3',
    'scriptDirUrl'      => $wgScriptPath,
    'scriptExtension'   => $wgScriptExtension,
    'url'               => $wgScriptPath . '/img_auth.php',
    'zones'             => array(
        'public'  => array( 'container' => 'public' ),
        'thumb'   => array( 'container' => 'thumb' ),
        'temp'    => array( 'container' => 'temp' ),
        'deleted' => array( 'container' => 'deleted' )
    )
);

In other words, it is exactly like the recommended one in the extension page, except for the key, secret, region and containers. But when I try to upload a file, I get:

Could not create directory "mwstore://AmazonS3/public/d/da".
LFS (talk)12:30, 15 August 2013

Hi Luis,

My configuration looks like the below...

$wgFileBackends['s3'] = array(
    'name'        => 'AmazonS3',
    'class'       => 'AmazonS3FileBackend',
    'lockManager' => 'nullLockManager',
    'awsKey'      => '*********',
    'awsSecret'   => '*********',
    'awsRegion'   => 'us-east-1',
    'containerPaths' => array(
        'foswiki-local-public'  =>'public',
        'foswiki-local-thumb'   => 'thumb',
        'foswiki-local-deleted' => 'deleted',
        'foswiki-local-temp'    => 'temp',
    )
);
 
$wgLocalFileRepo = array(
    'class'           => 'LocalRepo',
    'name'            => 'local',
    'backend'         => 'AmazonS3',
    'scriptDirUrl'    => $wgScriptPath,
    'scriptExtension' => $wgScriptExtension,
    'url'             => $wgScriptPath . '/img_auth.php',
    'zone'            => array(
        'public'  => array( 'container' => 'public' ),
        'thumb'   => array( 'container' => 'thumb' ),
        'temp'    => array( 'container' => 'temp' ),
        'deleted' => array( 'container' => 'deleted' )
    )
);
 
$wgImgAuthPublicTest = false;

Can you check if that works?

P.S. wiki_id is meant to be the name of your wiki. It won't break your site but I didn't mean for people to literally use it in their configuration.

Thai (talk)13:21, 15 August 2013

Thanks for the quick reply! I tried your config, replacing the awsKey, awsSecret, awsRegion, containerPaths and the wiki_id. I got a similar error, but slightly different:

Could not create directory "mwstore://AmazonS3/local-public/c/c7".

It is slightly different because the "local-" wasn't there before. I don't know if that means anything to you. Thanks again for your help!

LFS (talk)13:45, 15 August 2013

Hi Felipe / Luis,

I admit that I edited my configuration file prior to posting. I haven't had a look at my LocalSettings.php for a while (like a few weeks) so I forgot what some of the stuff did. The email you sent me regarding buckets reminded me of my folly.

You need to set the value of each element in the containerPaths array in wfFileBackends to the S3 bucket you are using. It should look something like this...

$wgFileBackends['s3'] = array(
    'name'        => 'AmazonS3',
    'class'       => 'AmazonS3FileBackend',
    'lockManager' => 'nullLockManager',
    'awsKey'      => '*********',
    'awsSecret'   => '*********',
    'awsRegion'   => 'us-east-1',
    'containerPaths' => array(
        'my_wiki-local-public'  => 'bucket_you_are_using_for_public',
        'my_wiki-local-thumb'   => 'bucket_you_are_using_for_thumb',
        'my_wiki-local-deleted' => 'bucket_you_are_using_for_deleted',
        'my_wiki-local-temp'    => 'bucket_you_are_using_for_temp',
    )
);
 
$wgLocalFileRepo = array(
    'class'           => 'LocalRepo',
    'name'            => 'local',
    'backend'         => 'AmazonS3',
    'scriptDirUrl'    => $wgScriptPath,
    'scriptExtension' => $wgScriptExtension,
    'url'             => $wgScriptPath . '/img_auth.php',
    'zone'            => array(
        'public'  => array( 'container' => 'public' ),
        'thumb'   => array( 'container' => 'thumb' ),
        'temp'    => array( 'container' => 'temp' ),
        'deleted' => array( 'container' => 'deleted' )
    )
);
 
$wgImgAuthPublicTest = false;
Thai (talk)14:20, 15 August 2013
 
 
 

thank you, been travelling , I will try that soon and update you, appreciate the response

Laith (talk)22:11, 24 October 2013
 

I'm having the same issue too. Error says, "Could not create directory "mwstore://AmazonS3/local-public/0/05"."

Like Luisdaniel12, I too have tried all the configuration variations mentioned in this thread. I also noticed that there are 'zone' and 'zones', not sure which one is the correct. But I tried both anyways, and neither worked.

If someone has successful experience, can you post your example please?

Much appreciated!

173.244.203.18207:56, 15 February 2014
 

Same issue as the others on this thread, on MediaWiki 1.22. Has there been a resolution? I can put files into local-public fine via s3cmd.

Also as a heads up there is a typo in the current snippet:

       'temp'    => array( 'url' => 'http://some_s3_bucket_3.s3.amazonaws.com/' ),
       'deleted' => array( 'url' => 'http://some_s3_bucket_4.s3.amazonaws.com/' )

should be

       'deleted' => array( 'url' => 'http://some_s3_bucket_3.s3.amazonaws.com/' ),
       'temp'    => array( 'url' => 'http://some_s3_bucket_4.s3.amazonaws.com/' )

I also added

   'directory'         => $wgUploadDirectory,

to $wgLocalFileRepo due to a php notice in MW 1.22 (I don't have the exact notice any more, but it was an index error on includes/filebackend/FileBackendGroup.php line 83).

Adobehill (talk)22:44, 23 May 2014
 

Has anyone gotten this extension to work?

If so, do you have a working config? Thank you.

Needcaffeine (talk)02:52, 24 March 2014

autoload.php is is missing

Hi, I downloaded aws extension from git but there is no vendor folder

122.164.27.9407:29, 6 December 2013

Please help me there is no vendor folder

Rajaraman (talk)07:32, 6 December 2013

Did you run php composer.phar install?

Thai (talk)02:27, 7 December 2013

How do I do that?

27.59.106.15912:01, 20 December 2013