Extension talk:AWS
Contents
Thread title | Replies | Last modified |
---|---|---|
Not working - Don't bother downloading | 0 | 20:39, 2 August 2014 |
UploadStashFileException | 3 | 17:58, 30 June 2014 |
Could not create directory mwstore://localS3/public | 10 | 22:44, 23 May 2014 |
Has anyone gotten this extension to work? | 0 | 02:52, 24 March 2014 |
autoload.php is is missing | 3 | 12:01, 20 December 2013 |
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.
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/' ) ) );
Hi ,
I am facing the same problem. Have u fixed this issue?
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
[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:
- 0 /home/historia/public_html/includes/upload/UploadBase.php(844): UploadStash->stashFile(string, string)
- 1 /home/historia/public_html/includes/upload/UploadBase.php(857): UploadBase->stashFile()
- 2 /home/historia/public_html/includes/upload/UploadBase.php(866): UploadBase->stashFileGetKey()
- 3 /home/historia/public_html/includes/specials/SpecialUpload.php(340): UploadBase->stashSession()
- 4 /home/historia/public_html/includes/specials/SpecialUpload.php(433): SpecialUpload->showUploadWarning(array)
- 5 /home/historia/public_html/includes/specials/SpecialUpload.php(179): SpecialUpload->processUpload()
- 6 /home/historia/public_html/includes/SpecialPage.php(631): SpecialUpload->execute(NULL)
- 7 /home/historia/public_html/includes/SpecialPageFactory.php(488): SpecialPage->run(NULL)
- 8 /home/historia/public_html/includes/Wiki.php(298): SpecialPageFactory::executePath(Title, RequestContext)
- 9 /home/historia/public_html/includes/Wiki.php(602): MediaWiki->performRequest()
- 10 /home/historia/public_html/includes/Wiki.php(467): MediaWiki->main()
- 11 /home/historia/public_html/index.php(49): MediaWiki->run()
- 12 {main}
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
- 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,
- It seems like the mwstore point to somewhere not clear to me.
- 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
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.
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".
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.
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!
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;
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!
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).
If so, do you have a working config? Thank you.