I’m encountering an error with storage invocation calls in my Forge apps(multiple), which were working fine 2-3 days ago while tunneling. I’m aware of a major update to the @forge/api package, but I’m unsure if it’s the cause of the issue. Below is a simple example of the function throwing the error.
Error Network request can not be made: Forge proxy authorization expired 22 seconds ago. It’s likely caused by code from a previous function invocation still running. Please ensure that all promises in your code are properly awaited.
So far, I’ve updated @forge/api, @forge/cli, and @forge/resolver, hoping to resolve the problem, but I’m still facing the same error. I’m not sure what I’m missing.
Hi @kashsingh, this error is likely due to invocations spilling over from one to another and this is normally caused by promises not being awaited. If you haven’t changed your code, it is likely that this error existed previously, where the response to the request would have been a 407 error (token expired), we have recently changed how this error is surfaced.
Can you please have a look at your code and make sure all promises are awaited? if you are still running into this issue, can you please provide us with an invocation id and I can have a look.
@BoZhang I appreciate your response, but I don’t think that the responses are not properly awaited. If that were the case, the app would have encountered errors both before as well and the fact the app are working correctly after deployment seconds it.
This issue only arises when tunneling on my personal and office Windows machines while working across various apps, my colleagues faces the same issues as well.
When deployed to a site, the app functions perfectly without any errors in the developer console. However, the error consistently occurs upon invocation during tunneling.
The example I shared originates from an app that makes only a single storage call, as shown in the provided code. I even tried disabling StrictMode to see if it made any difference, but the issue persists.
Here is the invocation id: 76b9fbcf-e339-4fc7-a9c9-89149bfe2977
Forge CLI Version: 10.13.6 @forge/api version: 5.0.0
OS: Windows 11, Build 22631
Node: v22.14 LTS
Hi @kashsingh, thanks for the additional info. Unfortunately I couldn’t find anything with the invocation id that you’ve given me, can you double check if it’s correct. If this is happening for the tunnel invocations then my suspicion is due to the fact that the invocation runs for longer than 60 seconds after the invocation requests is made.
When an invocation request is made, we will send down a token for auth purposes, this token has a lifetime of 60 seconds, if a network request is made after 60 seconds, then this error will occur. Are you able to look at the timestamp of when the invocation is made and when this error returns?
@BoZhang Unfortunately, the function fails immediately after executing the query in the previously shared code, taking less than a second. I have updated the code to include console logs for better visibility. Here is a screenshot showing the invocation timestamp.
Hi @kashsingh, the issue seems to be that your local system clock is ahead of our system clock by 1 minute, causing the token to be deemed invalid. Are you able to sync your local time with a trusted time server?
@BoZhang After syncing my system with the Windows Time server, I can now receive responses while tunneling. Huge thanks, Bo—you’re a lifesaver! I would have never figured out the issue on my own. I’ll also work with my colleagues to get their Windows clocks synced.
@BoZhang I’m seeing this same error in my tunnel as well. My system is syncing to time.apple.com. I’ve also tried time.google.com and see the same errors. As the OP said I only see this error running in the tunnel.
Hi @jeffryan , that’s interesting, did it start happening recently and is it happening consistently? Also how long is the token expired for on the error log?