Meet industry peers, ask questions, collaborate to find answers, and connect with Googlers who are making the products you use every day.<\/p>", "imageupload.max_uploaded_images_per_upload" : 100, "imageupload.max_uploaded_images_per_user" : 10000, "integratedprofile.connect_mode" : "", "tkb.toc_maximum_heading_level" : "2", "tkb.toc_heading_list_style" : "disc", "sharedprofile.show_hovercard_score" : true, "config.search_before_post_scope" : "community", "tkb.toc_heading_indent" : "15", "p13n.cta.recommendations_feed_dismissal_timestamp" : -1, "imageupload.max_file_size" : 10024, "layout.show_batch_checkboxes" : false, "integratedprofile.cta_connect_slim_dismissal_timestamp" : -1 }, "isAnonymous" : true, "policies" : { "image-upload.process-and-remove-exif-metadata" : true }, "registered" : false, "emailRef" : "", "id" : -1, "login" : "Former Community Member" }, "Server" : { "communityPrefix" : "/qsqph94282", "nodeChangeTimeStamp" : 1732878319008, "tapestryPrefix" : "/gc", "deviceMode" : "DESKTOP", "responsiveDeviceMode" : "DESKTOP", "membershipChangeTimeStamp" : "0", "version" : "24.7", "branch" : "24.7-release", "showTextKeys" : false }, "Config" : { "phase" : "prod", "integratedprofile.cta.reprompt.delay" : 30, "profileplus.tracking" : { "profileplus.tracking.enable" : false, "profileplus.tracking.click.enable" : false, "profileplus.tracking.impression.enable" : false }, "app.revision" : "2409051714-s8dac8f1df8-b80", "navigation.manager.community.structure.limit" : "1000" }, "Activity" : { "Results" : [ ] }, "NodeContainer" : { "viewHref" : "https://www.googlecloudcommunity.com/gc/Cloud-Forums/ct-p/cloud-forums", "description" : "Get answers to your questions and share your knowledge about the Google Cloud.", "id" : "cloud-forums", "shortTitle" : "Cloud Forums", "title" : "Cloud Forums", "nodeType" : "category" }, "Page" : { "skins" : [ "googlecloud", "theme_hermes", "responsive_peak" ], "authUrls" : { "loginUrl" : "https://www.googlecloudcommunity.com/gc/user/userloginpage?dest_url=https%3A%2F%2Fwww.googlecloudcommunity.com%2Fgc%2FServerless%2FUpdate-of-cloud-function-failed%2Fm-p%2F833335", "loginUrlNotRegistered" : "https://www.googlecloudcommunity.com/gc/user/userloginpage?redirectreason=notregistered&dest_url=https%3A%2F%2Fwww.googlecloudcommunity.com%2Fgc%2FServerless%2FUpdate-of-cloud-function-failed%2Fm-p%2F833335", "loginUrlNotRegisteredDestTpl" : "https://www.googlecloudcommunity.com/gc/user/userloginpage?redirectreason=notregistered&dest_url=%7B%7BdestUrl%7D%7D" }, "name" : "ForumTopicPage", "rtl" : false, "object" : { "viewHref" : "/gc/Serverless/Update-of-cloud-function-failed/td-p/832082", "subject" : "Update of cloud function failed", "id" : 832082, "page" : "ForumTopicPage", "type" : "Thread" } }, "WebTracking" : { "Activities" : { }, "path" : "Community:Google Cloud Community/Category:Google Cloud/Category:Cloud Forums/Board:Serverless/Message:Re: Update of cloud function failed" }, "Feedback" : { "targeted" : { } }, "Seo" : { "markerEscaping" : { "pathElement" : { "prefix" : "@", "match" : "^[0-9][0-9]$" }, "enabled" : false } }, "TopLevelNode" : { "viewHref" : "https://www.googlecloudcommunity.com/gc/Google-Cloud/ct-p/google-cloud", "description" : "Find answers, ask questions, and connect with our community of experts.", "id" : "google-cloud", "shortTitle" : "Google Cloud", "title" : "Google Cloud", "nodeType" : "category" }, "Community" : { "viewHref" : "https://www.googlecloudcommunity.com/", "integratedprofile.lang_code" : "en", "integratedprofile.country_code" : "US", "id" : "qsqph94282", "shortTitle" : "Google Cloud Community", "title" : "Google Cloud Community" }, "CoreNode" : { "conversationStyle" : "forum", "viewHref" : "https://www.googlecloudcommunity.com/gc/Serverless/bd-p/cloud_serverless", "settings" : { }, "description" : "Explore topics and ask questions about Cloud Run, Cloud Functions, App Engine, Workflows, and Eventarc.", "id" : "cloud_serverless", "shortTitle" : "Serverless", "title" : "Serverless", "nodeType" : "Board", "ancestors" : [ { "viewHref" : "https://www.googlecloudcommunity.com/gc/Cloud-Forums/ct-p/cloud-forums", "description" : "Get answers to your questions and share your knowledge about the Google Cloud.", "id" : "cloud-forums", "shortTitle" : "Cloud Forums", "title" : "Cloud Forums", "nodeType" : "category" }, { "viewHref" : "https://www.googlecloudcommunity.com/gc/Google-Cloud/ct-p/google-cloud", "description" : "Find answers, ask questions, and connect with our community of experts.", "id" : "google-cloud", "shortTitle" : "Google Cloud", "title" : "Google Cloud", "nodeType" : "category" }, { "viewHref" : "https://www.googlecloudcommunity.com/", "description" : "The official home of Google Cloud and Workspace community forums, learning hub, and community blogs.", "id" : "qsqph94282", "shortTitle" : "Google Cloud Community", "title" : "Google Cloud Community", "nodeType" : "Community" } ] } }; LITHIUM.Components.RENDER_URL = "/gc/util/componentrenderpage/component-id/#{component-id}?render_behavior=raw"; LITHIUM.Components.ORIGINAL_PAGE_NAME = 'forums/v5/ForumTopicPage'; LITHIUM.Components.ORIGINAL_PAGE_ID = 'ForumTopicPage'; LITHIUM.Components.ORIGINAL_PAGE_CONTEXT = 'ROoCPYG7ZeKboSfABbKYo_HC5AH9b6se6Dvs93EGCaXahYekPK7PzcRU0IARGUkTRFr8PmfnnhbtVKnSiVPd7QpoEf1yAawllqjaklb0aWfBVDEhnL89PduvXv4MCkc5nfO0_rzfJwZOx4lIB25AcKgWtpu9rcZvKiO8WQ3kbeYKXyWjOjLFmNMe-fSOrpyCQzlKMPSmkEnndDCy_M3BFsVed_YsbBEOWqHYXRnf552t3klkDr0OvTXCxq249j311Tnb-JaTeNUZD5_rQnQZaVvjnJaN8TpYesbEcYv0c_Un69N_xoCGB5YdB_qLOpU7lNsZvdiipUy-mdb6uy9DQMfng3kasV4B6AqBly7hb318-Ej6E7XqPs5Mgz-CdFQw'; LITHIUM.Css = { "BASE_DEFERRED_IMAGE" : "lia-deferred-image", "BASE_BUTTON" : "lia-button", "BASE_SPOILER_CONTAINER" : "lia-spoiler-container", "BASE_TABS_INACTIVE" : "lia-tabs-inactive", "BASE_TABS_ACTIVE" : "lia-tabs-active", "BASE_AJAX_REMOVE_HIGHLIGHT" : "lia-ajax-remove-highlight", "BASE_FEEDBACK_SCROLL_TO" : "lia-feedback-scroll-to", "BASE_FORM_FIELD_VALIDATING" : "lia-form-field-validating", "BASE_FORM_ERROR_TEXT" : "lia-form-error-text", "BASE_FEEDBACK_INLINE_ALERT" : "lia-panel-feedback-inline-alert", "BASE_BUTTON_OVERLAY" : "lia-button-overlay", "BASE_TABS_STANDARD" : "lia-tabs-standard", "BASE_AJAX_INDETERMINATE_LOADER_BAR" : "lia-ajax-indeterminate-loader-bar", "BASE_AJAX_SUCCESS_HIGHLIGHT" : "lia-ajax-success-highlight", "BASE_CONTENT" : "lia-content", "BASE_JS_HIDDEN" : "lia-js-hidden", "BASE_AJAX_LOADER_CONTENT_OVERLAY" : "lia-ajax-loader-content-overlay", "BASE_FORM_FIELD_SUCCESS" : "lia-form-field-success", "BASE_FORM_WARNING_TEXT" : "lia-form-warning-text", "BASE_FORM_FIELDSET_CONTENT_WRAPPER" : "lia-form-fieldset-content-wrapper", "BASE_AJAX_LOADER_OVERLAY_TYPE" : "lia-ajax-overlay-loader", "BASE_FORM_FIELD_ERROR" : "lia-form-field-error", "BASE_SPOILER_CONTENT" : "lia-spoiler-content", "BASE_FORM_SUBMITTING" : "lia-form-submitting", "BASE_EFFECT_HIGHLIGHT_START" : "lia-effect-highlight-start", "BASE_FORM_FIELD_ERROR_NO_FOCUS" : "lia-form-field-error-no-focus", "BASE_EFFECT_HIGHLIGHT_END" : "lia-effect-highlight-end", "BASE_SPOILER_LINK" : "lia-spoiler-link", "FACEBOOK_LOGOUT" : "lia-component-users-action-logout", "BASE_DISABLED" : "lia-link-disabled", "FACEBOOK_SWITCH_USER" : "lia-component-admin-action-switch-user", "BASE_FORM_FIELD_WARNING" : "lia-form-field-warning", "BASE_AJAX_LOADER_FEEDBACK" : "lia-ajax-loader-feedback", "BASE_AJAX_LOADER_OVERLAY" : "lia-ajax-loader-overlay", "BASE_LAZY_LOAD" : "lia-lazy-load" }; LITHIUM.noConflict = true; LITHIUM.useCheckOnline = false; LITHIUM.RenderedScripts = [ "NoConflict.js", "InlineMessageEditor.js", "jquery.ui.core.js", "EarlyEventCapture.js", "CookieBannerAlert.js", "jquery.delayToggle-1.0.js", "Tooltip.js", "brightcove_uploader.js", "jquery.lithium-toastmessage.js", "en.js", "ResizeSensor.js", "jquery.autocomplete.js", "jquery.position-toggle-1.0.js", "plugin.js", "plugin.js", "plugin.js", "SearchAutoCompleteToggle.js", "en.js", "json2.js", "DeferredImages.js", "AutoComplete.js", "en.js", "Auth.js", "jquery.ui.position.js", "Throttle.js", "ElementQueries.js", "tinymce-patched.js", "plugin.js", "MessageBodyDisplay.js", "theme.js", "ProductsField.js", "plugin.js", "plugin.js", "Events.js", "api.js", "Link.js", "jquery.tokeninput-1.6.2.js", "jquery.viewport-1.0.js", "AjaxFeedback.js", "OoyalaPlayer.js", "HelpIcon.js", "Namespace.js", "InputEditForm.js", "LazyLoadComponent.js", "Placeholder.js", "jquery.function-utils-1.0.js", "jquery.hoverIntent-r6.js", "InlineMessageReplyEditor.js", "plugin.js", "jquery.css-data-1.0.js", "DropDownMenu.js", "plugin.js", "FieldSet.js", "jquery.iframe-shim-1.0.js", "KeepSessionAlive.js", "plugin.js", "plugin.js", "ActiveCast3.js", "Loader.js", "ElementMethods.js", "plugin.js", "jquery.ui.dialog.js", "ForceLithiumJQuery.js", "plugin.js", "en.js", "jquery.tools.tooltip-1.2.6.js", "TokenInputAutoComplete.js", "DataHandler.js", "MessageViewDisplay.js", "en.js", "Sandbox.js", "Forms.js", "PolyfillsAll.js", "TinyMceEditor.js", "MessageEditor.js", "en.js", "ThreadedDetailMessageList.js", "plugin.js", "jquery.blockui.js", "Video.js", "en.js", "prism.js", "CustomEvent.js", "SpoilerToggle.js", "jquery.tmpl-1.1.1.js", "jquery.placeholder-2.0.7.js", "BlockEvents.js", "plugin.js", "jquery.ajax-cache-response-1.0.js", "aws-sdk.js", "jquery.iframe-transport.js", "plugin.js", "DropDownMenuVisibilityHandler.js", "UserListActual.js", "Text.js", "plugin.js", "plugin.js", "SearchForm.js", "Globals.js", "LiModernizr.js", "jquery.scrollTo.js", "jquery.appear-1.1.1.js", "jquery.ui.mouse.js", "ReCaptchaV3.js", "plugin.js", "jquery.fileupload.js", "en.js", "plugin.js", "jquery.js", "Lithium.js", "jquery.effects.core.js", "plugin.js", "en.js", "plugin.js", "Components.js", "jquery.ui.widget.js", "plugin.js", "jquery.ui.resizable.js", "en.js", "jquery.lithium-selector-extensions.js", "jquery.clone-position-1.0.js", "jquery.json-2.6.0.js", "plugin.js", "PartialRenderProxy.js", "InlineMessageReplyContainer.js", "InformationBox.js", "Cache.js", "AjaxSupport.js", "jquery.ui.draggable.js", "jquery.effects.slide.js", "Dialog.js" ];(function(){LITHIUM.AngularSupport=function(){function g(a,c){a=a||{};for(var b in c)"[object object]"===Object.prototype.toString.call(c[b])?a[b]=g(a[b],c[b]):a[b]=c[b];return a}var d,f,b={coreModule:"li.community",coreModuleDeps:[],noConflict:!0,bootstrapElementSelector:".lia-page .min-width .lia-content",bootstrapApp:!0,debugEnabled:!1,useCsp:!0,useNg2:!1},k=function(){var a;return function(b){a||(a=document.createElement("a"));a.href=b;return a.href}}();LITHIUM.Angular={};return{preventGlobals:LITHIUM.Globals.preventGlobals, restoreGlobals:LITHIUM.Globals.restoreGlobals,init:function(){var a=[],c=document.querySelector(b.bootstrapElementSelector);a.push(b.coreModule);b.customerModules&&0

Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Update of cloud function failed

Hello everyone,

I have a cloud function v2 working for a while. I regularly do updates that are totally sound-proof. This time I got the following error:

Could not create or update Cloud Run service XXX Container Healthcheck failed. Revision 'XXX-00037-qup' is not ready and cannot serve traffic. The user-provided container failed to start and listen on the port defined provided by the PORT=8080 environment variable within the allocated timeout. This can happen when the container port is misconfigured or if the timeout is too short. The healtcheck timeout can be extended. Logs for this revision might contain more information."

After looking deep into the logs, got this:

"Traceback (most recent call last):
File "/layers/google.python.pip/pip/bin/functions-framework", line 8, in <module>
sys.exit(_cli())
File "/layers/google.python.pip/pip/lib/python3.10/site-packages/click/core.py", line 1157, in __call__
return self.main(*args, **kwargs)
File "/layers/google.python.pip/pip/lib/python3.10/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
File "/layers/google.python.pip/pip/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/layers/google.python.pip/pip/lib/python3.10/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
File "/layers/google.python.pip/pip/lib/python3.10/site-packages/functions_framework/_cli.py", line 36, in _cli
app = create_app(target, source, signature_type)
File "/layers/google.python.pip/pip/lib/python3.10/site-packages/functions_framework/__init__.py", line 395, in create_app
raise e from None
File "/layers/google.python.pip/pip/lib/python3.10/site-packages/functions_framework/__init__.py", line 376, in create_app
spec.loader.exec_module(source_module)
File "<frozen importlib._bootstrap_external>", line 883, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/workspace/main.py", line 16, in <module>
import statsmodels.api as sm
File "/layers/google.python.pip/pip/lib/python3.10/site-packages/statsmodels/__init__.py", line 1, in <module>
from statsmodels.compat.patsy import monkey_patch_cat_dtype
File "/layers/google.python.pip/pip/lib/python3.10/site-packages/statsmodels/compat/patsy.py", line 4, in <module>
import patsy.util
File "/layers/google.python.pip/pip/lib/python3.10/site-packages/patsy/__init__.py", line 87, in <module>
import patsy.highlevel
File "/layers/google.python.pip/pip/lib/python3.10/site-packages/patsy/highlevel.py", line 18, in <module>
from patsy.design_info import DesignMatrix, DesignInfo
File "/layers/google.python.pip/pip/lib/python3.10/site-packages/patsy/design_info.py", line 39, in <module>
from patsy.desc import ModelDesc, Term
File "/layers/google.python.pip/pip/lib/python3.10/site-packages/patsy/desc.py", line 11, in <module>
from patsy.eval import EvalEnvironment, EvalFactor
File "/layers/google.python.pip/pip/lib/python3.10/site-packages/patsy/eval.py", line 21, in <module>
import pytest
ModuleNotFoundError: No module named 'pytest'Traceback (most recent call last):
File "/layers/google.python.pip/pip/bin/functions-framework", line 8, in <module>
sys.exit(_cli())
File "/layers/google.python.pip/pip/lib/python3.10/site-packages/click/core.py", line 1157, in __call__
return self.main(*args, **kwargs)
File "/layers/google.python.pip/pip/lib/python3.10/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
File "/layers/google.python.pip/pip/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/layers/google.python.pip/pip/lib/python3.10/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
File "/layers/google.python.pip/pip/lib/python3.10/site-packages/functions_framework/_cli.py", line 36, in _cli
app = create_app(target, source, signature_type)
File "/layers/google.python.pip/pip/lib/python3.10/site-packages/functions_framework/__init__.py", line 395, in create_app
raise e from None
File "/layers/google.python.pip/pip/lib/python3.10/site-packages/functions_framework/__init__.py", line 376, in create_app
spec.loader.exec_module(source_module)
File "<frozen importlib._bootstrap_external>", line 883, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/workspace/main.py", line 16, in <module>
import statsmodels.api as sm
File "/layers/google.python.pip/pip/lib/python3.10/site-packages/statsmodels/__init__.py", line 1, in <module>
from statsmodels.compat.patsy import monkey_patch_cat_dtype
File "/layers/google.python.pip/pip/lib/python3.10/site-packages/statsmodels/compat/patsy.py", line 4, in <module>
import patsy.util
File "/layers/google.python.pip/pip/lib/python3.10/site-packages/patsy/__init__.py", line 87, in <module>
import patsy.highlevel
File "/layers/google.python.pip/pip/lib/python3.10/site-packages/patsy/highlevel.py", line 18, in <module>
from patsy.design_info import DesignMatrix, DesignInfo
File "/layers/google.python.pip/pip/lib/python3.10/site-packages/patsy/design_info.py", line 39, in <module>
from patsy.desc import ModelDesc, Term
File "/layers/google.python.pip/pip/lib/python3.10/site-packages/patsy/desc.py", line 11, in <module>
from patsy.eval import EvalEnvironment, EvalFactor
File "/layers/google.python.pip/pip/lib/python3.10/site-packages/patsy/eval.py", line 21, in <module>
import pytest
ModuleNotFoundError: No module named 'pytest'"

Note:

- When I test the function it's OK

- Function old version is still running

Maybe it's some maj that deleted the "pytest" import? Or the fact I am using a VPN to access my cloud?

Thanks a lot!

m

0 1 31
1 REPLY 1

Hi @magikzi,

Welcome to Google Cloud Community!

It seems that the deployment of the function fails due to an unexpected requirement for pytest at runtime. Occasionally, libraries such as patsy incorporate additional dependencies like this, which could have been altered after an update.

Here's what you can try:

  1. Add pytest to your requirements.txt to ensure it’s installed during deployment.
  2. If the issue persists, try increasing the Health Check Timeout in Cloud Run to give it more time to initialize.

The VPN is likely not the cause here, so you should be fine on that front! Let me know if that helps.

I hope the above information is helpful.