partkeepr / PartKeepr

Open Source Inventory Management
http://www.partkeepr.org
GNU General Public License v3.0
1.38k stars 400 forks source link

Partkeepr stuck #984

Closed kuon closed 4 years ago

kuon commented 6 years ago

System Information

I have a weird issue with partkeepr being "stuck". The problem started manifesting itself today. I was under version 1.3.0 when the problem appeared. To be sure it was not fixed I tried with the latest git version.

The issue is simple. When running php app.php (through CLI or fpm) hangs forever. I am not familiar with php debuging, but I did a syscall trace:

$ truss php app.php

... first lines redacted
getpid()                                         = 7359 (0x1cbf)
open("/var/partkeepr/vendor/guzzle/guzzle/src/Guzzle/Http/Resources/cacert.pem",O_RDONLY,0666) = 4 (0x4)
fstat(4,{ mode=-rw-r--r-- ,inode=2015,size=250394,blksize=131072 }) = 0 (0x0)
read(4,"##\n## Bundle of CA Root Certifi"...,131072) = 131072 (0x20000)
read(4," CA 2\n========================="...,131072) = 119322 (0x1d21a)
read(4,0x80f171e40,131072)                       = 0 (0x0)
close(4)                                         = 0 (0x0)
getpid()                                         = 7359 (0x1cbf)
write(3,"\^V\^C\^A\^B\0\^A\0\^A\M-|\^C\^C"...,517) = 517 (0x205)
read(3,0x80f17b300,7)                            ERR#35 'Resource temporarily unavailable'
select(4,{ 3 },{ },{ },{ 1.000000 })             = 1 (0x1)
poll({ 3/POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND },1,0) = 1 (0x1)
read(3,"\^V\^C\^C\0]\^B\0",7)                    = 7 (0x7)
read(3,"\0Y\^C\^C\M-Y\M^IA\M^H\M-T\^O\^W"...,91) = 91 (0x5b)
read(3,"\^V\^C\^C\v\M-?",5)                      = 5 (0x5)
read(3,"\v\0\v\M-;\0\v\M-8\0\a\^\0\M^B\a"...,3007) = 3007 (0xbbf)
issetugid()                                      = 0 (0x0)
open("/usr/share/zoneinfo/UTC",O_RDONLY,00)      = 4 (0x4)
fstat(4,{ mode=-r--r--r-- ,inode=12381,size=118,blksize=4096 }) = 0 (0x0)
read(4,"TZif2\0\0\0\0\0\0\0\0\0\0\0\0\0"...,41448) = 118 (0x76)
close(4)                                         = 0 (0x0)
issetugid()                                      = 0 (0x0)
open("/usr/share/zoneinfo/posixrules",O_RDONLY,06423226000) = 4 (0x4)
fstat(4,{ mode=-r--r--r-- ,inode=12364,size=3519,blksize=4096 }) = 0 (0x0)
read(4,"TZif2\0\0\0\0\0\0\0\0\0\0\0\0\0"...,41448) = 3519 (0xdbf)
close(4)                                         = 0 (0x0)
read(3,"\^V\^C\^C\^BM",5)                        = 5 (0x5)
read(3,"\f\0\^BI\^C\0\^WA\^Dx\M-\\M->"...,589)   = 589 (0x24d)
read(3,"\^V\^C\^C\0\^D",5)                       = 5 (0x5)
read(3,"\^N\0\0\0",4)                            = 4 (0x4)
getpid()                                         = 7359 (0x1cbf)
getpid()                                         = 7359 (0x1cbf)
write(3,"\^V\^C\^C\0F\^P\0\0BA\^D\M-j<Re"...,126) = 126 (0x7e)
read(3,0x80f17b303,5)                            ERR#35 'Resource temporarily unavailable'
select(4,{ 3 },{ },{ },{ 1.000000 })             = 1 (0x1)
poll({ 3/POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND },1,0) = 1 (0x1)
read(3,"\^T\^C\^C\0\^A",5)                       = 5 (0x5)
read(3,"\^A",1)                                  = 1 (0x1)
read(3,"\^V\^C\^C\0(",5)                         = 5 (0x5)
read(3,"\M-i7!5\M-!\M-Z!\^]\v%\M-Z]\M^["...,40)  = 40 (0x28)
write(3,"\^W\^C\^C\0\M^K\M^S2\M-a\M-D\f"...,144) = 144 (0x90)
poll({ 3/POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND },1,0) = 0 (0x0)
select(4,{ 3 },{ },{ },{ 1.000000 })             = 0 (0x0)
poll({ 3/POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND },1,0) = 0 (0x0)
select(4,{ 3 },{ },{ },{ 1.000000 })             = 0 (0x0)
poll({ 3/POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND },1,0) = 0 (0x0)
select(4,{ 3 },{ },{ },{ 1.000000 })             = 0 (0x0)
poll({ 3/POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND },1,0) = 0 (0x0)
.... poll/select loop forever

It seems to be stuck after reading some timezone files.

Drachenkaetzchen commented 6 years ago

Please note that the GitHub issue tracker is reserved for bug reports and feature requests. It is not a support forum - for community support, please refer to https://partkeepr.com/support/

Drachenkaetzchen commented 6 years ago

I do not believe that this is a PartKeepr issue, it looks more like a system issue (kernel bug, or failing hard drive). Please re-open if you can pinpoint it to an actual PartKeepr bug.

kuon commented 6 years ago

I was able to pinpoint the issue to getPatreonStatus.

partkeepr.org is down and it is what is causing the issue. The curl process is stuck in curl_multi_select(). I waited a few minutes with no timeout.

I found this issue: https://bugs.php.net/bug.php?id=63842 but it seems old.

As for the partkeepr side of things I disabled the patreon status. I don't know if partkeepr should do something about this bug. Maybe don't use guzzle/guzzle which is abandoned and is the wrapper around curl.

Drachenkaetzchen commented 6 years ago

You're right, that should not happen, PartKeepr should continue to work even if partkeepr.org is down. Reopening to find a solution:

  1. Don't retrieve the patreon status when logging in; instead, retrieve the patreon status async via a cronjob (similar to syncTips)
  2. Replace guzzle with something else
blackest commented 6 years ago

Indexcontroller.php has a call for the patreon status. Rather strangely i found that safari was ok with it but chrome wouldn't load the page.

Drachenkaetzchen commented 6 years ago

Maybe it was an overlap, I fixed the non working partkeepr.org an hour ago

Drachenkaetzchen commented 4 years ago

No feedback given for an extended period of time, closing the issue.

Feel free to re-open if you have additional information.