GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — rollback example in current docs throws exception · Issue #621 · googleapis/google-cloud-node

rollback example in current docs throws exception #621

New issue
Copy link
New issue
Copy link
Closed
Closed
rollback example in current docs throws exception#621
Copy link
Assignees
stephenplusplus
Labels
api: datastoreIssues related to the Datastore API.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.type: questionRequest for information or clarification. Not an issue.
Milestone
Datastore Stable

Description

@abelino
abelino
opened on May 22, 2015
Issue body actions

The current example under transaction.rollback e.g.

transaction.begin(function(err) {
  transaction.rollback(function(err) {
    if (err) {
      // Transaction could not be rolled back.
    }
  });
});

will produce the following exception

Error: Missing at least one required field for Message .pb.RollbackRequest: .pb.RollbackRequest.transaction
    at Error (<anonymous>)
    at ProtoBuf.Reflect.MessagePrototype.encode (/app/node_modules/gcloud/node_modules/protobufjs/dist/ProtoBuf.js:2345:31)
    at MessagePrototype.encode (/app/node_modules/gcloud/node_modules/protobufjs/dist/ProtoBuf.js:1981:31)
    at MessagePrototype.encodeNB (/app/node_modules/gcloud/node_modules/protobufjs/dist/ProtoBuf.js:2063:41)
    at Transaction.DatastoreRequest.makeReq_ (/app/node_modules/gcloud/lib/datastore/request.js:599:51)
    at Transaction.rollback (/app/node_modules/gcloud/lib/datastore/transaction.js:135:8)
    at Object.queryCb (/app/route-callbacks.js:558:19)
    at /app/node_modules/gcloud/lib/datastore/request.js:459:9
    at /app/node_modules/gcloud/lib/datastore/request.js:640:13
    at Object.handleResp (/app/node_modules/gcloud/lib/common/util.js:193:3)

Is that still the proper way to rollback? or should we simply call done()... when should rollback be actually used? after a commit and if the commit returns an error?

Thanks for any advice.

Activity

Next
  1. jgeewax
    added
    type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.
    type: questionRequest for information or clarification. Not an issue.
    api: datastoreIssues related to the Datastore API.
    on May 22, 2015
  2. jgeewax
    added this to the Datastore Stable milestone on May 22, 2015
  3. stephenplusplus commented on May 22, 2015

    @stephenplusplus
    stephenplusplus
    on May 22, 2015
    Contributor
    More actions

    Yes, I believe a rollback should only be done after a commit. This example definitely needs to be changed. I've thrown together a PR that will hopefully clear this up: #622

  4. stephenplusplus commented on Jun 8, 2015

    @stephenplusplus
    stephenplusplus
    on Jun 8, 2015
    Contributor
    More actions

    We've fixed this in our docs by showing better how to use Transactions.

  5. stephenplusplus
    closed this as completedon Jun 8, 2015
  6. abelino commented on Jun 10, 2015

    @abelino
    abelino
    on Jun 10, 2015
    Author
    More actions

    Thanks for the support

  7. stephenplusplus commented on Jun 10, 2015

    @stephenplusplus
    stephenplusplus
    on Jun 10, 2015
    Contributor
    More actions

    Thanks for catching our mistakes!

  8. JustinBeckwith
    assigned
    stephenplusplus
    on Feb 1, 2021
  9. sofisl
    added 2 commits that reference this issue on Oct 11, 2022

    chore: relocate owl bot post processor (#621)

    baf25a7

    chore: relocate owl bot post processor (#621)

    9e7737f
  10. sofisl
    added 3 commits that reference this issue on Nov 10, 2022

    build: adds UNORDERED_LIST enum (#621)

    cb7a2f2

    chore(main): release 4.0.2 (#621)

    e8e18bc

    chore(deps): update dependency jsdoc-region-tag to v2 (#621)

    59e6f39
  11. 1 remaining item

  12. sofisl
    added a commit that references this issue on Jan 10, 2023

    chore(nodejs): remove api-extractor dependencies (#621)

    e24660a
  13. sofisl
    added a commit that references this issue on Sep 13, 2023

    chore(deps): update dependency linkinator to v4 (#621)

    17766c1
  14. miguelvelezsa
    added a commit that references this issue on Jul 23, 2025

    fix(deps): pin @grpc/grpc-js to v0.6.8 (#621)

    7d27172
  15. sofisl
    added 8 commits that reference this issue on Jan 27, 2026

    refactor: use consistent directory structure (#621)

    a91f734

    refactor: use consistent directory structure (#621)

    0bc5063

    refactor: use consistent directory structure (#621)

    45d1d26

    refactor: use consistent directory structure (#621)

    0497bfa

    refactor: use consistent directory structure (#621)

    8489807

    docs(samples): add and update samples (#621)

    8414b10

    migrate code from googleapis/cloud-profiler-nodejs (#7087)

    288deb4

    build(node): update client library version in samples metadata (#1356) (

    f2b92e4
  16. GautamSharda
    added 3 commits that reference this issue on Mar 5, 2026

    chore: release 5.5.4 (#621)

    92a2fff

    chore: use published jsdoc-baseline package (#621)

    dd29772

    build: track flaky tests for "nightly", add new secrets for tagging (#…

    bb24854
  17. sofisl
    added a commit that references this issue on Mar 17, 2026

    feat!: Do not treat Buffers as JSON by default (#621)

    6e89f2e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @stephenplusplus
    stephenplusplus

Labels

api: datastoreIssues related to the Datastore API.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.type: questionRequest for information or clarification. Not an issue.

Type

No type

Projects

No projects

    Milestone

    • Datastore Stable

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.