Comments (11)
@pweglik Could you provide some examples of the large x-goog-api-client header value to help us identify the issue?
from google-auth-library-python.
@pweglik I created a fix in metric
branch, not sure if that works, could you give it a try? You can install it via pip install git+https://github.com/googleapis/google-auth-library-python.git@metric
from google-auth-library-python.
@arithmetic1728 Hi I have the same issue, I've tried your fix and it doesn't seem to have any effect.
In my case the issue is easily reproducible after calling the llm a 1000 times in succession. As I'm trying to evaluate llm outputs on a few different metrics I need to run a call to the LLM on a large amount of outputs and rerun a couple times.
After around 1000 calls I hit the same metadata issue as above with the x-goog-api-client-header continuing to grow with each request and receiving the error after each call when the soft limit had been reached.
from google-auth-library-python.
@JehangirLBG any chance to give some examples of the x-goog-api-client header?
from google-auth-library-python.
@JehangirLBG can you also provide an easy code sample to repro?
from google-auth-library-python.
@JehangirLBG I updated that branch with a new potential fix. Could you try it again? Thanks!
from google-auth-library-python.
@arithmetic1728 Hi, I have gave it a go and still having the issue, as you can see error message below:
Retrying langchain_google_vertexai.chat_models._completion with_retry.<locals-_completion-with-retry-inner in 4.0 seconds as it raised ResourceExhausted: 429 received metadata size exceeds soft limit (34425 vs. 16384): path 103B authority 79B method:43 Bischeme:44B content-type:60B te:42B grpc-accept-encoding:75B user-agent:100B grpc-trace-bin: 103B pc-low-fud-bin:77B x-goog-request-params:150B x-goog-api-client:29279B x-goog-api-client:62B authorization: 1076B *-goog-user-project: 65B x-google-gfe-frontline-info:914B x-google-gfe-cloud-client-vnid:69B x-google-gfe-cloud-client-network-project-number.92B x-google-gfe-timestamp-trace:76B x-google-gfe-verified-user-ip:97B x-gfe-signed-request-headers:620B x-google-gfe-location-info:74B x-gfe-ssl:44B x-google-gfe-tls-base64urlclienthelloprotobuf:299B x-user-ip:52B x-google-service: 105B x-google-gfe-service-trace: 115B x-google-gfe-backend-timeout-ms:71B accept-encoding:56B x-google-peer-delegation-chain-bin:92B x-google request-uid:141B x-google-dappertraceinfo: 111B.
I have seen the metadata go up to 50000 with only x-goog-api-client increasing in size.
from google-auth-library-python.
@JehangirLBG I see. The error message only tells the size (e.g. x-goog-api-client:29279B
), what I need is the x-goog-api-client
header string content (i.e. the 29279 bytes). Any x-goog-api-client
values are fine.
The header can be added by multiple libraries beside this lib, without knowing the content, it's not possible to figure out the reason. Is there any way to reveal the header string in the error message?
I updated the "fix" to not add the x-goog-api-client
header from this lib (This is not what we wanted to do, but just for troubling shooting). Could you try it again?
Also could you provide a simple repro sample?
from google-auth-library-python.
- @arithmetic1728 Tried to run again, still getting the issue.
I understand what you mean with the needing the content of the actual header now, I believe I can just run '.response_metadata' on the returned llm object, however I'm still new to Python so unsure how to break from the code once the metadata has exceeded a certain amount and then run this on the last object returned.
If you have any guidance on that I can do it now or I can check with my colleague tomorrow and get back to you. Thanks for your help :)
I can try to get something together to help reproduce this on your end.
from google-auth-library-python.
@JehangirLBG You don't need to run this on the last object, just run it for every object, and provide a few x-goog-api-client
header values that grow in size. From there I can compare and see which part is repeated, and figure out what library adds it. Thank you for your help!
from google-auth-library-python.
Closing the issue due to inactivity, please reopen if the issue persists or if any new information can be provided, thanks!
from google-auth-library-python.
Related Issues (20)
- Getting Keyerrror _refresh_handler with old tokens HOT 4
- Generated Access Tokens are flagged as expired prematurely HOT 27
- Documentation for Indexing API still uses deprecated oauth2client instead of google-auth and never mentions to install either HOT 1
- ImportError in google.oauth2.id_token HOT 1
- Google Cloud credentials already set but still showing it is not set HOT 3
- Breaking change when upgraded from 2.23.3 to 2.27.0 HOT 5
- Warning: a recent release failed HOT 1
- Warning: a recent release failed HOT 2
- Allow setting metadata environment variable `GCE_METADATA_HOST` alone HOT 1
- Support POST verb for URL-sourced credentials to enable Azure Pipelines WIF HOT 2
- Pickleable AuthorizedSession HOT 2
- Please implement with_subject on return type of google.auth.default HOT 6
- Support/RFC/FR: safely print/compare access tokens for debugging purposes HOT 2
- Bug: `refresh_token` doesn't work as documented HOT 2
- The async `AuthorizedSession` doesn't support customized `ClientSession` parameters
- mypy disallow-untyped-calls check fails for google-auth 2.30 HOT 5
- IAM_PERMISSION_DENIED HOT 1
- Unauthorized client issue HOT 21
- Transient RefreshError exceptions from compute_engine credentials are not retried HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from google-auth-library-python.