Skip to content
This repository was archived by the owner on Aug 30, 2026. It is now read-only.
This repository was archived by the owner on Aug 30, 2026. It is now read-only.

Increment no longer working on AWS #592

Closed

Description

@NinitoAS

Hi,

It seems like Increment recently stopped working after the newest update on AWS Linux 2.

Environment details

  • OS type and version: Linux 4.14.275-207.503.amzn2.x86_64 #1 SMP Wed Apr 13 20:24:50 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
  • Python version: 3.8.5
  • pip version: pip 22.0.4 from /usr/local/lib/python3.8/site-packages/pip (python 3.8)
  • google-cloud-firestore version: 2.5.0

Steps to reproduce

  1. Run the code below

Code example

from firebase_admin import credentials, firestore, initialize_app
from google.cloud.firestore_v1 import Increment

cred = credentials.Certificate("test.json")

initialize_app(cred)
db = firestore.client()

db.collection("test").document("test").set({"count": Increment(1)}, merge=True)

Stack trace

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/ec2-user/.local/lib/python3.8/site-packages/google/cloud/firestore_v1/document.py", line 166, in set
    batch, kwargs = self._prep_set(document_data, merge, retry, timeout)
  File "/home/ec2-user/.local/lib/python3.8/site-packages/google/cloud/firestore_v1/base_document.py", line 217, in _prep_set
    batch.set(self, document_data, merge=merge)
  File "/home/ec2-user/.local/lib/python3.8/site-packages/google/cloud/firestore_v1/base_batch.py", line 107, in set
    write_pbs = _helpers.pbs_for_set_with_merge(
  File "/home/ec2-user/.local/lib/python3.8/site-packages/google/cloud/firestore_v1/_helpers.py", line 870, in pbs_for_set_with_merge
    set_pb.update_transforms.extend(field_transform_pbs)
TypeError: Expected a message object, but got field_path: "count"
increment {
  integer_value: 1
}

Any suggestions?

Activity

  1. roburns commented on May 26, 2022

    @roburns

    I'm having the same issue in GCP Functions. Woke up to similar logs revolving around ArrayUnion and ArrayRemove.

  2. Mariatta commented on May 26, 2022

    @Mariatta
    Contributor

    Hi @NinitoAS, thanks for reporting the issue and sorry to hear that you're having trouble with this.
    I can't seem to replicate the your problem. I'm wondering if perhaps other dependency is causing the issue.
    Can you do a pip freeze, and let us know the version of the following libraries?

    firebase-admin
    google-api-core
    protobuf
    proto-plus
    

    Thank you.

  3. Mariatta commented on May 26, 2022

    @Mariatta
    Contributor

    @rburns629 would you mind sharing a sample code snippet for replicating this issue? Thanks.

  4. NinitoAS commented on May 26, 2022

    @NinitoAS
    Author

    Hi @NinitoAS, thanks for reporting the issue and sorry to hear that you're having trouble with this. I can't seem to replicate the your problem. I'm wondering if perhaps other dependency is causing the issue. Can you do a pip freeze, and let us know the version of the following libraries?

    firebase-admin
    google-api-core
    protobuf
    proto-plus
    

    Thank you.

    Hi, yes of course.

    firebase-admin==5.2.0
    google-api-core==2.8.0
    protobuf==4.21.0
    proto-plus==1.20.4
    

    Here are my other dependencies:

    CacheControl==0.12.11
    cachetools==5.1.0
    certifi==2021.10.8
    charset-normalizer==2.0.12
    distlib==0.3.4
    filelock==3.6.0
    google-api-python-client==2.49.0
    google-auth==2.6.6
    google-auth-httplib2==0.1.0
    google-cloud-core==2.3.0
    google-cloud-firestore==2.5.0
    google-cloud-storage==2.3.0
    google-crc32c==1.3.0
    google-resumable-media==2.3.3
    googleapis-common-protos==1.56.1
    grpcio==1.46.3
    grpcio-status==1.46.3
    httplib2==0.20.4
    idna==3.3
    msgpack==1.0.3
    pipenv @ file:///tmp/pipenv-2021.11.9-py2.py3-none-any.whl
    platformdirs==2.5.2
    pyasn1==0.4.8
    pyasn1-modules==0.2.8
    pyparsing==3.0.9
    requests==2.27.1
    rsa==4.8
    six==1.16.0
    uritemplate==4.1.1
    urllib3==1.26.9
    virtualenv==20.14.1
    virtualenv-clone==0.5.7
    
  5. NinitoAS commented on May 26, 2022

    @NinitoAS
    Author

    I just updated all the packages you mentioned and I can't seem to reproduce the issue any longer.

    Here are the new versions

    firebase-admin==5.2.0
    google-api-core==2.8.1
    protobuf==3.20.1
    proto-plus==1.20.5
    

    The issue seem to be connected to protobuf, proto-plus requires protobuf<4.0.0dev,>=3.19.0

    So it seems like the issue appears when you have protobuf 4.21.0

    Seems like we have to pin our dependency versions for AWS for it to not install v4 of protobuf

  6. Mariatta commented on May 26, 2022

    @Mariatta
    Contributor

    Yes indeed protobuf 4 is not compatible here. I'd recommend setting the limit as follows:
    protobuf >= 3.15.0, <4.0.0dev.

  7. roburns commented on May 26, 2022

    @roburns

    @Mariatta My issues were resolved as well by including protobuf==3.20.1 and google-api-core==2.8.1 in my requirements.txt. Thanks for the suggestions!

  8. added a commit that references this issue on May 26, 2022
    9b06f47
  9. added a commit that references this issue on May 27, 2022
    2281290
  10. added
    type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.
    priority: p2Moderately-important priority. Fix may not be included in next release.
    and removed
    triage meI really want to be triaged.
    on Aug 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    api: firestoreIssues related to the googleapis/python-firestore API.priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions