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 — Datastore error on great amount of data · Issue #1386 · googleapis/google-cloud-node

Datastore error on great amount of data #1386

New issue
Copy link
New issue
Copy link
Closed
Closed
Datastore error on great amount of data#1386
Copy link
Assignees
stephenplusplus
Labels
api: datastoreIssues related to the Datastore API.type: questionRequest for information or clarification. Not an issue.

Description

@michele-pini
michele-pini
opened on Jun 15, 2016
Issue body actions

Hi,
i'm facing a real strange issue.
I've a datastore save request that goes well when the entity is small,
but when we try to save a great amount of data we receive this error

{ handle: 2,
type: 'error',
 className: 'Error',
 constructorFunction: { ref: 8 },
 protoObject: { ref: 9 },
 prototypeObject: { ref: 1 },
 properties: 
  [ { name: 'stack', attributes: 2, propertyType: 3, ref: 1 },
    { name: 'message', attributes: 2, propertyType: 0, ref: 10 },
    { name: 'code', propertyType: 0, ref: 11 },
    { name: 'metadata', propertyType: 0, ref: 12 } ],
 text: 'Error: Bad Request' }

that breaks the node process with this stacktrace:

  < /Users/michelepini/crawler.analytics.igenius.net/node_modules/gcloud/lib/datastore/entity.js:300
  <   throw new Error('Unsupported field value, ' + value + ', was provided.');
  <   ^
  < Error: Unsupported field value, undefined, was provided.
  <     at Object.encodeValue (/Users/michelepini/crawler.analytics.igenius.net/node_modules/gcloud/lib/datastore/entity.js:300:9)
  <     at /Users/michelepini/crawler.analytics.igenius.net/node_modules/gcloud/lib/datastore/entity.js:652:24
  <     at Array.map (native)
  <     at Object.queryToQueryProto (/Users/michelepini/crawler.analytics.igenius.net/node_modules/gcloud/lib/datastore/entity.js:646:33)
  <     at makeRequest (/Users/michelepini/crawler.analytics.igenius.net/node_modules/gcloud/lib/datastore/request.js:495:21)
  <     at Object.makeRequest (/Users/michelepini/crawler.analytics.igenius.net/node_modules/gcloud/lib/common/util.js:579:21)
  <     at DestroyableTransform.<anonymous> (/Users/michelepini/crawler.analytics.igenius.net/node_modules/gcloud/lib/datastore/request.js:485:13)
  <     at DestroyableTransform.g (events.js:286:16)
  <     at emitOne (events.js:96:13)
  <     at DestroyableTransform.emit (events.js:188:7)

the error shows up when i try to save an entity with two string field, not indexed of 1MB of size
ie

{
  data: [0.9MB string not indexed]
  data2: [0.9MB string not indexex]
  [other strings indexed of no more than 40bit]
}

We chunck our data on string of less than 1MB to respect the maximum string length property on datastore.
I'm pretty sure that the issue is about the amount of data because saving only one chunk no error was raised.

There's an upper limit on the total entity size or there is some error?

Thanks in advance

Reacted by alessandrocerasino, MD, tkhm, Sergei Murkou and Marc Gong Bacvanski

Activity

