Skip to content

cache: return error if cacheservice scheme is not supported#5211

Merged
sipsma merged 1 commit into
dagger:mainfrom
marcosnils:fix/cacheservice_url_parse
May 27, 2023
Merged

cache: return error if cacheservice scheme is not supported#5211
sipsma merged 1 commit into
dagger:mainfrom
marcosnils:fix/cacheservice_url_parse

Conversation

@marcosnils
Copy link
Copy Markdown
Contributor

@marcosnils marcosnils commented May 26, 2023

otherwise we get a nasty nil pointer exception:

time="2023-05-26T17:05:16Z" level=debug msg="using cache service at localhost:8020/magicache"
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x6e0fd4]

goroutine 1 [running]:
net/http.(*Client).deadline(0xc000665520?)
        /usr/local/go/src/net/http/client.go:189 +0x14
net/http.(*Client).do(0x0, 0xc00064e700)
        /usr/local/go/src/net/http/client.go:600 +0x225
net/http.(*Client).Do(...)
        /usr/local/go/src/net/http/client.go:582
github.com/dagger/dagger/engine/cache.(*client).GetConfig(0xc000109ab8, {0x1ca7af8?, 0xc0000b6a00}, {{0xc0002b2fe0?, 0x1cb2780?}})
        /app/engine/cache/service.go:261 +0x3f3
github.com/dagger/dagger/engine/cache.NewManager({0x1ca7af8?, 0xc0000b6a00}, {{0x1cb2780, 0xc000012520}, {0x1ca8930, 0xc000012530}, {0x1cb5c00, 0xc000618160}, 0xc000312a40, {0xc000046026, ...}, ...})
        /app/engine/cache/manager.go:73 +0x351

Signed-off-by: Marcos Lilljedahl marcosnils@gmail.com

@marcosnils marcosnils requested a review from sipsma May 26, 2023 17:15
@marcosnils marcosnils marked this pull request as draft May 26, 2023 17:44
@marcosnils
Copy link
Copy Markdown
Contributor Author

I'm refactoring this so no need to 👀 yet

Signed-off-by: Marcos Lilljedahl <marcosnils@gmail.com>
@marcosnils marcosnils force-pushed the fix/cacheservice_url_parse branch from d8f28e2 to e99b02e Compare May 26, 2023 20:06
@marcosnils marcosnils marked this pull request as ready for review May 26, 2023 20:06
@sipsma sipsma merged commit 63dcaac into dagger:main May 27, 2023
@marcosnils marcosnils deleted the fix/cacheservice_url_parse branch May 27, 2023 03:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants