# Issues Importing PBS Hook

**URL:** <https://community.openpbs.org/t/issues-importing-pbs-hook/2544>\
**Category:** Users/Site Administrators\
**Created:** [March 24, 2021, 4:52pm UTC](https://community.openpbs.org/t/issues-importing-pbs-hook/2544 "2021-03-24T16:52:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sijisaula](https://avatars.discourse-cdn.com/v4/letter/s/779978/32.png) [@sijisaula](https://community.openpbs.org/u/sijisaula)\
**Post date:** [March 24, 2021, 4:52pm UTC](https://community.openpbs.org/t/issues-importing-pbs-hook/2544/1 "2021-03-24T16:52:06Z")

</div>

Hello,

We are having issues importing a hook per direction from the hook guide.

When we have try importing the hook’s python file using the full path:

> qmgr -c “import hook denyGrouplessJobs application/x-python default /cm/shared/apps/openpbs/var/spool/popbs/server\_priv/hooks/ccast/denyGrouplessJobs.py”

we see this in the qmgr:

> Qmgr: p h denyGrouplessJobs  
> …  
> create hook denyGrouplessJobs  
> set hook denyGrouplessJobs type = site  
> set hook denyGrouplessJobs enabled = true  
> set hook denyGrouplessJobs event = queuejob  
> set hook denyGrouplessJobs user = pbsadmin  
> set hook denyGrouplessJobs alarm = 30  
> set hook denyGrouplessJobs order = 1  
> set hook denyGrouplessJobs debug = false  
> set hook denyGrouplessJobs fail\_action = none  
> import hook denyGrouplessJobs application/x-python base64 -
> 
> /cm/shared/apps/openpbs/var/spool/popbs/server\_priv/hooks/tmp/qmgr\_hook1450770HAljQZ - No such file or directory
> 
> import hook denyGrouplessJobs application/x-config base64 -
> 
> /cm/shared/apps/openpbs/var/spool/popbs/server\_priv/hooks/tmp/qmgr\_hook1450770HAljQZ - No such file or directory

Meanwhile, we notice that each time we run the same import hook command above a new hook file gets added to the “…/tmp/” folder that matches the content of our python file:

> # ls -ltr /cm/shared/apps/openpbs/var/spool/popbs/server\_priv/hooks/tmp/
> 
> total 12
> 
> -rw-r–r-- 1 root root 604 Mar 24 11:12 qmgr\_hook1448121UEQx9M
> 
> -rw-r–r-- 1 root root 604 Mar 24 11:25 qmgr\_hook1450366pUZioq
> 
> -rw-r–r-- 1 root root 604 Mar 24 11:27 qmgr\_hook1450738eE1fUs

Is there something we are missing while importing this hook’s python file?

Thanks,  
Siji

---

<div class="post-metadata">

**Author:** ![adarsh](https://avatars.discourse-cdn.com/v4/letter/a/f07891/32.png) [@adarsh](https://community.openpbs.org/u/adarsh)\
**Post date:** [March 24, 2021, 10:59pm UTC](https://community.openpbs.org/t/issues-importing-pbs-hook/2544/2 "2021-03-24T22:59:35Z")

</div>

> [@sijisaula](#):
>
> qmgr -c “import hook denyGrouplessJobs application/x-python default /cm/shared/apps/openpbs/var/spool/popbs/server\_priv/hooks/ccast/denyGrouplessJobs.py”

Please try to copy the denyGrouplessJob.py to /root/denyGrouplessJob.py then try to import  
this file from the /root directory and see whether there is any difference

---

<div class="post-metadata">

**Author:** ![sijisaula](https://avatars.discourse-cdn.com/v4/letter/s/779978/32.png) [@sijisaula](https://community.openpbs.org/u/sijisaula)\
**Post date:** [March 25, 2021, 4:25pm UTC](https://community.openpbs.org/t/issues-importing-pbs-hook/2544/3 "2021-03-25T16:25:18Z")

</div>

Hey Adarsh,

we just tried that and no change:

> [root@bright03 ~]# pwd  
> /root  
> qmgr -c “import hook denyGrouplessJobs application/x-python default denyGrouplessJobs.py”
> 
> hook ‘denyGrouplessJobs’ contents overwritten
> 
> # qmgr
> 
> Max open servers: 49
> 
> Qmgr: p h denyGrouplessJobs  
> …  
> import hook denyGrouplessJobs application/x-python base64 -
> 
> /cm/shared/apps/openpbs/var/spool/popbs/server\_priv/hooks/tmp/qmgr\_hook1703376OfHqAB - No such file or directory
> 
> import hook denyGrouplessJobs application/x-config base64 -
> 
> /cm/shared/apps/openpbs/var/spool/popbs/server\_priv/hooks/tmp/qmgr\_hook1703376OfHqAB - No such file or directory

---

<div class="post-metadata">

**Author:** ![adarsh](https://avatars.discourse-cdn.com/v4/letter/a/f07891/32.png) [@adarsh](https://community.openpbs.org/u/adarsh)\
**Post date:** [March 25, 2021, 4:39pm UTC](https://community.openpbs.org/t/issues-importing-pbs-hook/2544/4 "2021-03-25T16:39:24Z")

</div>

Thank you @sijisaula

Could you please share the contents of the below files / commands on the server:

1. /etc/pbs.conf
2. hostname -A
3. hostname

---

<div class="post-metadata">

**Author:** ![sijisaula](https://avatars.discourse-cdn.com/v4/letter/s/779978/32.png) [@sijisaula](https://community.openpbs.org/u/sijisaula)\
**Post date:** [March 29, 2021, 10:26pm UTC](https://community.openpbs.org/t/issues-importing-pbs-hook/2544/5 "2021-03-29T22:26:19Z")

</div>

Thanks @adarsh - The issue was within /etc/pbs.conf after further inspection and is now resolved!
