{"id":37103440,"url":"https://github.com/rgiaviti/bug-go-kong-reference-error","last_synced_at":"2026-01-14T12:31:32.070Z","repository":{"id":187587274,"uuid":"462818488","full_name":"rgiaviti/bug-go-kong-reference-error","owner":"rgiaviti","description":"Sample project to reproduce a bug using go-kong ","archived":false,"fork":false,"pushed_at":"2022-02-24T11:53:41.000Z","size":3819,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-06-19T21:02:21.343Z","etag":null,"topics":["bug","go-kong","sample-project"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rgiaviti.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2022-02-23T16:32:48.000Z","updated_at":"2022-03-09T13:14:18.000Z","dependencies_parsed_at":"2023-08-11T09:09:04.070Z","dependency_job_id":null,"html_url":"https://github.com/rgiaviti/bug-go-kong-reference-error","commit_stats":null,"previous_names":["rgiaviti/bug-go-kong-reference-error"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rgiaviti/bug-go-kong-reference-error","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgiaviti%2Fbug-go-kong-reference-error","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgiaviti%2Fbug-go-kong-reference-error/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgiaviti%2Fbug-go-kong-reference-error/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgiaviti%2Fbug-go-kong-reference-error/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rgiaviti","download_url":"https://codeload.github.com/rgiaviti/bug-go-kong-reference-error/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgiaviti%2Fbug-go-kong-reference-error/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28420775,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T10:47:48.104Z","status":"ssl_error","status_checked_at":"2026-01-14T10:46:19.031Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bug","go-kong","sample-project"],"created_at":"2026-01-14T12:31:30.401Z","updated_at":"2026-01-14T12:31:32.056Z","avatar_url":"https://github.com/rgiaviti.png","language":"Go","readme":"# Go-Kong Bug \nThis is a sample Go project to simulate a detected bug in go-kong v0.28.0. Issue opened [here](https://github.com/Kong/go-kong/issues/137)\n\n## When the bug happens\nWhen we try to validate a plugin schema using [go-kong](https://github.com/Kong/go-kong) and the target kong is offline \n(or even if the Admin API was disabled), we get a reference error because the response is `nil`.\n\n## Steps to reproduce\n### Deploy a Kong with AdminAPI Enabled\n```\n$ docker run -d --name kong \\\n    -e \"KONG_DATABASE=off\" \\\n    -e \"KONG_PROXY_ACCESS_LOG=/dev/stdout\" \\\n    -e \"KONG_ADMIN_ACCESS_LOG=/dev/stdout\" \\\n    -e \"KONG_PROXY_ERROR_LOG=/dev/stderr\" \\\n    -e \"KONG_ADMIN_ERROR_LOG=/dev/stderr\" \\\n    -e \"KONG_ADMIN_LISTEN=0.0.0.0:8001, 0.0.0.0:8444 ssl\" \\\n    -e \"KONG_PLUGINS=bundled\" \\\n    -p 8000:8000 \\\n    -p 8443:8443 \\\n    -p 8001:8001 \\\n    -p 8444:8444 \\\n    kong\n```\n\n### Check if AdminAPI is responding in Port 8001\n```\ncurl --location --request GET 'http://localhost:8001/status'\n```\nStatus Code must be `200 OK`\n\n### Run the Program\n```\n$ go run main.go\n```\n\n### Result\nOne function will validate a plugin with success. The other function will crash go-kong.\n```\nReproducing bug...\nCalling AdminAPI in Port 8001\nvalidation of correlation-id\nresult: true\nmessage: \nCalling AdminAPI in Port 9000\npanic: runtime error: invalid memory address or nil pointer dereference\n[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x76792c]\n\ngoroutine 1 [running]:\ngithub.com/kong/go-kong/kong.(*PluginService).Validate(0xc0000b0040, {0x81bdb0, 0xc0000240b8}, 0xc0000b4000)\n        /home/rgiaviti/go/pkg/mod/github.com/kong/go-kong@v0.28.1/kong/plugin_service.go:186 +0x26c\nmain.CallingIncorrectKongPort()\n        /home/rgiaviti/Desktop/bug-go-kong-reference-error/main.go:41 +0x123\nmain.main()\n        /home/rgiaviti/Desktop/bug-go-kong-reference-error/main.go:12 +0x70\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frgiaviti%2Fbug-go-kong-reference-error","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frgiaviti%2Fbug-go-kong-reference-error","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frgiaviti%2Fbug-go-kong-reference-error/lists"}