Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

panic serving xxx: runtime error: index out of range [-1] #302

Closed
UlyssesZh opened this issue Jul 11, 2024 · 5 comments
Closed

panic serving xxx: runtime error: index out of range [-1] #302

UlyssesZh opened this issue Jul 11, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@UlyssesZh
Copy link

I am using almost the exact same docker compose contents from readme. At first everything looks good, but this error (or similar ones) occasionally occurs randomly, and then everything is 502:

Opengist v1.7.3
Using YAML config file: /config.yml
Using environment variables config: OG_OPENGIST_HOME
echo: http: panic serving 192.168.16.1:43572: runtime error: index out of range [-1]
goroutine 121 [running]:
net/http.(*conn).serve.func1()
    /usr/local/go/src/net/http/server.go:1898 +0xbe
panic({0x1395440?, 0xc000b560f0?})
    /usr/local/go/src/runtime/panic.go:770 +0x132
golang.org/x/text/cases.(*context).copyXOR(0x10?)
    /root/go/pkg/mod/golang.org/x/[email protected]/cases/context.go:143 +0x10b
golang.org/x/text/cases.title(0xc0003e6e60?)
    /root/go/pkg/mod/golang.org/x/[email protected]/cases/context.go:283 +0x1ca
golang.org/x/text/cases.(*titleCaser).Transform(0xc0003e6e60, {0xc000276b00?, 0x70f2df19fb2d?, 0x7?}, {0xc000276b80?, 0x10?, 0xc000680008?}, 0xce?)
    /root/go/pkg/mod/golang.org/x/[email protected]/cases/map.go:354 +0x24b
golang.org/x/text/transform.String({0x70f2df148dc0, 0xc0003e6e60}, {0xc000b4c200, 0x10})
    /root/go/pkg/mod/golang.org/x/[email protected]/transform/transform.go:601 +0x1f5
golang.org/x/text/cases.Caser.String(...)
    /root/go/pkg/mod/golang.org/x/[email protected]/cases/cases.go:51
github.com/thomiceli/opengist/internal/web.loadSettings({0x27f79a8, 0xc000643860})
    /opengist/internal/web/util.go:119 +0x145
github.com/thomiceli/opengist/internal/web.dataInit.func1({0x27f79a8, 0xc000643860})
    /opengist/internal/web/server.go:384 +0x1e7
github.com/labstack/echo/v4.(*Echo).ServeHTTP.func1({0x27f79a8, 0xc000643860})
    /root/go/pkg/mod/github.com/labstack/echo/[email protected]/echo.go:668 +0x127
github.com/labstack/echo/v4/middleware.RequestLoggerConfig.ToMiddleware.func1.1({0x27f79a8, 0xc000643860})
    /root/go/pkg/mod/github.com/labstack/echo/[email protected]/middleware/request_logger.go:286 +0x16b
github.com/labstack/echo/v4/middleware.CORSWithConfig.func1.1({0x27f79a8, 0xc000643860})
    /root/go/pkg/mod/github.com/labstack/echo/[email protected]/middleware/cors.go:203 +0x463
github.com/thomiceli/opengist/internal/web.NewServer.RemoveTrailingSlash.RemoveTrailingSlashWithConfig.func8.1({0x27f79a8, 0xc000643860})
    /root/go/pkg/mod/github.com/labstack/echo/[email protected]/middleware/slash.go:117 +0x1fd
github.com/thomiceli/opengist/internal/web.NewServer.MethodOverrideWithConfig.func6.1({0x27f79a8, 0xc000643860})
    /root/go/pkg/mod/github.com/labstack/echo/[email protected]/middleware/method_override.go:64 +0xc6
github.com/labstack/echo/v4.(*Echo).ServeHTTP(0xc0001f1688, {0x27dcbc8, 0xc0006fe000}, 0xc000ccc000)
    /root/go/pkg/mod/github.com/labstack/echo/[email protected]/echo.go:674 +0x327
net/http.serverHandler.ServeHTTP({0xc000b72030?}, {0x27dcbc8?, 0xc0006fe000?}, 0x6?)
    /usr/local/go/src/net/http/server.go:3137 +0x8e
net/http.(*conn).serve(0xc000b8e120, {0x27de6b8, 0xc000a30240})
    /usr/local/go/src/net/http/server.go:2039 +0x5e8
created by net/http.(*Server).Serve in goroutine 9
    /usr/local/go/src/net/http/server.go:3285 +0x4b4
@UlyssesZh
Copy link
Author

