I am using commons_upload to upload files using the API.
It works fine when targeting MediaWiki-Vagrant or production Commons, but it fails when targeting beta cluster.
$ ls screenshots/ VisualEditor_toolbar-ta.png
vagrant (works fine)
$ export MEDIAWIKI_API_UPLOAD_URL=http://127.0.0.1:8080/w/api.php $ export MEDIAWIKI_USER=Admin $ export MEDIAWIKI_PASSWORD=vagrant $ bundle exec upload Uploading ./screenshots/VisualEditor_toolbar-ta.png
production (works fine)
$ export MEDIAWIKI_API_UPLOAD_URL=https://commons.wikimedia.org/w/api.php $ export MEDIAWIKI_USER=LanguageScreenshotBot $ export MEDIAWIKI_PASSWORD=not-the-real-one $ bundle exec upload Uploading ./screenshots/VisualEditor_toolbar-ta.png
beta (fails)
$ export MEDIAWIKI_API_UPLOAD_URL=https://commons.wikimedia.beta.wmflabs.org/w/api.php $ export MEDIAWIKI_USER=LanguageScreenshotBot $ export MEDIAWIKI_PASSWORD=not-the-real-one $ bundle exec upload Uploading ./screenshots/VisualEditor_toolbar-ta.png /usr/local/lib/ruby/gems/2.3.0/gems/mediawiki_api-0.7.0/lib/mediawiki_api/client.rb:211:in `send_request': [V7wzDQpEEH8AAHb1ERgAAAAD] Exception Caught: Could not acquire lock for "Array". (internal_api_error_LocalFileLockError) (MediawikiApi::ApiError) from /usr/local/lib/ruby/gems/2.3.0/gems/mediawiki_api-0.7.0/lib/mediawiki_api/client.rb:232:in `raw_action' from /usr/local/lib/ruby/gems/2.3.0/gems/mediawiki_api-0.7.0/lib/mediawiki_api/client.rb:36:in `action' from /usr/local/lib/ruby/gems/2.3.0/gems/mediawiki_api-0.7.0/lib/mediawiki_api/client.rb:166:in `upload_image' from /Users/z/Documents/github/amire80/commons_upload/lib/commons_upload.rb:34:in `image' from /Users/z/Documents/github/amire80/commons_upload/lib/commons_upload.rb:45:in `block in images' from /Users/z/Documents/github/amire80/commons_upload/lib/commons_upload.rb:43:in `each' from /Users/z/Documents/github/amire80/commons_upload/lib/commons_upload.rb:43:in `images' from /Users/z/Documents/github/amire80/commons_upload/bin/upload:4:in `<top (required)>' from /usr/local/lib/ruby/gems/2.3.0/bin/upload:23:in `load' from /usr/local/lib/ruby/gems/2.3.0/bin/upload:23:in `<main>'
I have found V7wzDQpEEH8AAHb1ERgAAAAD in the logs.
{ "_index": "logstash-2016.08.23", "_type": "mediawiki", "_id": "AVa3J5W_hLHGnzHlEuTQ", "_score": 1, "_source": { "message": "Failed to lock 'VisualEditor_toolbar-ta.png'", "@version": 1, "@timestamp": "2016-08-23T11:27:19.000Z", "type": "mediawiki", "host": "deployment-mediawiki02", "level": "WARNING", "tags": [ "syslog", "es", "es" ], "channel": "LocalFile", "normalized_message": "Failed to lock '{file}'", "url": "/w/api.php", "ip": "10.68.18.103", "http_method": "POST", "server": "commons.wikimedia.beta.wmflabs.org", "referrer": null, "unique_id": "V7wzDQpEEH8AAHb1ERgAAAAD", "wiki": "commonswiki", "mwversion": "1.28.0-alpha", "reqId": "V7wzDQpEEH8AAHb1ERgAAAAD", "file": "VisualEditor_toolbar-ta.png" }, "fields": { "@timestamp": [ 1471951639000 ] } }