I am trying to debug an API that I have running on a GCP App Engine. Originally, the error I was trying to fix was an issue with an import statement on line 7 of one of my JS files.
I have deployed new code that should either fix the issue entirely, or push the import statement to a different line.
However, when I run " gcloud app logs tail -s default" and call my API, I get logs saying that the error is still occurring on line 7. I know that this is not true, because it is still an import error, but line 7 is now a blank line.
I tried deleting all of the old versions of the service in the Cloud Console, but I am still experiencing this problem. How can I fix this?
Try this
- Deploy your changes as a different version i.e. specify a version number
gcloud app deploy --version=<version_number>
- Invoke your app’s url for this new version and confirm everything works
https://VERSION-dot-SERVICE-dot-PROJECT_ID.[REGION_ID](https://cloud.google.com/appengine/docs/legacy/standard/python/an-overview-of-app-engine#appengine-urls).r.appspot.com
- If everything works, you can migrate traffic to this new version and then delete the old version.
For an overview of versions and services for an app, see Google documentation
**…**NoCommandLine …
https://nocommandline.com
Analytics & GUI for
App Engine & Datastore Emulator
Hi @ajaybhatta49 ,
In addition to the suggestions of @NoCommandLine , also note that the tailfunction from the command gcloud app logs tail -s default can show more than one recorded logs. The oldest of which is the one that’s displayed at the top.
For instance, let’s assume the following events happened sequentially:
- You deployed an app
- An error was encountered during deployment
- You resolved the issue locally (like making some code changes)
- You redeployed the updated code
After running the logs tail command, the displayed error that was logged during the first attempt will still be printed out by the logs tail command.
For further reference, you can also check this reminder pointed out by **@**Zach W from this Stack Overflow question in relation to an instance when Google App Engine seems to run an old code. In some cases, the updated code may have been uploaded, but not the updated build perhaps due to some issues in the build command that prevented the code from being built.
I hope my additional feedback above is helpful as well.