I am trying to install my custom module, but the error I get is:

modulename.tar.gz does not contain any .info files.

My module tar.gz file does indeed contain a .info file. I have installed other modules on the server, so I shouldn't have any permission issues.

The following is the content of the .info file.

    name = Module Name  
    description = Initialization module for hl
    package = My modules
    core = 7.x
    files[] = modulename.module
    files[] = modulename.install
    files[] = modulename.inc
    files[] = includes/mydrupalusers.php
  • 3
    It looks like you haven't extracted the archive – Clive Apr 18 '12 at 0:09
  • Why would it not extract? Other modules install fine. – vintorg Apr 18 '12 at 2:46
  • 1
    How are you installing this module and where are you receiving this error? Via the Drupal UI, Drush, other? – sheena_d Apr 18 '12 at 8:12

Mystery solved.

I traced back to the update_manager_install_form_submit() function in update.manager.inc.

When the file is uploaded, it is placed in the temp directory. Drupal then creates a temp directory to extract the file into, using a unique directory name. After the extraction, Drupal can't determine the module name any more, so it depends on the directory name in the archive. They commented on this in the code:

// Unfortunately, we can only use the directory name to determine the project
// name. Some archivers list the first file as the directory (i.e., MODULE/)
// and others list an actual file (i.e., MODULE/README.TXT).

I did not have my files tar'd in a directory. So, I created a directory named after my module, moved the files into the directory, tar'd it up, and all is well.


  • modulename.install
  • modulename.module


  • modulename/modulename.install
  • modulename/modulename.module

Have you manually checked the .info file to see if its well-formed?

An info file must have at the very least a core version and project name:

core = 7.x
name = My Module

The fact that your module is named in the error message with a ".tar.gz" extension suggests that something unusual is happening. Either you have not extracted the tarball after moving to your server, or the module has been extracted and the module directory is literally named 'modulename.tar.gz'.

I would first suggest checking to see if the archive has been extracted. If not, check the names of the module directory and .info file. These names should match exactly, otherwise Drupal will not recognize the .info file as belonging to the module.

  • I started to trace it, and it is picking it up and moving it to the temp directory (permissions are good). I'm working on it more tonight, so any ideas would be great. I also changed the module name for confidentiality. I started on the update.module, since that is where the error is being set. The function update_verify_update_archive() is taking three args - project, archive_file, and directory. My debug (using dpm()) shows the archive_file and directory args looking right, but the $project variable is set to "modulename.info", which doesn't seem right. Anyway, digging deeper... – vintorg Apr 18 '12 at 22:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.