I don't know which version specifically introduced this bug, but I used to use 1.5.2 and it didn't have this bug. I currently downgraded the deployment on my home server to 1.5.2 and it works fine.

@qianlongzt
Copy link

same issue #298

@thomiceli
Copy link
Owner

Sorry for the delay, can you drop your config.yaml if you changed it ?

@thomiceli thomiceli added the bug Something isn't working label Aug 28, 2024
@UlyssesZh
Copy link
Author

I configure everything in my docker compose file with env var. The only thing I configured is the external url.

@Smallinger
Copy link

Smallinger commented Sep 2, 2024

same here

echo: http: panic serving 172.20.0.3:41598: runtime error: slice bounds out of range [18:14]
goroutine 364 [running]:
net/http.(*conn).serve.func1()
	/usr/local/go/src/net/http/server.go:1898 +0xbe
panic({0x1395440?, 0xc0009289f0?})
	/usr/local/go/src/runtime/panic.go:770 +0x132
golang.org/x/text/transform.String({0x7028baf24198, 0xc0004fea00}, {0xc000e4f630, 0xe})
	/root/go/pkg/mod/golang.org/x/[email protected]/transform/transform.go:650 +0xbb0
golang.org/x/text/cases.Caser.String(...)
	/root/go/pkg/mod/golang.org/x/[email protected]/cases/cases.go:51
github.com/thomiceli/opengist/internal/web.loadSettings({0x27f79a8, 0xc000a6c000})
	/opengist/internal/web/util.go:119 +0x145
github.com/thomiceli/opengist/internal/web.dataInit.func1({0x27f79a8, 0xc000a6c000})
	/opengist/internal/web/server.go:384 +0x1e7
github.com/labstack/echo/v4.(*Echo).ServeHTTP.func1({0x27f79a8, 0xc000a6c000})
	/root/go/pkg/mod/github.com/labstack/echo/[email protected]/echo.go:668 +0x127
github.com/labstack/echo/v4/middleware.RequestLoggerConfig.ToMiddleware.func1.1({0x27f79a8, 0xc000a6c000})
	/root/go/pkg/mod/github.com/labstack/echo/[email protected]/middleware/request_logger.go:286 +0x16b
github.com/labstack/echo/v4/middleware.CORSWithConfig.func1.1({0x27f79a8, 0xc000a6c000})
	/root/go/pkg/mod/github.com/labstack/echo/[email protected]/middleware/cors.go:268 +0x87f
github.com/thomiceli/opengist/internal/web.NewServer.RemoveTrailingSlash.RemoveTrailingSlashWithConfig.func8.1({0x27f79a8, 0xc000a6c000})
	/root/go/pkg/mod/github.com/labstack/echo/[email protected]/middleware/slash.go:117 +0x1fd
github.com/thomiceli/opengist/internal/web.NewServer.MethodOverrideWithConfig.func6.1({0x27f79a8, 0xc000a6c000})
	/root/go/pkg/mod/github.com/labstack/echo/[email protected]/middleware/method_override.go:64 +0xc6
github.com/labstack/echo/v4.(*Echo).ServeHTTP(0xc0001f9b08, {0x27dcbc8, 0xc000ac4620}, 0xc000cb8480)
	/root/go/pkg/mod/github.com/labstack/echo/[email protected]/echo.go:674 +0x327
net/http.serverHandler.ServeHTTP({0xc000b048a0?}, {0x27dcbc8?, 0xc000ac4620?}, 0x6?)
	/usr/local/go/src/net/http/server.go:3137 +0x8e
net/http.(*conn).serve(0xc000b80a20, {0x27de6b8, 0xc000878240})
	/usr/local/go/src/net/http/server.go:2039 +0x5e8
created by net/http.(*Server).Serve in goroutine 54
	/usr/local/go/src/net/http/server.go:3285 +0x4b4

here is my docker-compose

    opengist:
    image: ghcr.io/thomiceli/opengist:latest
    container_name: opengist
    environment:
      - OG_EXTERNAL_URL=https://gist.*****
      - OG_OIDC_CLIENT_KEY=*****************************
      - OG_OIDC_SECRET=*****************************
      - OG_OIDC_DISCOVERY_URL=https://sso.*****.me/application/o/opengist/.well-known/openid-configuration
    restart: unless-stopped
    ports:
      - "6157:6157" # HTTP port
    volumes:
      - "/containers/opengist_data/:/opengist"
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:6157/healthcheck"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 5s 

i use nginx proxy manager to reverse proxy the port on 443

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants