-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flakey deploy... #73
Comments
Hey @jtslear thanks for the very detailed issue description! 👍 I tried to reproduce it. Here's what I did: I created a new service based on the template and renamed the function in I deployed the service (note this is a fresh deployment from scratch) and the deployment fails in the update phase with the same error message about a missing export like you've also encountered. After that I changed the name back from Furthermore only one bucket was created for this specific service (even after re-deploying). It seems like you're using v1.0.0. Do you pull this from Thanks! |
So I pulled from master this time, however, I'm still able to recreate the above issue. Please note, I'm only getting one bucket, which I believe is legit, it's the contents inside the bucket that are being updated, but the source value for the function is not. I recreate the issue with the exact steps above and ended up with the below output. The strange thing about this is that you recreated it nearly identical to how I did. The gcloud command is run after first deploy failed. I then ran gsutil to print the list of objects in the bucket after the second deploy completed successfully. But gcloud reports the function is still in a goofy state:
|
Hey @jtslear thanks for getting back and trying it with Seems like the duplicate bucket issue was resolved with the fixes in However I'm not using the |
Ok. That's weird. Here's a quick update on the issue: This seems to be smth. on Google ends. It seems like the deployment manager doesn't reflect the actual state the function is in. While the deployment manager tells me that everything works fine I get an error in the function Web UI console telling me that the exported method is not correct. So I can reproduce this behavior here. Still unsure how to solve this since we're going through the deployment manager which should take care of that. So the workaround (as pointed out by @jtslear above) is to simply kick-of another deployment 🤔 |
Indeed kicking another deploy fixes it for some reason. The only thing I haven't investigated further is if there's anything googles audit logs may be able to tell me. The reason I've not looked is that I don't have a lot of experience with it overall. Maybe file a case with google? |
Thanks for getting back @jtslear
I'm also not 100% sure about that. Haven't looked into it yet.
That sounds like a good idea! |
@pmuens I think I have an answer for you. No explanation, just the results of an audit trail. I'm going through the recreation process that we've outlined above (just a different name at this point). During the first deploy that purposely fails we called the operation
The audit trail also provides other details telling me what went wrong and everything, so I know from this information that google attempted to do something after the creation of the function.
During the second deploy that is supposed to update the function, and is supposed to be successful but isn't, we call the same operation. I also do not see any details from google stating that a function was attempted to be loaded and validated. This is all I see:
But this is not correct; the function is already created, we simply need to update in this case. So I feel all we did was an idempotent action of creating the function. I think that is why serverless thinks it was successful. Cuz yes, creating something was indeed processed correctly. But we never call anything that updates the function declaration. A third deploy we appear to call a different operation:
So it's as if something either inside of serverless, or this library is checking the wrong component and not finishing up. Perhaps something related to readiness of the function? Since the function was not created properly the first time, serverless may not be doing the correct operation during the second deploy. Due to this, filing a support case with google won't be of much use. So I do not plan to do so. |
@jtslear Wow! Thank you very much for the in-depth analysis! That makes sense. I'll look into the code and try to figure out if we can change the way the operations are called when something goes wrong. Thanks again for the very detailed description. This helps a lot! |
This is a Bug Report
Description
For bug reports:
What went wrong?
After a first time deploy failed due to a bug in the function I created, serverless told me I broke things, as is expected. I took corrective action and deployed again. The deploy indicated a success, however the function source location was not properly updated. Leaving me with a false positive that all is well.
What did you expect should have happened?
The function source location should've been updated.
What was the config you used?
Can be found here
What stacktrace or error message from your provider did you see?
No stack trace, serverless indicated all is well. Google on the other hand thinks differently, as the function remains to be pointed to the older source location. I've attached a gist below with the gcloud output.
Additional Data
However when describing the function after a deploy, we can see it's still configured to point to the incorrect source, instead of our new location.
Workaround, kick off another deploy. But the fact that this failed the first time, has me worried that something is causing this to fail improperly, and for obviously reasons, future deploys.
The full log of what I did is here
In the above log, the time serverless takes checking on the status of the update progress is significantly different during the deploy which did not update the source properly. (line 53)
Serverless Framework Version you're using: 1.13.2
Operating System: OSX
serverless-google-cloudfunctions Version: 1.0.0
The text was updated successfully, but these errors were encountered: