Git Product home page Git Product logo

Comments (22)

allaire avatar allaire commented on August 21, 2024

@gmartsenkov are you having the same issue?

I'm unsure if this could have been caused by some kind of recent OS upgrade. It was working fine prior to running apt upgrade on my servers.

from inspeqtor.

mperham avatar mperham commented on August 21, 2024

The code is reading /proc/<pid>/status and looking for the VmRSS line. That error would occur if there was an empty line in the output. Can you show me what /proc/1357/status looks like?

from inspeqtor.

allaire avatar allaire commented on August 21, 2024

@mperham Hi Mike, here you go:

Name:	ruby
State:	S (sleeping)
Tgid:	1357
Ngid:	0
Pid:	1357
PPid:	1
TracerPid:	0
Uid:	1001	1001	1001	1001
Gid:	1002	1002	1002	1002
FDSize:	256
Groups:	1001 1002
NStgid:	1357
NSpid:	1357
NSpgid:	1357
NSsid:	1357
VmPeak:	  200632 kB
VmSize:	  140688 kB
VmLck:	       0 kB
VmPin:	       0 kB
VmHWM:	   17856 kB
VmRSS:	   17856 kB
VmData:	   78352 kB
VmStk:	    8188 kB
VmExe:	    3188 kB
VmLib:	    6704 kB
VmPTE:	     156 kB
VmPMD:	      12 kB
VmSwap:	       0 kB
HugetlbPages:	       0 kB
Threads:	3
SigQ:	0/7930
SigPnd:	0000000000000000
ShdPnd:	0000000000000000
SigBlk:	0000000000000000
SigIgn:	0000000000000000
SigCgt:	00000001c2317e4f
CapInh:	0000000000000000
CapPrm:	0000000000000000
CapEff:	0000000000000000
CapBnd:	0000003fffffffff
CapAmb:	0000000000000000
Seccomp:	0

Speculation_Store_Bypass:	vulnerable
Cpus_allowed:	7fff
Cpus_allowed_list:	0-14
Mems_allowed:	00000000,00000001
Mems_allowed_list:	0
voluntary_ctxt_switches:	13074
nonvoluntary_ctxt_switches:	415

from inspeqtor.

mperham avatar mperham commented on August 21, 2024

Yep, there's the blank line.

from inspeqtor.

allaire avatar allaire commented on August 21, 2024

Oh I see you made a fix, awesome! My ansible role is using apt to install. Are you going to cut a release as well?

Thanks so much!

from inspeqtor.

mperham avatar mperham commented on August 21, 2024

I'm working on #146 and will release 2.0 with the Pro functionality sometime soon.

from inspeqtor.

allaire avatar allaire commented on August 21, 2024

Great, and in the meantime, is there a way to patch the issue on my side?

from inspeqtor.

allaire avatar allaire commented on August 21, 2024

@mperham So I compiled by hand and now I'm getting this:

May 31 21:07:22 app-01 inspeqtor[16443]: panic: runtime error: index out of range
May 31 21:07:22 app-01 inspeqtor[16443]: goroutine 15 [running]:
May 31 21:07:22 app-01 inspeqtor[16443]: github.com/mperham/inspeqtor/metrics.totalRssCollector(0x54d, 0xc42001c7d0, 0x0, 0x0)
May 31 21:07:22 app-01 inspeqtor[16443]:         /Users/allaire/.go/src/github.com/mperham/inspeqtor/metrics/process.go:158 +0x785
May 31 21:07:22 app-01 inspeqtor[16443]: github.com/mperham/inspeqtor/metrics.(*processStorage).Collect(0xc42001c7d0, 0x54d, 0x848dc0, 0xc420065ef0)
May 31 21:07:22 app-01 inspeqtor[16443]:         /Users/allaire/.go/src/github.com/mperham/inspeqtor/metrics/process.go:238 +0x12f
May 31 21:07:22 app-01 inspeqtor[16443]: github.com/mperham/inspeqtor.(*Service).Collect(0xc420065ef0, 0x847900, 0xc4200532a0)
May 31 21:07:22 app-01 inspeqtor[16443]:         /Users/allaire/.go/src/github.com/mperham/inspeqtor/types.go:148 +0x1a1
May 31 21:07:22 app-01 inspeqtor[16443]: created by github.com/mperham/inspeqtor.(*Inspeqtor).scan
May 31 21:07:22 app-01 inspeqtor[16443]:         /Users/allaire/.go/src/github.com/mperham/inspeqtor/inspeqtor.go:293 +0x186
May 31 21:07:22 app-01 systemd[1]: inspeqtor.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
May 31 21:07:22 app-01 systemd[1]: inspeqtor.service: Unit entered failed state.
May 31 21:07:22 app-01 systemd[1]: inspeqtor.service: Failed with result 'exit-code'.
May 31 21:07:23 app-01 systemd[1]: inspeqtor.service: Service hold-off time over, scheduling restart.
May 31 21:07:23 app-01 systemd[1]: Stopped Inspeqtor.
May 31 21:07:23 app-01 systemd[1]: inspeqtor.service: Start request repeated too quickly.

