Error installing custom module - looks like permissions issue, but isn't

I’m certain I’ve done my due diligence before posting. I’m completely stumped here.

When attempting to install custom modules created in the module builder, I am getting the following error on the screen:

Failed to copy cache/upgrades/temp/Jcio1X/icons custom/themes

When I enable error reporting and check the logs I get slightly more detail:

PHP message: PHP Warning:  dir(cache/upgrades/temp/Jcio1X/icons): failed to open dir: No such file or directory in /var/www/com-brilliantmetrics-crm/html/include/dir_inc.php on line 55

I have double-triple-quadruple checked file permissions on the cache directory and all directories for that matter. I have confirmed I have php-zip installed as well.

I am running nginx with php7.0-fpm, if it matters.

At this point, I am stumped. Any ideas on what else I should be looking into?

Since I posted this at 5pm on a Friday, is a bump perhaps appropriate? At least acceptable?

Yes, I think Friday afternoon posts are welcome to be bumped on Mondays… : - )

I think it might still be a permissions issue, but maybe an extra-tricky one.

  1. What results do you get from running each of these commands?
    umask
    ls -al cache/
    ls -al cache/upgrades/
    ls -al cache/upgrades/temp/
    ls -al cache/upgrades/temp/Jcio1X/
    ls -al cache/upgrades/temp/Jcio1X/icons

  2. What commands did you use to set permissions and ownership?

  3. Can you enable php_errors.log and give us the full stack trace when that error happens?

Hi pgr,
Thank you for your reply. My apologies for the delay.

  1. Here you go:
ls -al cache/
total 64
drwxrwxr-x  16 www-data www-data 4096 Jan 23 03:02 .
drwxr-xr-x  18 www-data www-data 4096 Mar  9 03:40 ..
drwxrwsr-x   3 www-data www-data 4096 Dec 31 04:37 cache
drwxrwsr-x   2 www-data www-data 4096 Mar 10 21:41 dashlets
drwxrwsr-x   5 www-data www-data 4096 Dec 31 05:23 htmlclean
drwxrwxr-x   2 www-data www-data 4096 Dec 31 04:46 images
drwxrwxr-x   4 www-data www-data 4096 Mar  9 03:41 include
drwxrwsr-x  43 www-data www-data 4096 Mar 10 21:41 jsLanguage
drwxrwxr-x   2 www-data www-data 4096 Dec 31 03:58 layout
drwxrwxr-x 102 www-data www-data 4096 Mar  9 20:11 modules
drwxrwxr-x   2 www-data www-data 4096 Dec 31 03:58 pdf
drwxrwsr-x   2 www-data www-data 4096 Mar 10 21:41 Relationships
drwxrwsr-x   5 www-data www-data 4096 Dec 31 04:28 smarty
drwxrwxr-x   5 www-data www-data 4096 Nov 16 13:19 themes
drwxrwxr-x   3 www-data www-data 4096 Jan 23 03:02 upgrades
drwxrwxr-x   2 www-data www-data 4096 Dec 31 03:58 xml
ls -al cache/upgrades/
total 12
drwxrwxr-x  3 www-data www-data 4096 Jan 23 03:02 .
drwxrwxr-x 16 www-data www-data 4096 Jan 23 03:02 ..
drwxrwxr-x  2 www-data www-data 4096 Mar 12 17:26 temp
ls -al cache/upgrades/temp/
total 8
drwxrwxr-x 2 www-data www-data 4096 Mar 12 17:26 .
drwxrwxr-x 3 www-data www-data 4096 Jan 23 03:02 ..
s -al cache/upgrades/temp/Jcio1X/
ls: cannot access 'cache/upgrades/temp/Jcio1X/': No such file or directory

…and for completeness

ls -al cache/upgrades/temp/Jcio1X/icons
ls: cannot access 'cache/upgrades/temp/Jcio1X/icons': No such file or directory
  1. I used the following three commands from another forum post here:
sudo chown -R www-data:www-data .
sudo chmod -R 755 .
sudo chmod -R 775 cache custom modules themes data upload config_override.php
  1. When I enable stack trace errors in system settings, I get this addtional output on the screen when attempting to install the module:

Again, thank you sincerely for any help. I’m new to SuiteCRM and the community, but I hope to return the favor or pass it on down the line. That said, any suggestions?

TLDR; Don’t try to deploy empty packages

As one would suspect, the issue was user error, and not even the geeky kind. Permissions were all set up correctly. What was incorrect was the custom modules. I believe that my admin and I made the same mistake: starting too small and not recognizing the difference between packages and modules.

Both of us created packages, but failed to add any modules to our packages. If you do this, and then try to deploy your new package, you’ll get this relatively cryptic error.

If I can find time, I’ll attempt a pull request to notify the user of their lack of understanding, otherwise, what’s the right thing to do with this knowledge? Obviously, users would benefit from a more informative error message.

Thank you, again, pgr, for jumping on this to help.

Steve

Yes, it would be nice to open an issue with this, or better yet, provide a fix. I am a believer in helpful error messages.

Bringing back to life a post from a 1,5 year ago and, again, on a friday afternoon…

I’m having the same problem: I created an empty module, then I went to Studio to fill it with fields. It was not there. I came back to Module Builder to deploy it: the same error as this thread describes.

How can I create fields for my new module if I can’t deploy it?

Thank you all… Nice weekend

@3boptic is it really the same issue? The Issue here was the inability to deploy packages without any modules in them, and the cryptic error message that generates. The way forward was simply to create the first modules before attempting deploy.

In your case you’re having trouble deploying modules, right? Do your errors in the log look the same?

Hi @pgr. Actually I was doing it the wrong way. I wasn’t creating any module. Sorry. Solved.