Topic on Extension talk:SimpleBatchUpload

1.3.1 Suddenly stopped working on MW 1.30 site

11
Summary by Revansx

permissions error

Revansx (talkcontribs)

I recently had this extention working wonderfully well on my MW 1.30 site. I recently installed the "Semantic Extra Special Properties" extension (not sure if this is related) and then some time later discovered that the SimpleBatchUplaod extension no longered worked.

  1. I uploaded a file using the normal Special:Upload page to confirm that uploads were still working.
    • Standard upload page works fine.
  2. Then I went to Special:BatchUpload and tried to upload the file.
    • The page renders with the following error in the Browser Dev tools:
[Wz5GTIhOg9IHdMpVK-mH@wAAAAM] /mediawiki/demo/load.php?debug=false&lang=en&modules=ext.SimpleBatchUpload%7Cext.SimpleBatchUpload.jquery-file-upload%7Cmediawiki.api.edit&skin=vector&version=1z0k7yf   MWException from line 810 of /opt/htdocs/mediawiki/includes/resourceloader/ResourceLoaderFileModule.php: ResourceLoaderFileModule::readScriptFiles: script file not found: "/opt/htdocs/mediawiki//vendor/blueimp/jquery-file-upload/js/jquery.fileupload.js"

Backtrace:
#0 /opt/htdocs/mediawiki/includes/resourceloader/ResourceLoaderFileModule.php(356): ResourceLoaderFileModule->readScriptFiles(array)
#1 /opt/htdocs/mediawiki/includes/resourceloader/ResourceLoaderModule.php(719): ResourceLoaderFileModule->getScript(ResourceLoaderContext)
#2 /opt/htdocs/mediawiki/includes/resourceloader/ResourceLoaderModule.php(687): ResourceLoaderModule->buildContent(ResourceLoaderContext)
#3 /opt/htdocs/mediawiki/includes/resourceloader/ResourceLoader.php(1069): ResourceLoaderModule->getModuleContent(ResourceLoaderContext)
#4 /opt/htdocs/mediawiki/includes/resourceloader/ResourceLoader.php(783): ResourceLoader->makeModuleResponse(ResourceLoaderContext, array, array)
#5 /opt/htdocs/mediawiki/load.php(53): ResourceLoader->respond(ResourceLoaderContext)
#6 {main}

I have confirmed that the file: /opt/htdocs/mediawiki/vendor/blueimp/jquery-file-upload/js/jquery.fileupload.js does exists.

any thoughts on what could be the cause of the sudden failure?

F.trott (talkcontribs)

Did you by any chance also upgrade MW recently?

I think you are seeing this issue: https://phabricator.wikimedia.org/T180994

If so, then you could apply the workaround mentioned on that ticket, i.e. modify /vendor/.htaccess

It should also work to run composer update from the /extensions/SimpleBatchUpload directory

Revansx (talkcontribs)

When I attempted to run composer in the /extensions/SimpleBatchUpload directory I recieved the following response:

[root@mysystem SimpleBatchUpload]# sudo -u meza-ansible /usr/local/bin/composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - The requested package mediawiki/mediawiki could not be found in any version, there may be a typo in the package name.

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.
 - It's a private package and you forgot to add a custom repository to find it

Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.
[root@mysystem SimpleBatchUpload]#

and advice?

F.trott (talkcontribs)

Remove the requirement for mediawiki/mediawiki from the composer.json. It normally makes sure that you have a compatible MW, but since you run composer directly from the extension directory that mechanism does not work. I guess I should just include that JS lib directly in the extension at some point, but that means that it will not be updated automatically anymore.

Revansx (talkcontribs)

composer did the update, but still no joy in the functionality.

[root@mysystem SimpleBatchUpload]# sudo -u meza-ansible /usr/local/bin/composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
  - Installing blueimp/jquery-file-upload (v9.22.0): Downloading (100%)
Writing lock file
Generating autoload files
[root@mysystem SimpleBatchUpload]#

Upload Page produces the exact same error as initially reported above. hmm.

Revansx (talkcontribs)

It's just a warning, but could this: JQMIGRATE: jQuery.fn.bind() is deprecated be an issue?

Revansx (talkcontribs)

I changed /mediawiki/vendor from:

Deny from all

to

<FilesMatch "\.(gif|jpe?g|png|css|js|json|woff|woff2|svg|eot|ttf|ico)$">
  Order allow,deny
  Deny from all
</FilesMatch>

.. no joy

F.trott (talkcontribs)

For the moment I have no idea why it still does not work after the composer update. If you want to fix .htaccess you have to Allow (not Deny) access to .js.

F.trott (talkcontribs)

Oh, maybe check that the file permissions are correct. I see that you are using the root account for maintenance. It could well be, that the webuser does not have access to your files.

Revansx (talkcontribs)

It was a permissions issue due to the account composer was running on.

Revansx (talkcontribs)

we can mark this as resolved. thanks!