from inspeqtor.

allaire avatar allaire commented on August 21, 2024

So I'm no Go expert (never used it before), but I took your fix:

if len(line) == 0 {
  continue
}

and I copied it where I found for _, line := range lines { in process.go, and now it works. 🤷‍♂️

from inspeqtor.

mperham avatar mperham commented on August 21, 2024

Good call, updated.

from inspeqtor.

gmartsenkov avatar gmartsenkov commented on August 21, 2024

I was getting a similar error, but for nginx - basically, if the status endpoint does not exist inspeqtor fails to start with a vague error, had to dig in through the code to figure it out

from inspeqtor.

mperham avatar mperham commented on August 21, 2024

from inspeqtor.

allaire avatar allaire commented on August 21, 2024

@mperham AFAIK ngx_http_stub_status_module is not built/setup by default.

http://nginx.org/en/docs/http/ngx_http_stub_status_module.html
https://www.datadoghq.com/blog/how-to-collect-nginx-metrics/

Maybe @gmartsenkov thought that nginx exposed this endpoint by default.

from inspeqtor.

mperham avatar mperham commented on August 21, 2024

Oh, I was thinking of /etc/<pid>/status. Nevermind. Didn't realize you were talking about nginx-specific metric collection. That's a separate issue, not this one.

from inspeqtor.

felixbuenemann avatar felixbuenemann commented on August 21, 2024

I was also running into this with inspeqtor-1.0.1-1 on Ubuntu Xenial and Linux 4.4.0-128-generic.

Compiling Inspeqtor from master and replacing the binary on the server fixed the problem.

from inspeqtor.

kesha-antonov avatar kesha-antonov commented on August 21, 2024

+1 have same issue

from inspeqtor.

kesha-antonov avatar kesha-antonov commented on August 21, 2024
sudo service inspeqtor status
● inspeqtor.service - Inspeqtor
   Loaded: loaded (/lib/systemd/system/inspeqtor.service; enabled; vendor preset: enabled)
   Active: inactive (dead) (Result: exit-code) since Tue 2018-06-19 20:31:37 UTC; 2s ago
  Process: 19189 ExecStart=/usr/bin/inspeqtor -c /etc/inspeqtor -s /var/run/inspeqtor.sock (code=exited, status=2)
  Process: 19186 ExecStartPre=/bin/rm -f /var/run/inspeqtor.sock (code=exited, status=0/SUCCESS)
 Main PID: 19189 (code=exited, status=2)

Jun 19 20:31:36 ip-172-31-20-112 inspeqtor[19189]:         /Users/mike/src/github.com/mperham/inspeqtor/types.go:148 +0x21d
Jun 19 20:31:36 ip-172-31-20-112 inspeqtor[19189]: created by github.com/mperham/inspeqtor.(*Inspeqtor).scan
Jun 19 20:31:36 ip-172-31-20-112 inspeqtor[19189]:         /Users/mike/src/github.com/mperham/inspeqtor/inspeqtor.go:295 +0x217
Jun 19 20:31:36 ip-172-31-20-112 systemd[1]: inspeqtor.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Jun 19 20:31:36 ip-172-31-20-112 systemd[1]: inspeqtor.service: Unit entered failed state.
Jun 19 20:31:36 ip-172-31-20-112 systemd[1]: inspeqtor.service: Failed with result 'exit-code'.
Jun 19 20:31:37 ip-172-31-20-112 systemd[1]: inspeqtor.service: Service hold-off time over, scheduling restart.
Jun 19 20:31:37 ip-172-31-20-112 systemd[1]: Stopped Inspeqtor.
Jun 19 20:31:37 ip-172-31-20-112 systemd[1]: inspeqtor.service: Start request repeated too quickly.
Jun 19 20:31:37 ip-172-31-20-112 systemd[1]: Failed to start Inspeqtor.

from inspeqtor.

kesha-antonov avatar kesha-antonov commented on August 21, 2024

How to fix it?

from inspeqtor.

kesha-antonov avatar kesha-antonov commented on August 21, 2024
inspeqtor -v
Inspeqtor 1.0.1

from inspeqtor.

felixbuenemann avatar felixbuenemann commented on August 21, 2024

How to fix it?

  • Install golang and make
  • Clone the inspeqtor repo
  • Run make
  • Copy inspeqtor to /usr/bin/inspeqtor
  • Restart inspeqtor service

Or wait for a new release…

from inspeqtor.

mperham avatar mperham commented on August 21, 2024

Master is now 2.0.0-rc. If someone wants to rebuild, smoke test it on their server and give me a thumbs up, I'll release 2.0.0.

from inspeqtor.

felixbuenemann avatar felixbuenemann commented on August 21, 2024

I've installed the latest build from master on a server, I'll see how it goes.

from inspeqtor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.