k6 : panic: runtime error: invalid memory address or nil pointer dereference : docker run

67 Views Asked by At
FROM golang:1.20-bullseye as builder

RUN go install -trimpath go.k6.io/xk6/cmd/xk6@latest

RUN  xk6 build --output "/tmp/k6" --with github.com/grafana/xk6-browser

# Create grafana.ini file with the necessary configuration
RUN echo "wal = true" > /tmp/grafana.ini

FROM debian:bullseye

RUN apt-get update && \
    apt-get install -y chromium

COPY --from=builder /tmp/k6 /usr/bin/k6

# Copy the grafana.ini file
COPY --from=builder /tmp/grafana.ini /etc/grafana.ini

ENV K6_BROWSER_HEADLESS=true

#ENTRYPOINT ["k6"]

WORKDIR /k6-performance-test

COPY Browser_Test/chaostestingt.js .
COPY users.json .
COPY profiles.json .

CMD ["k6", "run", "chaostestingt.js"]

I have the above docker file which i was using to run the k6 script ,it was working find till last week,but now throwing belwo exception

 panic: runtime error: invalid memory address or nil pointer dereference
    [signal SIGSEGV: segmentation violation code=0x1 addr=0x38 pc=0xec5b8f]
    
    goroutine 46 [running]:
    github.com/grafana/xk6-browser/common.(*Frame).requestByID(0xc00219c540, {0xc00034b350, 0x6})
        github.com/grafana/[email protected]/common/frame.go:435 +0x54f
    github.com/grafana/xk6-browser/common.(*FrameManager).requestFailed(0xc002da4000, 0xc002c0e3c0, 0x1)
        github.com/grafana/[email protected]/common/frame_manager.go:454 +0x4d7
    github.com/grafana/xk6-browser/common.(*NetworkManager).onLoadingFailed(0xc0009b1100, 0xc000c76300)
        github.com/grafana/[email protected]/common/network_manager.go:375 +0x112
    github.com/grafana/xk6-browser/common.(*NetworkManager).handleEvents(0xc0009b1100, 0xc003a42720)
        github.com/grafana/[email protected]/common/network_manager.go:347 +0x286
    github.com/grafana/xk6-browser/common.(*NetworkManager).initEvents.func1()
        github.com/grafana/[email protected]/common/network_manager.go:330 +0x37
    created by github.com/grafana/xk6-browser/common.(*NetworkManager).initEvents
        github.com/grafana/[email protected]/common/network_manager.go:329 +0x14d

Note : the exception is occurring only when trying to run from docker and when ran same script from local not seeing the "invalid memory address" exception Also there were not changes made in between Its also mainly occuring when trying await page.goto(url); (its the 2nd time we requesting this teh intial url loading having no issue ,but when tried 2nd time its causing this issue)

0

There are 0 best solutions below