# Pbs\_release\_nodes: No jobid given

**URL:** <https://community.openpbs.org/t/pbs-release-nodes-no-jobid-given/1686>\
**Category:** Developers\
**Created:** [July 2, 2019, 5:06am UTC](https://community.openpbs.org/t/pbs-release-nodes-no-jobid-given/1686 "2019-07-02T05:06:58Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![tomoki](https://avatars.discourse-cdn.com/v4/letter/t/50afbb/32.png) [@tomoki](https://community.openpbs.org/u/tomoki)\
**Post date:** [July 2, 2019, 5:06am UTC](https://community.openpbs.org/t/pbs-release-nodes-no-jobid-given/1686/1 "2019-07-02T05:06:59Z")

</div>

I can not include the pbs\_release\_nodes -a command in my job script.  
Is this a bug?  
This is my job script.

```
[test@ohpc137pbsib-sms ~]$ pbs_release_nodes --version

pbs_version = 19.1.1

[test@ohpc137pbsib-sms ~]$

[test@ohpc137pbsib-sms ~]$ cat sleep_10.sh
#!/bin/bash
#PBS -N sleep_10
#PBS -j oe
sleep 10
ssh ohpc137pbsib-sms pbs_release_nodes -a
sleep 10

[test@ohpc137pbsib-sms ~]$ qsub -l select=3 sleep_10.sh

927.ohpc137pbsib-sms

[test@ohpc137pbsib-sms ~]$ cat sleep_10.o927

pbs_release_nodes: No jobid given
[test@ohpc137pbsib-sms ~]$
```

The following is stated in man pbs\_release\_nodes  
SYNOPSIS  
pbs\_release\_nodes [-j] -a  
(no options)  
Without the -j option, pbs\_release\_nodes uses the value of the PBS\_JOBID environment variable as the job ID of the job whose vnodes are to be released.

The following script works correctly.

```
[test@ohpc137pbsib-sms ~]$ cat sleep_10.sh
#!/bin/bash
#PBS -N sleep_10
#PBS -j oe
sleep 10
ssh ohpc137pbsib-sms pbs_release_nodes -j $PBS_JOBID -a
sleep 10

[test@ohpc137pbsib-sms ~]$ qstat -an

ohpc137pbsib-sms:
                                                            Req’d Req’d Elap
Job ID Username Queue Jobname SessID NDS TSK Memory Time S Time
--------------- -------- -------- ---------- ------ --- --- ------ ----- - -----
932.ohpc137pbsi test workq sleep_10 13925 3 3 – – R 00:00
  ohpc137pbsib-c001/0+ohpc137pbsib-c002/0+ohpc137pbsib-c003/0
[test@ohpc137pbsib-sms ~]$

[test@ohpc137pbsib-sms ~]$ qstat -an

ohpc137pbsib-sms:
                                                            Req’d Req’d Elap
Job ID Username Queue Jobname SessID NDS TSK Memory Time S Time
--------------- -------- -------- ---------- ------ --- --- ------ ----- - -----
932.ohpc137pbsi test workq sleep_10 13925 1 1 – – R 00:00
  ohpc137pbsib-c001/0
```

---

<div class="post-metadata">

**Author:** ![scc](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.openpbs.org/scc/32/234_2.png) [@scc](https://community.openpbs.org/u/scc)\
**Post date:** [July 2, 2019, 12:56pm UTC](https://community.openpbs.org/t/pbs-release-nodes-no-jobid-given/1686/2 "2019-07-02T12:56:32Z")

</div>

When you do the ssh to ohpc137pbsib-sms and run pbs\_release\_nodes you are no longer “in” the PBS job from the perspective of the command (PBS\_JOBID environment variable is very likely unset in the ohpc137pbsib-sms that results from the ssh connection), so the error message is correct. You should be able to run pbs\_release\_nodes directly from within the job script (no ssh) without supplying -j.

---

<div class="post-metadata">

**Author:** ![tomoki](https://avatars.discourse-cdn.com/v4/letter/t/50afbb/32.png) [@tomoki](https://community.openpbs.org/u/tomoki)\
**Post date:** [July 3, 2019, 12:12am UTC](https://community.openpbs.org/t/pbs-release-nodes-no-jobid-given/1686/3 "2019-07-03T00:12:03Z")

</div>

Dear scc

Thanks for your comment.  
“pbs\_release\_nodes” could not be run on the primary execution node.  
See the following.

```
[test@ohpc137pbsib-sms ~]$ cat sleep_10.sh
#!/bin/bash
#PBS -N sleep_10
sleep 10
pbs_release_nodes -a
sleep 10

[test@ohpc137pbsib-sms ~]$

[test@ohpc137pbsib-sms ~]$ qsub -l select=3 sleep_10.sh
153.ohpc137pbsib-sms
[test@ohpc137pbsib-sms ~]$ qstat -an

ohpc137pbsib-sms:
                                                            Req'd Req'd Elap
Job ID Username Queue Jobname SessID NDS TSK Memory Time S Time
--------------- -------- -------- ---------- ------ --- --- ------ ----- - -----
153.ohpc137pbsi test workq sleep_10 63361 3 3 -- -- R 00:00
   ohpc137pbsib-c001/0+ohpc137pbsib-c002/0+ohpc137pbsib-c003/0
```

```
[test@ohpc137pbsib-sms ~]$ cat sleep_10.e153
pbs_release_nodes: Unauthorized Request
[test@ohpc137pbsib-sms ~]$
```

Therefore, I ssh to the ohpc137pbsib-sms and executed pbs\_release\_nodes.

Is “pbs\_release\_nodes” executable on the primary execution node?

If so, please tell me the reason for “Unauthorized Request”.

I can not imagine why it becomes “Unauthorized Request”.

---

<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:** [July 3, 2019, 7:27am UTC](https://community.openpbs.org/t/pbs-release-nodes-no-jobid-given/1686/4 "2019-07-03T07:27:52Z")

</div>

Is flatuid set to True in your server configuration ?  
You can find it out in the output of qstat -Bf

- can you please run the command pbs\_release\_nodes outside the script (as the job own) and whether it works

---

<div class="post-metadata">

**Author:** ![tomoki](https://avatars.discourse-cdn.com/v4/letter/t/50afbb/32.png) [@tomoki](https://community.openpbs.org/u/tomoki)\
**Post date:** [July 3, 2019, 7:42am UTC](https://community.openpbs.org/t/pbs-release-nodes-no-jobid-given/1686/5 "2019-07-03T07:42:56Z")

</div>

Thank you for pointing it out.  
Your point was correct.  
I confirmed as follows.

```
[root@ohpc137pbsib-sms ~]# qstat -Bf |grep flatuid
[root@ohpc137pbsib-sms ~]# qmgr -c "set server flatuid = True"
[root@ohpc137pbsib-sms ~]# qstat -Bf |grep flatuid
    flatuid = True
[root@ohpc137pbsib-sms ~]#

[test@ohpc137pbsib-sms ~]$ qsub -l select=3 sleep_10.sh
154.ohpc137pbsib-sms
[test@ohpc137pbsib-sms ~]$ qstat -an

ohpc137pbsib-sms:
                                                            Req'd Req'd Elap
Job ID Username Queue Jobname SessID NDS TSK Memory Time S Time
--------------- -------- -------- ---------- ------ --- --- ------ ----- - -----
154.ohpc137pbsi test workq sleep_10 89065 3 3 -- -- R 00:00
   ohpc137pbsib-c001/0+ohpc137pbsib-c002/0+ohpc137pbsib-c003/0

[test@ohpc137pbsib-sms ~]$ qstat -an

ohpc137pbsib-sms:
                                                            Req'd Req'd Elap
Job ID Username Queue Jobname SessID NDS TSK Memory Time S Time
--------------- -------- -------- ---------- ------ --- --- ------ ----- - -----
154.ohpc137pbsi test workq sleep_10 89065 1 1 -- -- R 00:00
   ohpc137pbsib-c001/0
[test@ohpc137pbsib-sms ~]$
```

```
[test@ohpc137pbsib-sms ~]$ cat sleep_10.o154
[test@ohpc137pbsib-sms ~]$ cat sleep_10.e154
[test@ohpc137pbsib-sms ~]$
```

---

<div class="post-metadata">

**Author:** ![scc](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.openpbs.org/scc/32/234_2.png) [@scc](https://community.openpbs.org/u/scc)\
**Post date:** [July 3, 2019, 5:47pm UTC](https://community.openpbs.org/t/pbs-release-nodes-no-jobid-given/1686/6 "2019-07-03T17:47:26Z")

</div>

Setting flatuid=true is one way to allow this, but it does introduce a security situation as now any user who can connect a system to the network and control the user name space on that system can submit a job as any other user. Everything I said in my post at “[Where to submit a job instead of pbs server](http://community.openpbs.org/t/where-to-submit-a-job-instead-of-pbs-server/513/10)” would also apply here, since the server does the same check of the remote user’s authorization to submit a job (as discussed in that post) as to act on an existing job (such as releasing nodes from it).