Next
  1. stephenplusplus commented on Jun 15, 2016

    @stephenplusplus
    stephenplusplus
    on Jun 15, 2016
    Contributor
    More actions

    Sorry you're having this issue :( Is it possible to put a small sample together, or otherwise the actual gcloud-node code you're using?

  2. stephenplusplus
    added
    api: datastoreIssues related to the Datastore API.
    on Jun 15, 2016
  3. michele-pini commented on Jun 16, 2016

    @michele-pini
    michele-pini
    on Jun 16, 2016
    Author
    More actions

    hi,
    here is a really small test file to verify the behaviour.

            'use strict';
    
            const gcloud = require('gcloud')({
                projectId: [project ID],
                keyFilename: [keyfilePath]
            });
            const datastore = gcloud.datastore();
            const _ = require('lodash');
    
            var str = new Array(500000).join("a");
    
            debugger;
    
            function toDatastore(obj, indexedFields) {
                indexedFields = indexedFields || [];
                const results = [];
                Object.keys(obj).forEach((k) => {
                    if (obj[k] === undefined) {
                        return;
                    }
                    results.push({
                        name: k,
                        value: obj[k],
                        excludeFromIndexes: indexedFields.indexOf(k) < 0
                    });
                });
                return results;
            }
    
            function create(kind, data, indexedFields, cb) {
                const key = datastore.key([kind]);
                debugger;
                const entity = {
                    key: key,
                    data: toDatastore(data, indexedFields)
                };
    
                datastore.save(
                    entity,
                    (error) => {
                        debugger;
                        if (error) {
                            return cb ? cb(error) : error;
                        }
    
                        return cb ? cb(null) : true;
                    }
                );
            };
    
            create("testKind", {
                data0: str,
                data1: str,
                data3: str,
                key: '250277808676421',
                key1: 'b4wbj0b5wy04',
                key2: 'sdjhfkahsdjkfhjkas',
                key3: "setstts",
                key4: "sdfasdfa"
            }, ["key", "key1", "key2", "key3", "key4"], (err, result) => {
                debugger;
            });
    

    In this case the error was raised whth string of 500000 chars.
    Thanks

  4. stephenplusplus commented on Jun 16, 2016

    @stephenplusplus
    stephenplusplus
    on Jun 16, 2016
    Contributor
    More actions

    Thanks for putting that together. @pcostell any insight on this one? Thanks!

  5. pcostell commented on Jun 16, 2016

    @pcostell
    pcostell
    on Jun 16, 2016
    Contributor
    More actions

    It looks like you've exceeded the maximum size for an entity: https://cloud.google.com/datastore/docs/concepts/limits

    Not sure why you don't get a nicer error though. @stephenplusplus can see what the request/response from Datastore is?

  6. stephenplusplus commented on Jun 16, 2016

    @stephenplusplus
    stephenplusplus
    on Jun 16, 2016
    Contributor
    More actions

    @pcostell would that relate to #1378? I think as of now, we don't have a way to pull out any detailed error messaging.

  7. pcostell commented on Jun 16, 2016

    @pcostell
    pcostell
    on Jun 16, 2016
    Contributor
    More actions

    Ah yes that's likely the issue -- although I don't understand why a Bad request turns into the given node stack trace.

  8. stephenplusplus commented on Jun 16, 2016

    @stephenplusplus
    stephenplusplus
    on Jun 16, 2016
    Contributor
    More actions

    Yeah, I don't understand that either. That didn't happen for me from the sample code provided, maybe it was from some temporarily malformed code, @mik115?

  9. michele-pini commented on Jun 17, 2016

    @michele-pini
    michele-pini
    on Jun 17, 2016
    Author
    More actions

    No temporary malformed and yes I reached the upper entity limit size of 1MB.
    I've already fixed the problem chunking my data and saving them in separate entities.

    Thanks anyway for the really quick responses

  10. stephenplusplus commented on Jun 20, 2016

    @stephenplusplus
    stephenplusplus
    on Jun 20, 2016
    Contributor
    More actions

    Great :) We're working on providing more helpful error messages in #1378. Feel free to re-open this if you think there's more we can do.

  11. stephenplusplus
    closed this as completedon Jun 20, 2016
  12. stephenplusplus
    added
    type: questionRequest for information or clarification. Not an issue.
    on Jun 20, 2016
  13. kirillgroshkov commented on Nov 13, 2017

    @kirillgroshkov
    kirillgroshkov
    on Nov 13, 2017
    More actions

    It breaks node process for me as well! With same error, on same line:

    Error: Unsupported field value, undefined, was provided.
      <     at Object.encodeValue
    

    Ideas how to fix it?

  14. stephenplusplus commented on Nov 14, 2017

    @stephenplusplus
    stephenplusplus
    on Nov 14, 2017
    Contributor
    More actions

    @kirillgroshkov could you share reproduction code?

  15. JustinBeckwith
    assigned
    stephenplusplus
    on Feb 1, 2021
  16. 1 remaining item

  17. sofisl
    added 6 commits that reference this issue on Jan 27, 2026

    chore(deps): update dependency python to v3.10.4 (#1386) (#815)

    6f94e14

    chore(deps): update dependency python to v3.10.4 (#1386) (#815)

    2f0833e

    chore(deps): update dependency python to v3.10.4 (#1386) (#815)

    6f338be

    chore(deps): update dependency python to v3.10.4 (#1386) (#815)

    6e68bfe

    chore(deps): update dependency python to v3.10.4 (#1386) (#815)

    560e696

    chore(deps): update dependency python to v3.10.4 (#1386) (#815)

    52ade85
  18. sofisl
    added 2 commits that reference this issue on Feb 24, 2026

    chore: update license headers (#1386)

    53ba481

    chore(deps): update dependency python to v3.10.4 (#1386) (#1602)

    bc9a353
  19. GautamSharda
    added 2 commits that reference this issue on Mar 5, 2026

    chore(main): release 10.3.3 (#1386)

    adc7214

    fix(build): move branch references to main (#1174) (#1386)

    87ac471
  20. GautamSharda
    added 2 commits that reference this issue on Mar 23, 2026

    feat: Trusted Private Cloud support, use the universeDomain parameter (…

    e6e23c5

    feat: Trusted Private Cloud support, use the universeDomain parameter (…

    028f1d1
  21. feywind
    added a commit that references this issue on Mar 27, 2026

    fix(build): move branch references to main (#1174) (#1386)

    3fc341f
  22. shivanee-p
    added a commit that references this issue on Mar 27, 2026

    feat: Trusted Private Cloud support, use the universeDomain parameter (…

    584c623
  23. thiyaguk09
    added a commit that references this issue on May 5, 2026

    feat: Trusted Private Cloud support, use the universeDomain parameter (…

    29736ea
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: questionRequest for information or clarification. Not an issue.

Type

No type

Projects

No projects

    Milestone

    No milestone

    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.