# "Failed to count tokens for this attachment" Error

**URL:** <https://discuss.ai.google.dev/t/failed-to-count-tokens-for-this-attachment-error/34904>\
**Category:** Google AI Studio\
**Tags:** bug\
**Created:** [July 31, 2024, 7:04pm UTC](https://discuss.ai.google.dev/t/failed-to-count-tokens-for-this-attachment-error/34904 "2024-07-31T19:04:53Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![C\_K](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/c_k/32/20751_2.png) [@C\_K](https://discuss.ai.google.dev/u/C_K)\
**Post date:** [July 31, 2024, 7:04pm UTC](https://discuss.ai.google.dev/t/failed-to-count-tokens-for-this-attachment-error/34904/1 "2024-07-31T19:04:53Z")

</div>

Ever since a few hours ago I’ve started to notice that larger attachments (PDFs greater than ~100k/200k tokens) give me the error in the title. Anyone have any idea why?

---

<div class="post-metadata">

**Author:** ![afirstenberg](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/afirstenberg/32/202_2.png) [@afirstenberg](https://discuss.ai.google.dev/u/afirstenberg)\
**Post date:** [August 1, 2024, 7:06pm UTC](https://discuss.ai.google.dev/t/failed-to-count-tokens-for-this-attachment-error/34904/2 "2024-08-01T19:06:05Z")

</div>

Welcome to the forums!

Does this work for smaller attachments?  
Does this work for attachments uploaded to drive separately and then attached from Drive?

I’m wondering if there is a permissions issue with it accessing your Drive.

---

<div class="post-metadata">

**Author:** ![C\_K](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/c_k/32/20751_2.png) [@C\_K](https://discuss.ai.google.dev/u/C_K)\
**Post date:** [August 1, 2024, 7:14pm UTC](https://discuss.ai.google.dev/t/failed-to-count-tokens-for-this-attachment-error/34904/3 "2024-08-01T19:14:08Z")

</div>

Thanks!

It does work for smaller attachments with no problem. I just gave it a try and the separately uploaded file still encounters the same issue.

---

<div class="post-metadata">

**Author:** ![C\_K](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/c_k/32/20751_2.png) [@C\_K](https://discuss.ai.google.dev/u/C_K)\
**Post date:** [August 3, 2024, 4:15am UTC](https://discuss.ai.google.dev/t/failed-to-count-tokens-for-this-attachment-error/34904/4 "2024-08-03T04:15:20Z")

</div>

Update: I’ve come across 3 other cases so far of people describing this issue of high-token PDFs producing errors.

---

<div class="post-metadata">

**Author:** ![clawforce](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/clawforce/32/20908_2.png) [@clawforce](https://discuss.ai.google.dev/u/clawforce)\
**Post date:** [August 3, 2024, 4:17am UTC](https://discuss.ai.google.dev/t/failed-to-count-tokens-for-this-attachment-error/34904/5 "2024-08-03T04:17:20Z")

</div>

I’m seeing the same issue as well, it’s consistent across the board in my experience with the largest PDF it didn’t kick (including both ones in preexisting threads and new ones I’ve tried to upload) at 95,739 tokens.

---

<div class="post-metadata">

**Author:** ![clawforce](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/clawforce/32/20908_2.png) [@clawforce](https://discuss.ai.google.dev/u/clawforce)\
**Post date:** [August 3, 2024, 6:33am UTC](https://discuss.ai.google.dev/t/failed-to-count-tokens-for-this-attachment-error/34904/6 "2024-08-03T06:33:26Z")

</div>

It doesn’t appear to be a permissions issue - I tried uploading through Google AI Studio, using a file previously uploaded into the prompt thread, and using something loaded into Drive separately, and all over 100K tokens failed.

---

<div class="post-metadata">

**Author:** ![OrangiaNebula](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/orangianebula/32/480_2.png) [@OrangiaNebula](https://discuss.ai.google.dev/u/OrangiaNebula)\
**Post date:** [August 3, 2024, 9:27pm UTC](https://discuss.ai.google.dev/t/failed-to-count-tokens-for-this-attachment-error/34904/7 "2024-08-03T21:27:45Z")

</div>

I can confirm it’s now broken. I tried to upload Leslie Lamport‘s book, “Specifying Systems” and the message flashes at the bottom of the screen near the input field (and the PDF is not available in the prompt). I had previously uploaded that same book when the two-million token models became available for testing (plus two other big books to get enough tokens). So it used to work, and now doesn’t.

Added the tag ‘bug’, hoping it will attract attention from someone who can actually do something about it.

---

<div class="post-metadata">

**Author:** ![Solivagant](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/solivagant/32/21221_2.png) [@Solivagant](https://discuss.ai.google.dev/u/Solivagant)\
**Post date:** [August 7, 2024, 9:11pm UTC](https://discuss.ai.google.dev/t/failed-to-count-tokens-for-this-attachment-error/34904/8 "2024-08-07T21:11:06Z")

</div>

Really hope they address this. It’s been a problem for nearly a week now.

---

<div class="post-metadata">

**Author:** ![clawforce](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/clawforce/32/20908_2.png) [@clawforce](https://discuss.ai.google.dev/u/clawforce)\
**Post date:** [August 8, 2024, 7:44pm UTC](https://discuss.ai.google.dev/t/failed-to-count-tokens-for-this-attachment-error/34904/9 "2024-08-08T19:44:59Z")

</div>

The model appears to be less effective if you break a larger file up into parts and ask it to analyze the parts in context as a whole, so hopefully we can get the issue addressed

---

<div class="post-metadata">

**Author:** ![OrangiaNebula](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/orangianebula/32/480_2.png) [@OrangiaNebula](https://discuss.ai.google.dev/u/OrangiaNebula)\
**Post date:** [August 8, 2024, 8:16pm UTC](https://discuss.ai.google.dev/t/failed-to-count-tokens-for-this-attachment-error/34904/10 "2024-08-08T20:16:59Z")

</div>

Let’s see if we can attract some people. @Logan_Kilpatrick , @Lloyd_Hightower , this problem requires attention. It has festered long enough.

---

<div class="post-metadata">

**Author:** ![Logan\_Kilpatrick](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/logan_kilpatrick/32/129_2.png) [@Logan\_Kilpatrick](https://discuss.ai.google.dev/u/Logan_Kilpatrick)\
**Post date:** [August 12, 2024, 1:09pm UTC](https://discuss.ai.google.dev/t/failed-to-count-tokens-for-this-attachment-error/34904/11 "2024-08-12T13:09:59Z")

</div>

Hey folks, there is a 300 page size limit for PDFs which might be what you are pushing up against, can anyone confirm if they are getting issues with files smaller than this?

---

<div class="post-metadata">

**Author:** ![C\_K](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/c_k/32/20751_2.png) [@C\_K](https://discuss.ai.google.dev/u/C_K)\
**Post date:** [August 12, 2024, 1:31pm UTC](https://discuss.ai.google.dev/t/failed-to-count-tokens-for-this-attachment-error/34904/12 "2024-08-12T13:31:59Z")

</div>

I gave it a try and this seems to be the case…but doesn’t that null the point of having a 2 million token context window? I doubt a 300 page limit can even push past 500k tokens.

---

<div class="post-metadata">

**Author:** ![OrangiaNebula](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/orangianebula/32/480_2.png) [@OrangiaNebula](https://discuss.ai.google.dev/u/OrangiaNebula)\
**Post date:** [August 12, 2024, 4:18pm UTC](https://discuss.ai.google.dev/t/failed-to-count-tokens-for-this-attachment-error/34904/13 "2024-08-12T16:18:54Z")

</div>

Leslie Lamport’s book is 382 pages. The thing is, it used to be possible to grok that book and now it is not possible: the page limit was introduced. That is what causes consternation.

---

<div class="post-metadata">

**Author:** ![dirtriver](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/dirtriver/32/21605_2.png) [@dirtriver](https://discuss.ai.google.dev/u/dirtriver)\
**Post date:** [August 13, 2024, 9:08am UTC](https://discuss.ai.google.dev/t/failed-to-count-tokens-for-this-attachment-error/34904/14 "2024-08-13T09:08:27Z")

</div>

That completely negates the usefulness of the 2 million context window on AI Studio

---

<div class="post-metadata">

**Author:** ![Solivagant](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/solivagant/32/21221_2.png) [@Solivagant](https://discuss.ai.google.dev/u/Solivagant)\
**Post date:** [August 14, 2024, 1:16pm UTC](https://discuss.ai.google.dev/t/failed-to-count-tokens-for-this-attachment-error/34904/15 "2024-08-14T13:16:07Z")

</div>

Did they recently introduce that? Because it wasn’t there before.

---

<div class="post-metadata">

**Author:** ![C\_K](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/c_k/32/20751_2.png) [@C\_K](https://discuss.ai.google.dev/u/C_K)\
**Post date:** [August 17, 2024, 11:24pm UTC](https://discuss.ai.google.dev/t/failed-to-count-tokens-for-this-attachment-error/34904/16 "2024-08-17T23:24:48Z")

</div>

I noticed the limit was upped 🙂

---

<div class="post-metadata">

**Author:** ![clawforce](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/clawforce/32/20908_2.png) [@clawforce](https://discuss.ai.google.dev/u/clawforce)\
**Post date:** [August 21, 2024, 2:41am UTC](https://discuss.ai.google.dev/t/failed-to-count-tokens-for-this-attachment-error/34904/17 "2024-08-21T02:41:22Z")

</div>

Really? I’m still finding that it’s failing to upload/analyze PDF files for me with a “failed to count tokens” error message

---

<div class="post-metadata">

**Author:** ![clawforce](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/clawforce/32/20908_2.png) [@clawforce](https://discuss.ai.google.dev/u/clawforce)\
**Post date:** [August 21, 2024, 2:42am UTC](https://discuss.ai.google.dev/t/failed-to-count-tokens-for-this-attachment-error/34904/18 "2024-08-21T02:42:40Z")

</div>

The document in question is an out of print, 207 page PDF, an old WEG Star Wars RPG module called “The DarkStryder Campaign”, that will not upload no matter what I try.

---

<div class="post-metadata">

**Author:** ![vyaslav](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/vyaslav/32/22120_2.png) [@vyaslav](https://discuss.ai.google.dev/u/vyaslav)\
**Post date:** [August 21, 2024, 1:46pm UTC](https://discuss.ai.google.dev/t/failed-to-count-tokens-for-this-attachment-error/34904/19 "2024-08-21T13:46:13Z")

</div>

Today I was playing with CSV file upload. After several tries, I could upload a file cut to 2.5KB. Disappointed.

---

<div class="post-metadata">

**Author:** ![Lemonny](https://avatars.discourse-cdn.com/v4/letter/l/f0a364/32.png) [@Lemonny](https://discuss.ai.google.dev/u/Lemonny)\
**Post date:** [October 8, 2024, 5:21pm UTC](https://discuss.ai.google.dev/t/failed-to-count-tokens-for-this-attachment-error/34904/20 "2024-10-08T17:21:51Z")

</div>

What’s the freaking point of 2 million context if its not usuable because of the 300 page limit! I think this is a big issue and we need proper answers, it used to work so flawlessly before

[Next page](https://discuss.ai.google.dev/t/failed-to-count-tokens-for-this-attachment-error/34904.md?page=2)
