Questions and Answers

0 Like 0 Dislike

Leigh Noble

Error during v1.3.0 “hzcms install”: NameError: global name ‘HUBZERO_CMS_DIR’ is not defined

While installing v1.3.0 of the hubzero CMS, I am executing this step:

#hzcms install example

and I receive this error:

Traceback (most recent call last):
  File "/usr/bin/hzcms", line 4210, in
    args.func(args)
  File "/usr/bin/hzcms", line 1178, in installHub
    return installHubDebian(args)
  File "/usr/bin/hzcms", line 1231, in installHubDebian
    print "Copying CMS files from " + HUBZERO_CMS_DIR + "/cms/ to " + docroot
NameError: global name 'HUBZERO_CMS_DIR' is not defined

I found that there was a line missing in the /usr/bin/hzcms file. The path for my cms installation files seems to be /usr/share/hubzero-cms-1.3.0 rather than any of the paths listed starting on line 35. So, I added my path into the list of options at line 35 of /usr/bin/hzcms as so:

if os.path.exists("/usr/share/hubzero-cms-1.3.0/cms/index.php"):
    HUBZERO_CMS_DIR = "/usr/share/hubzero-cms-1.3.0"
    hubzero.utilities.misc.JOOMLA_25 = True
elif os.path.exists("/usr/share/hubzero-cms-1.2/cms/index.php"):
    HUBZERO_CMS_DIR = "/usr/share/hubzero-cms-1.2"
    hubzero.utilities.misc.JOOMLA_25 = True

and also changed line 25 to say "HUBZERO_CMS_DIR" rather than "HUBZERO_CNS_DIR". Then the "hzcms install example" command worked fine.

If you're having this problem, hopefully this info will help.

Report abuse

Chosen Answer

  1. 0 Like 0 Dislike

    Leigh Noble

    Well, it seems that I had an old version of hzcms left over from an earlier attempted installation. It was an old version of the hzcms file and so obviously didn't include references to hzcms 1.3.





    So, perhaps the moral of this story is to do an apt-get autoremove or simply delete the /usr/bin/hzcms file before installing the hubzero-cms-1.3.0. I'm not sure exactly which thing needs to be done, but likely both would be useful.





    In short, be sure your system is very clean of any old pieces of any previously attempted installations of the hubzero cms. When in doubt, definitely check dpkg --list | grep hubzero to be sure you've removed any old hub packages before a re-installation. Also, watch for /etc/hubzero.secrets and /etc/hubmail_gw.conf and /etc/hubzero-cms/[oldhubname] and remove them too before trying to reinstall.

    Cancel Report abuse

    Please login to answer the question.

0 Responses

No other responses made.

  • Copyright © 2022 Hubzero
  • Powered by Hubzero®