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

🐛 [Bug]: panic: ./docs/swagger.yaml file does not exist #209

Closed
mkrueger12 opened this issue Apr 16, 2024 · 14 comments · Fixed by #211
Closed

🐛 [Bug]: panic: ./docs/swagger.yaml file does not exist #209

mkrueger12 opened this issue Apr 16, 2024 · 14 comments · Fixed by #211
Assignees
Labels
api:http area:api area:build CD, Kubernetes, on-prem, and local deployments area:service type:bug Something isn't working as expected

Comments

@mkrueger12
Copy link
Contributor

I am deploying the latest release via helm.

values.yaml specification:

image: repository: ghcr.io/einstack/glide tag: "0.0.3-rc.1-alpine" pullPolicy: IfNotPresent pullSecrets: []

On startup I receive the following error:

2024-04-16T17:38:01.255Z        DEBUG   routers/config.go:36    Init router     {"routerID": "azure-latency"}
2024-04-16T17:38:01.255Z        DEBUG   routers/config.go:94    Init lang model {"router": "azure-latency", "model": "azure-gpt4-west"}
2024-04-16T17:38:01.255Z        DEBUG   routers/config.go:94    Init lang model {"router": "azure-latency", "model": "azure-gpt4-east"}
panic: ./docs/swagger.yaml file does not exist

goroutine 23 [running]:
github.com/gofiber/contrib/swagger.New({0xc00026ee90?, 0x1?, 0x1?})
        /go/pkg/mod/github.com/gofiber/contrib/swagger@v1.1.1/swagger.go:90 +0x845
glide/pkg/api/http.(*Server).Run(0xc0001f0e80)
        /build/pkg/api/http/server.go:40 +0xd4
glide/pkg/api.(*ServerManager).Start.func1()
        /build/pkg/api/servers.go:44 +0x76
created by glide/pkg/api.(*ServerManager).Start in goroutine 1
        /build/pkg/api/servers.go:41 +0x66

This is the first time I've experienced this error. Had success deploying it previously.

@mkrueger12 mkrueger12 added type:bug Something isn't working as expected area:build CD, Kubernetes, on-prem, and local deployments labels Apr 16, 2024
@mkrueger12 mkrueger12 self-assigned this Apr 16, 2024
@mkrueger12
Copy link
Contributor Author

Local testing does not surface the same error.

@mkrueger12
Copy link
Contributor Author

This appears to also be in issue with 0.0.2-alpine.

@roma-glushko
Copy link
Member

Hm, good catch 👀 I'm wondering if this is related to migratation from hertz to fiber

@roma-glushko roma-glushko changed the title [Bug]: panic: ./docs/swagger.yaml file does not exist 🐛 [Bug]: panic: ./docs/swagger.yaml file does not exist Apr 16, 2024
@roma-glushko roma-glushko self-assigned this Apr 16, 2024
@roma-glushko
Copy link
Member

Seems like Fiber swagger integration lacks a way to embed the swagger file, so they have a PR to bring that:
gofiber/contrib#1069

@roma-glushko
Copy link
Member

@mkrueger12 I have it: #211 Had to switch to another official swagger ext and serve swagger spec via Glide API but it should work now 😌

