Problem/Motivation

Installation of the libraries fails in Drupal 9.4.8 with Drush 11.2.1 and PHP 8.1

The command in the README documentation for wavesurfer seems to be incorrect: drush audiofield:download waveplayer

Correcting (?) the library name to wavesurfer fails with errors, and the command without an argument also fails (see below).

Steps to reproduce

Run `drush audiofield:download waveplayer` or `drush audiofield:download`

user@host/var/www/fwda/drupal/web/libraries$ drush audiofield:download waveplayer
 [error]  Error: waveplayer is not a valid Audiofield library. 

user@host:/var/www/fwda/drupal/web/libraries$ drush audiofield:download wavesurfer
 [error]  Error: Class "ZipArchive" not found in Drupal\Core\Archiver\Zip->__construct() (line 30 of /var/www/fwda/drupal/web/core/lib/Drupal/Core/Archiver/Zip.php) #0 /var/www/fwda/drupal/web/core/lib/Drupal/Core/Archiver/ArchiverManager.php(57): Drupal\Core\Archiver\Zip->__construct()
#1 /var/www/fwda/drupal/web/core/lib/Drupal/Core/Archiver/ArchiverManager.php(73): Drupal\Core\Archiver\ArchiverManager->createInstance()
#2 /var/www/fwda/drupal/web/modules/contrib/audiofield/src/Commands/AudiofieldCommands.php(129): Drupal\Core\Archiver\ArchiverManager->getInstance()
#3 [internal function]: Drupal\audiofield\Commands\AudiofieldCommands->download()
#4 /var/www/fwda/drupal/vendor/consolidation/annotated-command/src/CommandProcessor.php(257): call_user_func_array()
#5 /var/www/fwda/drupal/vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback()
#6 /var/www/fwda/drupal/vendor/consolidation/annotated-command/src/CommandProcessor.php(176): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter()
#7 /var/www/fwda/drupal/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(350): Consolidation\AnnotatedCommand\CommandProcessor->process()
#8 /var/www/fwda/drupal/vendor/symfony/console/Command/Command.php(255): Consolidation\AnnotatedCommand\AnnotatedCommand->execute()
#9 /var/www/fwda/drupal/vendor/symfony/console/Application.php(1027): Symfony\Component\Console\Command\Command->run()
#10 /var/www/fwda/drupal/vendor/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand()
#11 /var/www/fwda/drupal/vendor/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun()
#12 /var/www/fwda/drupal/vendor/drush/drush/src/Runtime/Runtime.php(124): Symfony\Component\Console\Application->run()
#13 /var/www/fwda/drupal/vendor/drush/drush/src/Runtime/Runtime.php(51): Drush\Runtime\Runtime->doRun()
#14 /var/www/fwda/drupal/vendor/drush/drush/drush.php(72): Drush\Runtime\Runtime->run()
#15 /var/www/fwda/drupal/vendor/drush/drush/drush(4): require('...')
#16 {main}. 


user@host:/var/www/fwda/drupal/web/libraries$ drush audiofield:download
 [error]  Error: Class "ZipArchive" not found in Drupal\Core\Archiver\Zip->__construct() (line 30 of /var/www/fwda/drupal/web/core/lib/Drupal/Core/Archiver/Zip.php) #0 /var/www/fwda/drupal/web/core/lib/Drupal/Core/Archiver/ArchiverManager.php(57): Drupal\Core\Archiver\Zip->__construct()
#1 /var/www/fwda/drupal/web/core/lib/Drupal/Core/Archiver/ArchiverManager.php(73): Drupal\Core\Archiver\ArchiverManager->createInstance()
#2 /var/www/fwda/drupal/web/modules/contrib/audiofield/src/Commands/AudiofieldCommands.php(129): Drupal\Core\Archiver\ArchiverManager->getInstance()
#3 [internal function]: Drupal\audiofield\Commands\AudiofieldCommands->download()
#4 /var/www/fwda/drupal/vendor/consolidation/annotated-command/src/CommandProcessor.php(257): call_user_func_array()
#5 /var/www/fwda/drupal/vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback()
#6 /var/www/fwda/drupal/vendor/consolidation/annotated-command/src/CommandProcessor.php(176): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter()
#7 /var/www/fwda/drupal/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(350): Consolidation\AnnotatedCommand\CommandProcessor->process()
#8 /var/www/fwda/drupal/vendor/symfony/console/Command/Command.php(255): Consolidation\AnnotatedCommand\AnnotatedCommand->execute()
#9 /var/www/fwda/drupal/vendor/symfony/console/Application.php(1027): Symfony\Component\Console\Command\Command->run()
#10 /var/www/fwda/drupal/vendor/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand()
#11 /var/www/fwda/drupal/vendor/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun()
#12 /var/www/fwda/drupal/vendor/drush/drush/src/Runtime/Runtime.php(124): Symfony\Component\Console\Application->run()
#13 /var/www/fwda/drupal/vendor/drush/drush/src/Runtime/Runtime.php(51): Drush\Runtime\Runtime->doRun()
#14 /var/www/fwda/drupal/vendor/drush/drush/drush.php(72): Drush\Runtime\Runtime->run()
#15 /var/www/fwda/drupal/vendor/drush/drush/drush(4): require('...')
#16 {main}. 

Issue fork audiofield-3318911

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

jmee created an issue. See original summary.

jmee’s picture

Title: drush audiofield:download » drush audiofield:download fails with error
jmee’s picture

Issue summary: View changes
aadil.addweb’s picture

StatusFileSize
new151.66 KB

I am getting below errors on drush audiofield:download
[error] The specified file '/var/www/html/web/libraries/audiojs/audiojs' could not be moved to '/tmp/temp_audiofield'.
I have created empty libraries directory before running the command

Steps to reproduce:

  • Create a fresh Drupal 9 site
  • Add and enable audiofield module using composer
  • Now run drush audiofield:download command

I am using Drush 11.

ressa’s picture

Priority: Normal » Major

I am seeing this as well:

$ drush audiofield:download jplayer
In FileSystem.php line 408:                                                                                                                        
  The specified file '/var/www/html/web/libraries/jplayer/jPlayer-2.9.2' could not be moved to '/tmp/temp_audiofield'.                                                                                                                      
Failed to run drush audiofield:download jplayer: exit status 1

Also, if I go to /admin/reports/status I get a WSOD and this error, so raising priority:

The website encountered an unexpected error. Try again later.

Drupal\Core\File\Exception\NotRegularDirectoryException: /var/www/html/web/libraries/jplayer/dist/skin/ is not a directory. in Drupal\Core\File\FileSystem->scanDirectory() (line 659 of core/lib/Drupal/Core/File/FileSystem.php). 
_audiofield_list_skins() (Line: 20)
audiofield_library_info_build()
call_user_func_array() (Line: 407)
Drupal\Core\Extension\ModuleHandler->invoke() (Line: 419)
Drupal\Core\Asset\LibraryDiscoveryParser->parseLibraryInfo() (Line: 157)
Drupal\Core\Asset\LibraryDiscoveryParser->buildByExtension() (Line: 87)
[...]

The workaround is to move the content of the jPlayer-2.9.2 folder one level up (the files are one level "too deep"):
$ ls web/libraries/jplayer/jPlayer-2.9.2/

astonvictor made their first commit to this issue’s fork.

astonvictor’s picture

' [error] Error: waveplayer is not a valid Audiofield library.' - I guess it was a typo in the readme file.
You can only use library names that are added as @AudioPlayer plugins. The right name should be wavesurfer instead of waveplayer.

I updated the readme file.

astonvictor’s picture

Status: Active » Needs review

refs to [error] The specified file '/var/www/html/web/libraries/xxxx' could not be moved to '/tmp/temp_audiofield'. error, it is a correct behaviour.

It means that the temp folder is not configured on the site. i.e. it tries to add a temp file to the /tmp/temp_audiofield folder, but it should be added to the /var/www/html/tmp/temp_audiofield folder.

To fix it, you should add a new setting to your settings.php file - $settings['file_temp_path'] = '../tmp';
thanks

astonvictor’s picture

Status: Needs review » Fixed

merged to dev version

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.