fsspec / fsspec/gcsfs

Release 0.7.0 causes GCP Cloud Function to fail to deploy

Open
#278 25 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
398
Forks
181
Avg merge
2d 10h
Merged PRs (30d)
36

Description

What happened: We are using Cloud Functions in Google Cloud Platform with a Python 3.7 runtime, and we use gcsfs to access files stored in Google Storage buckets. After adding some new features to an existing, working function, an attempt to redeploy the function failed with the following error message in the Logs Viewer:
Error: function terminated. Recommended action: inspect logs for termination reason. Function cannot be initialized.

The Cloud Function was then unable to be tested since deployment failed.

We simplified our code until we were able to determine that the only issue was gcsfs in the requirements.txt file. After checking the release history and seeing that 0.7.0 was released on August 21, 2020, which coincided with the deploy failure of our Cloud Function, we decided to specify version 0.6.2 on the requirements.txt file. With this change made, the Cloud Function successfully deployed.

What you expected to happen:
We expected our Cloud Function to continue working as it had been before.

Minimal Complete Verifiable Example:

import base64
import datetime
import json
import os

def hello_gcs(event, context):
    """Triggered by a change to a Cloud Storage bucket.
    Args:
         event (dict): Event payload.
         context (google.cloud.functions.Context): Metadata for the event.
    """
    file = event
    print(f"Processing file: {file['name']}.")

The issue appears to be with attempting to install gcsfs 0.7.0 on pip, so no code is required to trigger this bug.

Anything else we need to know?:

Environment:
Google Cloud Platform Cloud Functions

  • Dask version:
  • Python version: 3.7.6
  • Operating System: Ubuntu 18.04
  • Install method (conda, pip, source): pip

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the reported Python 3.7 Cloud Function deployment and the requirements.txt entry for gcsfs 0.7.0, then compare it with the working 0.6.2 installation and inspect the 0.7.0 release changes. Reproduce the failure on Google Cloud Functions and verify that the chosen fix allows the function to deploy without the reported initialization error.

Written by the indexing model from the issue text.

Assessment

Tech stack
gcp, google-cloud, python
Domain
backend, cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.