roma-glushko added a commit that referenced this issue Apr 16, 2024
…g swagger.yaml file (#211)

This change fixes panics like "./docs/swagger.yaml is not found"
roma-glushko added a commit that referenced this issue Apr 16, 2024
Final major improvements to streaming chat workflow. Fixed issues with Cohere streaming chat. 
Expanded and revisited Cohere params in config.

## Changelog

### Added

- 🔧 #195 #196: Set router ctx in stream chunks & handle end of stream in case of some errors (@roma-glushko)
- 🐛🔧 #197: Handle max_tokens & content_filtered finish reasons across OpenAI, Azure and Cohere (@roma-glushko)

### Changed

- 🔧 💥 #198: Expose more Cohere params & fixing validation of provider params in config (breaking change) (@roma-glushko)
- 🔧 #186: Rendering Durations in a human-friendly way (@roma-glushko)

### Fixed

- 🐛 #209: Embed Swagger specs into binary to fix panics caused by missing swagger.yaml file (@roma-glushko)
- 🐛 #200: Implemented a custom json per line stream reader to read Cohere chat streams correctly (@roma-glushko)
This was referenced Apr 16, 2024
roma-glushko added a commit that referenced this issue Apr 16, 2024
## Summary

✨ Bringing support for streaming chat in Glide (integrated with OpenAI, Azure OpenAI and Cohere)
✨ Started handling 401 errors to mark models as premaritally unavailable (e.g. when API key was not correct)
🐛 Fixing the panic related to swagger.yaml file
🐛 Fixing Anthropic chat workflow by passing API key correctly
🔧 Improved Cohere param config and validation

## Changelog

### Added

- ✨Streaming Chat Workflow #149 #163 #161 (@roma-glushko)
- ✨Streaming Support for Azure OpenAI #173 (@mkrueger12)
- ✨Cohere Streaming Chat Support #171 (@mkrueger12)
- ✨Start counting token usage in Anthropic Chat #183 (@roma-glushko)
- ✨Handle unauthorized error in health tracker #170 (@roma-glushko)
- 🔧 #195 #196: Set router ctx in stream chunks & handle end of stream in case of some errors (@roma-glushko)
- 🐛🔧 #197: Handle max_tokens & content_filtered finish reasons across OpenAI, Azure and Cohere (@roma-glushko)

## Changed

- 🔧 💥 #198: Expose more Cohere params & fixing validation of provider params in config (breaking change) (@roma-glushko)
- 🔧 #186: Rendering Durations in a human-friendly way (@roma-glushko)

### Fixed

- 🐛 Fix Anthropic API key header #183 (@roma-glushko)
- 🐛 #209: Embed Swagger specs into binary to fix panics caused by missing swagger.yaml file (@roma-glushko)
- 🐛 #200: Implemented a custom json per line stream reader to read Cohere chat streams correctly (@roma-glushko)

### Security

-  🔓 Update crypto lib, golang, fiber #148 (@roma-glushko)

### Miscellaneous

-  🐛 Update README.md to fix helm chart location #167 (@arjunnair22)
- 🔧 Updated .go-version (@roma-glushko)
-  ✅ Covered the telemetry by tests #146 (@roma-glushko)
- 📝 Separate and list all supported capabilities per provider #190 (@roma-glushko)
@mkrueger12
Copy link
Contributor Author

Great. I'll be able to take a look tomorrow. Thanks.

@mkrueger12
Copy link
Contributor Author

@roma-glushko Seeing the same issue with swagger.json

@mkrueger12 mkrueger12 reopened this Apr 18, 2024
@roma-glushko
Copy link
Member

This is interesting. I will try to use dockercompose to pull the image and reproduce the issue that way

@roma-glushko
Copy link
Member

@mkrueger12 This is what I see trying to run the image in docker:

2024-04-18_22-13-45

I'm little bit surprised to see swagger.json in there. In v0.0.3 I have used go:embed directive to pull its content into the binary. So the binary itself doesn't depend on any files anymore. Could you please check if 0.0.3 was really pulled there?

@roma-glushko
Copy link
Member

roma-glushko commented Apr 18, 2024

And there is some issues with build info, so I've filled a task for look into it: #217

@mkrueger12
Copy link
Contributor Author

@roma-glushko I also could not reproduce it locally. I'll check the logs/build

@mkrueger12
Copy link
Contributor Author

Looks like the build was correct.

@mkrueger12
Copy link
Contributor Author

mkrueger12 commented Apr 24, 2024

Issue appears resolved. It appears to be related to specifying "latest-alpine" in the chart instead of "0.0.3-alpine" where "latest-alpine" throws the error.

@roma-glushko
Copy link
Member

@mkrueger12 I think I have got it. latest tags + Pod strategy to pull images only if not present on the node may lead to pulling the image from the node cache. We expect that nodes in clusters will rotate frequently enough to avoid this situation. Otherwise, our users can easily specify the exact version to be completely in charge of updates (this is recommended and set by default in the Glide helm chart).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api:http area:api area:build CD, Kubernetes, on-prem, and local deployments area:service type:bug Something isn't working as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants