Extension talk:SwiftCloudFiles

From mediawiki.org
Latest comment: 11 years ago by Jwestyp in topic HP Cloud Storage Error

HP Cloud Storage Error[edit]

Moved into Topic Jwestyp (talk) 13:11, 14 July 2012 (UTC)Reply

has anyone got this to work? there dose not seam to be any documentation for this ( i have tried installing this to get it to work with hp cloud storage (OpenSwift) and i cant seam to figure it out no matter was i set i keep getting the same error

  • in apache error_log
PHP Notice  Undefined index directory in {WIKIDIR}includes/filerepo/FileRepo.php on line 234, referer http//url/w/index.php/SpecialUpload
  • on mediawiki
Internal error
Jump to navigation, search

No 'public' zone defined in the local repo.

Backtrace

#0 {WIKIDIR}includes/filerepo/FileRepo.php(903) FileRepo->initZones('public')
#1 {WIKIDIR}includes/filerepo/FileRepo.php(879) FileRepo->publishBatch(Array, 1)
#2 {WIKIDIR}includes/filerepo/file/LocalFile.php(1175) FileRepo->publish('/tmp/phphoj6EQ', 'Biohazard.jpg', 'archive/2012071...', 1)
#3 {WIKIDIR}includes/filerepo/file/LocalFile.php(1152) LocalFile->publishTo('/tmp/phphoj6EQ', 'Biohazard.jpg', 1)
#4 {WIKIDIR}includes/filerepo/file/LocalFile.php(908) LocalFile->publish('/tmp/phphoj6EQ', 1)
#5 {WIKIDIR}includes/upload/UploadBase.php(573) LocalFile->upload('/tmp/phphoj6EQ', '', '', 1, Array, false, Object(User))
#6 {WIKIDIR}includes/specials/SpecialUpload.php(446) UploadBase->performUpload('', '', false, Object(User))
#7 {WIKIDIR}includes/specials/SpecialUpload.php(181) SpecialUpload->processUpload()
#8 {WIKIDIR}includes/SpecialPageFactory.php(476) SpecialUpload->execute(NULL)
#9 {WIKIDIR}includes/Wiki.php(263) SpecialPageFactoryexecutePath(Object(Title), Object(RequestContext))
#10 {WIKIDIR}includes/Wiki.php(593) MediaWiki->performRequest()
#11 {WIKIDIR}includes/Wiki.php(503) MediaWiki->main()
#12 {WIKIDIR}index.php(58) MediaWiki->run()
#13 {main}

im sure its something im just missing but i cant seem to figure it out

  • my config
## Swift Backend Config##
require(  "$IP/extensions/SwiftCloudFiles/SwiftCloudFiles.php"  );                 //Location of SwiftCloudFiles.php file. Should be in your extensions folder
require(  "/mnt/www/private/wgauth.php"  );                                        //Location of private credentials file. The example for this is below
#$wgHashedUploadDirectory = false;
$wgFileBackends[]  =  array(
        'name'                => 'localSwift',
        'class'               => 'SwiftFileBackend',
        'wikiId'              => 'apachecorp',
        'lockManager'         => 'nullLockManager',
        'swiftAuthUrl'        => $wgSwiftConf['authUrl'],                          //This entry and the next two are taken from the wgauth.php private file.
        'swiftUser'           => $wgSwiftConf['user'],
        'swiftKey'            => $wgSwiftConf['key'],
        'swiftUseCDN'         => false,
        #'readOnly'          =>  'Temporary planned maintenence for 5 min',
       'parallelize'         => 'implicit'
);
$wgLocalFileRepo  =  array(
        'class'              => 'LocalRepo',
        'name'               => 'local',
        'backend'            => 'localSwift',
        'scriptDirUrl'       => $wgScriptPath,
        'scriptExtension'    => $wgScriptExtension,
        'url'                => 'https//region-a.geo-1.objects.hpcloudsvc.com443/v1.0/AUTH_cda9a117-db4a-45ac-8bf6-96be7ae57653/',                         //An example would be 'http//cdn.cdnprovider.com'
        'hashLevels'         => 0,
        'deletedHashLevels'  => 0,
        'zones'             =>  array(      //Change container and url values to match your Swift provider configuration settings
                'public'  =>  array( 'container' =>  'public', 'url' =>  'https//region-a.geo-1.objects.hpcloudsvc.com443/v1.0/AUTH_cda9a117-db4a-45ac-8bf6-96be7ae57653/public' ),
                'thumb'   =>  array( 'container' =>  'thumb',  'url' =>  'https//region-a.geo-1.objects.hpcloudsvc.com443/v1.0/AUTH_cda9a117-db4a-45ac-8bf6-96be7ae57653/thumb' ),
                'temp'    =>  array( 'container' =>  'temp', 'url' =>  'https//region-a.geo-1.objects.hpcloudsvc.com443/v1.0/AUTH_cda9a117-db4a-45ac-8bf6-96be7ae57653/temp' ),
                'deleted' =>  array( 'container' =>  'deleted' ), // deleted items don't have a URL
        )
);
## End Swift Backend Config ##
Aditaa, to begin, can you tell me what version of MediaWiki you are using. The SwiftCloudFiles extension is compatible with MediaWiki 1.2.0+. ~~Edit to 1.2.0 instead of 2.0
In your config, you do not need the container name in the url.
You should also change the wikiId field to represent the ID of your specific wiki installation.
You are using a CDN through HP, so swiftUseCDN should be set to true
Your CDN URLs entered here may have been changed with the Wiki Text. It also appears that you are using an auth URL to access the CDN. Is that a requirement with your CDN provider? With Rackspace, a CDN URL would look like http://c12345678.r61.cf2.rackcdn.com. Based on the HP Cloud API Documenation, your URL should look like http://h1dbbb5c59541c721905ae1a7a433b50c.cdn.hpcloudsvc.com.
## Swift Backend Config##
require(  "$IP/extensions/SwiftCloudFiles/SwiftCloudFiles.php"  );                 //Location of SwiftCloudFiles.php file. Should be in your extensions folder
require(  "/mnt/www/private/wgauth.php"  );                                        //Location of private credentials file. The example for this is below
#$wgHashedUploadDirectory = false;
$wgFileBackends[]  =  array(
        'name'                => 'localSwift',
        'class'               => 'SwiftFileBackend',
        'wikiId'              => 'apachecorp',  //Change to reflect your wiki ID. 
        'lockManager'         => 'nullLockManager',
        'swiftAuthUrl'        => $wgSwiftConf['authUrl'],                          //This entry and the next two are taken from the wgauth.php private file.
        'swiftUser'           => $wgSwiftConf['user'],
        'swiftKey'            => $wgSwiftConf['key'],
        'swiftUseCDN'         => true,  //Changed to true
        #'readOnly'          =>  'Temporary planned maintenence for 5 min',
       'parallelize'         => 'implicit'
);
$wgLocalFileRepo  =  array(
        'class'              => 'LocalRepo',
        'name'               => 'local',
        'backend'            => 'localSwift',
        'scriptDirUrl'       => $wgScriptPath,
        'scriptExtension'    => $wgScriptExtension,
        'url'                => 'https//region-a.geo-1.objects.hpcloudsvc.com443/v1.0/AUTH_cda9a117-db4a-45ac-8bf6-96be7ae57653/',                         //An example would be 'http//cdn.cdnprovider.com'
        'hashLevels'         => 0,
        'deletedHashLevels'  => 0,
        'zones'             =>  array(      //Change container and url values to match your Swift provider configuration settings
                'public'  =>  array( 'container' =>  'public', 'url' =>  'https//region-a.geo-1.objects.hpcloudsvc.com443/v1.0/AUTH_cda9a117-db4a-45ac-8bf6-96be7ae57653' ), //Removed trailing slash and public
                'thumb'   =>  array( 'container' =>  'thumb',  'url' =>  'https//region-a.geo-1.objects.hpcloudsvc.com443/v1.0/AUTH_cda9a117-db4a-45ac-8bf6-96be7ae57653' ), //Removed trailing slash and thumb
                'temp'    =>  array( 'container' =>  'temp', 'url' =>  'https//region-a.geo-1.objects.hpcloudsvc.com443/v1.0/AUTH_cda9a117-db4a-45ac-8bf6-96be7ae57653' ),   //Removed trailing slash and temp
                'deleted' =>  array( 'container' =>  'deleted' ), // deleted items don't have a URL
        )
);
## End Swift Backend Config ##
Jwestyp (talk) 13:36, 14 July 2012 (UTC)Reply
Jwestyp, Ok so how do I go about getting MediaWiki 2.0+? I was using 1.19 (Also tried 1.20)
I really need to use Swift (with out it the project is mute... (its a prof of concept))
Aditaa, I made a mistake this morning and left out the 1. in front of the 2.0. Swift does in fact work and works well. I have several iterations operational right now. The version we are on is: MediaWiki 1.20alpha (11b67f0). We are working from a GIT from early June. Using 1.2.0, try to make the changes I mentioned above. Note, I am also using a git of the SwiftCloudFiles extension. Let me know if you still have problems after you attempt this. I can attempt a vanilla installation based on your config and try it myself to see if a something in the current branch is causing the issue. Jwestyp (talk) 19:00, 14 July 2012 (UTC)Reply
Jwestyp, ok so after working with 1.20, from the git in June. i stoped getting the stacktrace & php errors. now when i try to upload i just get this error
Could not create directory "mwstore://localSwift/public".
Aditaa, you have actually made good progress. The problem with the error is that you are getting a generic error. Try adding a line of $wgDebugLogGroups['SwiftBackend'] = "/path/to/logfile"; to your LocalSettings.php file and point to a log file of your choice. You can also add $wgDebugLogFile = "/path/to/wiki/logfile"; to see a detailed logging of your wiki. Also, post your config again so I can take a look. Jwestyp (talk) 00:41, 16 July 2012 (UTC)Reply
Jwestyp, ok so did a fresh install of wiki 1.20wmf7 (1b363e0) and SwiftCloudFiles (Version 1.7.10-wmf) (979d131) and still getting the same error on the upload page but getting errors in others (note: using the exact config you posted)
*apache error log:
[error] [client {IP}] PHP Warning:  SwiftFileBackend::doPrepareInternal: Unexpected response ():  in /{WIKIDIR}/includes/filerepo/backend/SwiftFileBackend.php on line 1194, referer: http://{IP}/w/index.php/Special:Upload
*wgDebugLogGroups file:
wiki: InvalidResponseException in 'SwiftFileBackend::doPrepareInternal' (given '{"dir":"mwstore:\/\/localSwift\/public"}'): Unexpected response ():
*wgDebugLogFile file
Start request GET /index.php?action=ajax&rs=SpecialUpload%3A%3AajaxGetExistsWarning&rsargs[]=18754_1217455122632_1416483323_30638285_4434846_n.jpg
HTTP HEADERS:
HOST: {IP}
USER-AGENT: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:14.0) Gecko/20100101 Firefox/14.0.1
ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
ACCEPT-LANGUAGE: en-us,en;q=0.5
ACCEPT-ENCODING: gzip, deflate
CONNECTION: keep-alive
PRAGMA: cache=yes
CACHE-CONTROL: no-transform
REFERER: http://{IP}/index.php/Special:Upload
COOKIE: wikiUserID=1; wikiUserName=Aditaa; wiki_session=105043ae8fb7a53391b95ca76144f408;
IF-MODIFIED-SINCE: Thu, 19 Jul 2012 05:16:08 GMT
CACHES: MemcachedPhpBagOStuff[main] MemcachedPhpBagOStuff[message] MemcachedPhpBagOStuff[parser]
session_set_cookie_params: "0", "/", "", "", "1"
LocalisationCache: using store LCStore_DB
Fully initialised
MessageCache::load: Loading en... got from global cache
Connecting to 127.0.0.1 ...
Profiler::instance called without $wgProfiler['class'] set, falling back to ProfilerStub for safety
Connected to 127.0.0.1 .
AjaxDispatcher::performAction dispatching SpecialUpload::ajaxGetExistsWarning
Pulling file metadata from cache key file:60c7343669eb048306b941f921cc1d63
Class PEAR_Error not found; skipped loading
Pulling file metadata from cache key file:60c7343669eb048306b941f921cc1d63
AjaxDispatcher::performAction dispatch complete for SpecialUpload::ajaxGetExistsWarning
Request ended normally


Start request POST /index.php/Special:Upload
HTTP HEADERS:
HOST: {IP}
USER-AGENT: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:14.0) Gecko/20100101 Firefox/14.0.1
ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
ACCEPT-LANGUAGE: en-us,en;q=0.5
ACCEPT-ENCODING: gzip, deflate
CONNECTION: keep-alive
REFERER: http://{IP}/index.php/Special:Upload
COOKIE: wikiUserID=1; wikiUserName=Aditaa; wiki_session=105043ae8fb7a53391b95ca76144f408;
CONTENT-TYPE: multipart/form-data; boundary=---------------------------24464570528145
CONTENT-LENGTH: 36197
CACHES: MemcachedPhpBagOStuff[main] MemcachedPhpBagOStuff[message] MemcachedPhpBagOStuff[parser]
session_set_cookie_params: "0", "/", "", "", "1"
LocalisationCache: using store LCStore_DB
Fully initialised
Connecting to 127.0.0.1 ...
Profiler::instance called without $wgProfiler['class'] set, falling back to ProfilerStub for safety
Connected to 127.0.0.1 .
User: got user 1 from cache
User: loading options for user 1 from override cache.
User: logged in from session
User: loading options for user 1 from override cache.
MessageCache::load: Loading en... got from global cache
Unstubbing $wgParser on call of $wgParser::firstCallInit from MessageCache::getParser
Parser: using preprocessor: Preprocessor_Hash
Unstubbing $wgLang on call of $wgLang::_unstub from ParserOptions::__construct
User::getBlockedStatus: checking...
UploadBase::createFromRequest: class name: UploadFromFile
FSFile::getProps: Getting file info for /tmp/phpN4tOOY
MimeMagic::__construct: loading mime types from {WIKIDIR}includes/mime.types
MimeMagic::__construct: loading mime info from {WIKIDIR}includes/mime.info
MimeMagic::doGuessMimeType: analyzing head and tail of /tmp/phpN4tOOY for magic numbers.
MimeMagic::doGuessMimeType: getimagesize detected /tmp/phpN4tOOY as image/jpeg
MimeMagic::guessMimeType: guessed mime type of /tmp/phpN4tOOY: image/jpeg
MimeMagic::improveTypeFromExtension: improved mime type for .jpg: image/jpeg
FSFile::getProps: /tmp/phpN4tOOY loaded, 35131 bytes, image/jpeg.


mime: <image/jpeg> extension: <jpg>

UploadBase::verifyExtension: mime type image/jpeg matches extension jpg, passing file
UploadBase::detectScript: checking for embedded scripts and HTML stuff
UploadBase::detectScript: no scripts found
ZipDirectoryReader: Fatal error: zip file lacks EOCDR signature. It probably isn't a zip file.
UploadBase::detectVirus: virus scanner disabled
UploadBase::verifyFile: all clear; passing.
Pulling file metadata from cache key file:60c7343669eb048306b941f921cc1d63
Pulling file metadata from cache key file:60c7343669eb048306b941f921cc1d63
Class PEAR_Error not found; skipped loading
Pulling file metadata from cache key file:60c7343669eb048306b941f921cc1d63
ContextSource::getContext (UploadForm): called and $context is null. Using RequestContext::getMain() for sanity
OutputPage::sendCacheControl: private caching;  **
Request ended normally