During some builds today and also a few weeks ago, I saw some errors saying "Prismic ref needs an access token". But I'm querying only for data from the tip of "master", and I have "public API for master only" configured, so it should be public, and I'm surprised to get that error.
I wonder if what might be happening is that some document is published during the course of the build. This might mean that the ref I'm querying for is no longer the latest, and so is no longer public.
Is this the most likely explanation?
If so, I can just add an access token to this build task and move on. But if not, there might be a bug lurking somewhere.
Thanks for flagging this error. I'm not familiar with it. Can you tell me more about what causes it? And could you share a copy-paste and screenshot of the error where it appears?
We'll I'm not entirely sure -- I'm asking you what causes it!
I don't have the exact error message since I restarted the builds which failed and they then passed. It seems Travis doesn't hold on to the old build output if you restart a build. I'll make sure to capture it if I see it again.
However, I got the errors in response to GraphQL queries. They were 4xx errors (likely "forbidden"), and the error message said that I needed an access token to query that particular Prismic ref.
As I said above I think it's quite likely it's because something was published mid-build, and my code is still using what was the "master" ref when the build started in successive queries, but this is no longer public.
I'm asking whether you agree that this is a likely explanation.