Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

"You can have my Unix system when you pry it from my cold, dead fingers." -- Cal Keegan


computers / Rocksolid Nodes Help / help request : cron job ==> PHP Fatal error: Uncaught TypeError: posix_getsid(): Argument #1 ($process_id) must be of type int, string given

SubjectAuthor
* help request : cron job ==> PHP Fatal error: Uncaught TypeError:SugarBug
`* help request : cron job ==> PHP Fatal error: Uncaught TypeError:Retro Guy
 +- help request : cron job ==> PHP Fatal error: Uncaught TypeError:Retro Guy
 `* help request : cron job ==> PHP Fatal error: UncaughtSugarBug
  `- help request : cron job ==> PHP Fatal error: Uncaught TypeError:Retro Guy

1
help request : cron job ==> PHP Fatal error: Uncaught TypeError: posix_getsid(): Argument #1 ($process_id) must be of type int, string given

<ulqaa5$f3m6$2@paganini.bofh.team>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=721&group=rocksolid.nodes.help#721

  copy link   Newsgroups: rocksolid.nodes.help
Path: i2pn2.org!i2pn.org!paganini.bofh.team!tor-network!not-for-mail
From: 3883@sugar.bug (SugarBug)
Newsgroups: rocksolid.nodes.help
Subject: help request : cron job ==> PHP Fatal error: Uncaught TypeError:
posix_getsid(): Argument #1 ($process_id) must be of type int, string given
Date: Mon, 18 Dec 2023 14:34:24 -0600
Organization: To protect and to server
Message-ID: <ulqaa5$f3m6$2@paganini.bofh.team>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 18 Dec 2023 20:33:10 -0000 (UTC)
Injection-Info: paganini.bofh.team; logging-data="495302"; posting-host="VP3Waac8877EAd0L/jWCDA.user.paganini.bofh.team"; mail-complaints-to="usenet@bofh.team"; posting-account="9dIQLXBM7WM9KzA+yjdR4A";
Cancel-Lock: sha256:6n6R1AqEoU3YO3Eaq/MjJwKJBcf6sxiXXPSkq44Btoc=
X-Notice: Filtered by postfilter v. 0.9.3
X-TOR-Router: sha256:MTk0LjI2LjE5Mi42NA== --
 by: SugarBug - Mon, 18 Dec 2023 20:34 UTC

I had a working setup that syncronized for a day or so, and now has
started giving this error on every run of the cron:

PHP Fatal error: Uncaught TypeError: posix_getsid(): Argument #1
($process_id) must be of type int, string given in
..../config/scripts/expire.php:10 Stack trace: #0
..../config/scripts/expire.php(10):
posix_getsid() #1 {main} thrown in
..../config/scripts/expire.php
on line 10

I also got this error in systemd log:

PHP Fatal error: Uncaught TypeError: posix_getsid(): Argument #1
($process_id) must be of type int, string given in
..../config/scripts/spoolnews.php:68
Dec 18 15:19:12 php[1355]: Stack trace:
Dec 18 15:19:12 php[1355]: #0
..../config/scripts/spoolnews.php(68):
posix_getsid()
Dec 18 15:19:12 php[1355]: #1 {main}
Dec 18 15:19:12 php[1355]: thrown in
..../config/scripts/spoolnews.php
on line 68

What should I look at to troubleshoot?

Re: help request : cron job ==> PHP Fatal error: Uncaught TypeError: posix_getsid(): Argument #1 ($process_id) must be of type int, string given

<ulqamt$72kp$3@i2pn2.org>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=722&group=rocksolid.nodes.help#722

  copy link   Newsgroups: rocksolid.nodes.help
Path: i2pn2.org!.POSTED!not-for-mail
From: retroguy@i2pn2.org (Retro Guy)
Newsgroups: rocksolid.nodes.help
Subject: Re: help request : cron job ==> PHP Fatal error: Uncaught TypeError:
posix_getsid(): Argument #1 ($process_id) must be of type int, string given
Date: Mon, 18 Dec 2023 20:39:58 -0000 (UTC)
Organization: i2pn2 (i2pn.org)
Message-ID: <ulqamt$72kp$3@i2pn2.org>
References: <ulqaa5$f3m6$2@paganini.bofh.team>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 18 Dec 2023 20:39:58 -0000 (UTC)
Injection-Info: i2pn2.org;
logging-data="232089"; mail-complaints-to="usenet@i2pn2.org";
posting-account="Gg8gAsZLN5FnWZrpbmz42d6ib2C2ewfwYI9Q557pxrY";
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
X-Face: .&YR-G(w(DZ$$,}%k=]*5*!p'=(anr"IT`wZG'2VWdfl\r)l[42u7JH`n(JUQ*e5
*A|XCDf?&\X&uwkl38"CYX3O8m}C8E4p'%N$2#kSTVzx{Ly|DjLT\Vk7NE}NQ(VC$Yq]i:7
|z[.9iv^g>*8_BH0=hZt'[%)4kG|
 by: Retro Guy - Mon, 18 Dec 2023 20:39 UTC

On Mon, 18 Dec 2023 14:34:24 -0600, SugarBug wrote:

> I had a working setup that syncronized for a day or so, and now has
> started giving this error on every run of the cron:
>
> PHP Fatal error: Uncaught TypeError: posix_getsid(): Argument #1
> ($process_id) must be of type int, string given in
> .../config/scripts/expire.php:10 Stack trace: #0
> .../config/scripts/expire.php(10):
> posix_getsid() #1 {main} thrown in .../config/scripts/expire.php on line
> 10

It's trying to get the session id of the process id:

$lockfile = $lockdir . '/' . $config_name . '-spoolnews.lock';
$pid = file_get_contents($lockfile);
if (posix_getsid($pid) === false || ! is_file($lockfile)) {

This is to avoid running expire.php if it's already running.

I'm not sure how $pid could be a string. It's written by:

file_put_contents($lockfile, getmypid()); // create lockfile

What does spoolnews.lock contain?

Re: help request : cron job ==> PHP Fatal error: Uncaught TypeError: posix_getsid(): Argument #1 ($process_id) must be of type int, string given

<ulqau5$72kp$4@i2pn2.org>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=723&group=rocksolid.nodes.help#723

  copy link   Newsgroups: rocksolid.nodes.help
Path: i2pn2.org!.POSTED!not-for-mail
From: retroguy@i2pn2.org (Retro Guy)
Newsgroups: rocksolid.nodes.help
Subject: Re: help request : cron job ==> PHP Fatal error: Uncaught TypeError:
posix_getsid(): Argument #1 ($process_id) must be of type int, string given
Date: Mon, 18 Dec 2023 20:43:49 -0000 (UTC)
Organization: i2pn2 (i2pn.org)
Message-ID: <ulqau5$72kp$4@i2pn2.org>
References: <ulqaa5$f3m6$2@paganini.bofh.team> <ulqamt$72kp$3@i2pn2.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 18 Dec 2023 20:43:49 -0000 (UTC)
Injection-Info: i2pn2.org;
logging-data="232089"; mail-complaints-to="usenet@i2pn2.org";
posting-account="Gg8gAsZLN5FnWZrpbmz42d6ib2C2ewfwYI9Q557pxrY";
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
X-Face: .&YR-G(w(DZ$$,}%k=]*5*!p'=(anr"IT`wZG'2VWdfl\r)l[42u7JH`n(JUQ*e5
*A|XCDf?&\X&uwkl38"CYX3O8m}C8E4p'%N$2#kSTVzx{Ly|DjLT\Vk7NE}NQ(VC$Yq]i:7
|z[.9iv^g>*8_BH0=hZt'[%)4kG|
 by: Retro Guy - Mon, 18 Dec 2023 20:43 UTC

On Mon, 18 Dec 2023 20:39:58 -0000 (UTC), Retro Guy wrote:

> On Mon, 18 Dec 2023 14:34:24 -0600, SugarBug wrote:
>
>> I had a working setup that syncronized for a day or so, and now has
>> started giving this error on every run of the cron:
>>
>> PHP Fatal error: Uncaught TypeError: posix_getsid(): Argument #1
>> ($process_id) must be of type int, string given in
>> .../config/scripts/expire.php:10 Stack trace: #0
>> .../config/scripts/expire.php(10):
>> posix_getsid() #1 {main} thrown in .../config/scripts/expire.php on
>> line 10
>
> It's trying to get the session id of the process id:
>
> $lockfile = $lockdir . '/' . $config_name . '-spoolnews.lock';
> $pid = file_get_contents($lockfile);
> if (posix_getsid($pid) === false || ! is_file($lockfile)) {
>
> This is to avoid running expire.php if it's already running.
>
> I'm not sure how $pid could be a string. It's written by:
>
> file_put_contents($lockfile, getmypid()); // create lockfile
>
> What does spoolnews.lock contain?

If it looks ok, maybe try changing this:

$lockfile = $lockdir . '/' . $config_name . '-spoolnews.lock';
$pid = file_get_contents($lockfile);
if (posix_getsid($pid) === false || ! is_file($lockfile)) {

To this (@ line 8 in expire.php):

$lockfile = $lockdir . '/' . $config_name . '-spoolnews.lock';

if (is_file($lockfile)) {
$pid = file_get_contents($lockfile);
} else {
$pid = false;
} if (posix_getsid($pid) === false || ! is_file($lockfile)) {

in expire.php. (I have not tested this change)

Re: help request : cron job ==> PHP Fatal error: Uncaught TypeError: posix_getsid(): Argument #1 ($process_id) must be of type int, string given

<ulqema$fb6a$1@paganini.bofh.team>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=724&group=rocksolid.nodes.help#724

  copy link   Newsgroups: rocksolid.nodes.help
Path: i2pn2.org!i2pn.org!nntp.comgw.net!paganini.bofh.team!tor-network!not-for-mail
From: 3883@sugar.bug (SugarBug)
Newsgroups: rocksolid.nodes.help
Subject: Re: help request : cron job ==> PHP Fatal error: Uncaught
TypeError: posix_getsid(): Argument #1 ($process_id) must be of type int,
string given
Date: Mon, 18 Dec 2023 15:49:10 -0600
Organization: To protect and to server
Message-ID: <ulqema$fb6a$1@paganini.bofh.team>
References: <ulqaa5$f3m6$2@paganini.bofh.team>
<ulqamt$72kp$3@i2pn2.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 18 Dec 2023 21:47:55 -0000 (UTC)
Injection-Info: paganini.bofh.team; logging-data="502986"; posting-host="u9SGXBxcWYwZ1KHlPjHD2Q.user.paganini.bofh.team"; mail-complaints-to="usenet@bofh.team"; posting-account="9dIQLXBM7WM9KzA+yjdR4A";
Cancel-Lock: sha256:iqSmb+hK3FthWfYMG/noiCvTqmB6wT9i3NLLa8qu2WE=
X-TOR-Router: sha256:MmEwYjpmNGMxOjI6OjI0Mg== --
X-Notice: Filtered by postfilter v. 0.9.3
 by: SugarBug - Mon, 18 Dec 2023 21:49 UTC

On Mon, 18 Dec 2023 20:39:58 -0000 (UTC)
Retro Guy <retroguy@i2pn2.org> wrote:

> On Mon, 18 Dec 2023 14:34:24 -0600, SugarBug wrote:
>
> > I had a working setup that syncronized for a day or so, and now has
> > started giving this error on every run of the cron:
> >
> > PHP Fatal error: Uncaught TypeError: posix_getsid(): Argument #1
> > ($process_id) must be of type int, string given in
> > .../config/scripts/expire.php:10 Stack trace: #0
> > .../config/scripts/expire.php(10):
> > posix_getsid() #1 {main} thrown in .../config/scripts/expire.php on
> > line 10
>
> It's trying to get the session id of the process id:
>
> $lockfile = $lockdir . '/' . $config_name . '-spoolnews.lock';
> $pid = file_get_contents($lockfile);
> if (posix_getsid($pid) === false || ! is_file($lockfile)) {
>
> This is to avoid running expire.php if it's already running.
>
> I'm not sure how $pid could be a string. It's written by:
>
> file_put_contents($lockfile, getmypid()); // create lockfile
>
> What does spoolnews.lock contain?

All the *spoolnews*.lock files were empty files. I deleted them and ran
the cron and the error went away. Perhaps a null string was being read
by the script?

It also caused the web portal page data to disappear. I haven't figured
that out yet. Probably because the error killed the job? The group
listings disappeared so that there was just a blank page. Overboard
still worked but the main page was empty.

I deleted all the lock files and re-ran the cron again and the web
pages were re-built and now seem to work.

Re: help request : cron job ==> PHP Fatal error: Uncaught TypeError: posix_getsid(): Argument #1 ($process_id) must be of type int, string given

<294810986d070179a9c1ba3de282b6e9$1@news.novabbs.org>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=725&group=rocksolid.nodes.help#725

  copy link   Newsgroups: rocksolid.nodes.help
Date: Mon, 18 Dec 2023 21:58:07 +0000
Message-ID: <294810986d070179a9c1ba3de282b6e9$1@news.novabbs.org>
Organization: Rocksolid Light
From: retroguy@novabbs.org (Retro Guy)
Subject: Re: help request : cron job ==> PHP Fatal error: Uncaught TypeError:
posix_getsid(): Argument #1 ($process_id) must be of type int, string given
Newsgroups: rocksolid.nodes.help
X-Face: .&YR-G(w(DZ$$,}%k=]*5*!p'=(anr"IT`wZG'2VWdfl\r)l[42u7JH`n(JUQ*e5
*A|XCDf?&\X&uwkl38"CYX3O8m}C8E4p'%N$2#kSTVzx{Ly|DjLT\Vk7NE}NQ(VC$Yq]i:7
|z[.9iv^g>*8_BH0=hZt'[%)4kG|
References: <ulqaa5$f3m6$2@paganini.bofh.team> <ulqamt$72kp$3@i2pn2.org>
<ulqema$fb6a$1@paganini.bofh.team>
MIME-Version: 1.0
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
 by: Retro Guy - Mon, 18 Dec 2023 21:58 UTC

On Mon, 18 Dec 2023 15:49:10 -0600, SugarBug wrote:

> On Mon, 18 Dec 2023 20:39:58 -0000 (UTC)
> Retro Guy <retroguy@i2pn2.org> wrote:
>
>> On Mon, 18 Dec 2023 14:34:24 -0600, SugarBug wrote:
>>
>> > I had a working setup that syncronized for a day or so, and now has
>> > started giving this error on every run of the cron:
>> >
>> > PHP Fatal error: Uncaught TypeError: posix_getsid(): Argument #1
>> > ($process_id) must be of type int, string given in
>> > .../config/scripts/expire.php:10 Stack trace: #0
>> > .../config/scripts/expire.php(10):
>> > posix_getsid() #1 {main} thrown in .../config/scripts/expire.php on
>> > line 10
>>
>> It's trying to get the session id of the process id:
>>
>> $lockfile = $lockdir . '/' . $config_name . '-spoolnews.lock';
>> $pid = file_get_contents($lockfile);
>> if (posix_getsid($pid) === false || ! is_file($lockfile)) {
>>
>> This is to avoid running expire.php if it's already running.
>>
>> I'm not sure how $pid could be a string. It's written by:
>>
>> file_put_contents($lockfile, getmypid()); // create lockfile
>>
>> What does spoolnews.lock contain?
>
> All the *spoolnews*.lock files were empty files. I deleted them and ran
> the cron and the error went away. Perhaps a null string was being read
> by the script?
>
> It also caused the web portal page data to disappear. I haven't figured
> that out yet. Probably because the error killed the job? The group
> listings disappeared so that there was just a blank page. Overboard
> still worked but the main page was empty.
>
> I deleted all the lock files and re-ran the cron again and the web pages
> were re-built and now seem to work.

Glad it's working!

I'll make the change in expire.php I posted about. It can't hurt.

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor