raised BadValueError(Entity has uninitialized properties: created_by)











up vote
0
down vote

favorite












i am getting 500 error. i checked the logs on google app engine. And i find out it was due to raised BadValueError(Entity has uninitialized properties: created_by)



there is a screen shot of the logs. do have a check below.
enter image description here



the model in which we use to create the datastore is this .



class YoProject(BaseNDBExpando):
project_name = ndb.StringProperty(required=True)
***created_by = ndb.KeyProperty(required=True)***
created_by_name = ndb.StringProperty(required=True, indexed=False)
client_name = ndb.StringProperty(required=True)
client_spoc_name = ndb.StringProperty(required=True, indexed=False)
client_spoc_email = ndb.StringProperty(required=True)
type_ = ndb.StringProperty(required=True, choices=["tm", "pa"])
description = ndb.TextProperty(indexed=False)
hidden = ndb.BooleanProperty(required=True, default=False)


it was running fine. but when i try to introduce a class property in it.i start getting this error and also on GAE Datastore dashboard there are two same property of different datatypes i don,t how to handle this situation. need guidance and help from senior developers.



enter image description here










share|improve this question






















  • @DanCornilescu i need you help on this.
    – Ashish Yadav
    Oct 15 at 18:44

















up vote
0
down vote

favorite












i am getting 500 error. i checked the logs on google app engine. And i find out it was due to raised BadValueError(Entity has uninitialized properties: created_by)



there is a screen shot of the logs. do have a check below.
enter image description here



the model in which we use to create the datastore is this .



class YoProject(BaseNDBExpando):
project_name = ndb.StringProperty(required=True)
***created_by = ndb.KeyProperty(required=True)***
created_by_name = ndb.StringProperty(required=True, indexed=False)
client_name = ndb.StringProperty(required=True)
client_spoc_name = ndb.StringProperty(required=True, indexed=False)
client_spoc_email = ndb.StringProperty(required=True)
type_ = ndb.StringProperty(required=True, choices=["tm", "pa"])
description = ndb.TextProperty(indexed=False)
hidden = ndb.BooleanProperty(required=True, default=False)


it was running fine. but when i try to introduce a class property in it.i start getting this error and also on GAE Datastore dashboard there are two same property of different datatypes i don,t how to handle this situation. need guidance and help from senior developers.



enter image description here










share|improve this question






















  • @DanCornilescu i need you help on this.
    – Ashish Yadav
    Oct 15 at 18:44















up vote
0
down vote

favorite









up vote
0
down vote

favorite











i am getting 500 error. i checked the logs on google app engine. And i find out it was due to raised BadValueError(Entity has uninitialized properties: created_by)



there is a screen shot of the logs. do have a check below.
enter image description here



the model in which we use to create the datastore is this .



class YoProject(BaseNDBExpando):
project_name = ndb.StringProperty(required=True)
***created_by = ndb.KeyProperty(required=True)***
created_by_name = ndb.StringProperty(required=True, indexed=False)
client_name = ndb.StringProperty(required=True)
client_spoc_name = ndb.StringProperty(required=True, indexed=False)
client_spoc_email = ndb.StringProperty(required=True)
type_ = ndb.StringProperty(required=True, choices=["tm", "pa"])
description = ndb.TextProperty(indexed=False)
hidden = ndb.BooleanProperty(required=True, default=False)


it was running fine. but when i try to introduce a class property in it.i start getting this error and also on GAE Datastore dashboard there are two same property of different datatypes i don,t how to handle this situation. need guidance and help from senior developers.



enter image description here










share|improve this question













i am getting 500 error. i checked the logs on google app engine. And i find out it was due to raised BadValueError(Entity has uninitialized properties: created_by)



there is a screen shot of the logs. do have a check below.
enter image description here



the model in which we use to create the datastore is this .



class YoProject(BaseNDBExpando):
project_name = ndb.StringProperty(required=True)
***created_by = ndb.KeyProperty(required=True)***
created_by_name = ndb.StringProperty(required=True, indexed=False)
client_name = ndb.StringProperty(required=True)
client_spoc_name = ndb.StringProperty(required=True, indexed=False)
client_spoc_email = ndb.StringProperty(required=True)
type_ = ndb.StringProperty(required=True, choices=["tm", "pa"])
description = ndb.TextProperty(indexed=False)
hidden = ndb.BooleanProperty(required=True, default=False)


it was running fine. but when i try to introduce a class property in it.i start getting this error and also on GAE Datastore dashboard there are two same property of different datatypes i don,t how to handle this situation. need guidance and help from senior developers.



enter image description here







python-2.7 google-app-engine web-applications google-cloud-datastore webapp2






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Oct 15 at 17:21









Ashish Yadav

345




345












  • @DanCornilescu i need you help on this.
    – Ashish Yadav
    Oct 15 at 18:44




















  • @DanCornilescu i need you help on this.
    – Ashish Yadav
    Oct 15 at 18:44


















@DanCornilescu i need you help on this.
– Ashish Yadav
Oct 15 at 18:44






@DanCornilescu i need you help on this.
– Ashish Yadav
Oct 15 at 18:44














2 Answers
2






active

oldest

votes

















up vote
0
down vote













If you are in local environment, I would suggest you to delete/flush all entities of this model.



Then try to reproduce it using another word than classes as property name.






share|improve this answer





















  • classes is not issue but the Bad Value Error(Entity has uninitialized properties: created_by) the app is still runs but i have to refresh the page to move forward in app.
    – Ashish Yadav
    Oct 16 at 0:56


















up vote
0
down vote













I think I saw this error as well in my early GAE days, when I was modifying the entity models all the time, I'm much more reluctant to do it nowadays as I know that such changes need extra care and almost always a migration strategy.



I got it after I added the required=True option to a model's property. The option causes an error if you're trying to put am entity without that property set, obviously. But it also causes an error when trying to get an entity put in the datastore without the property being set, before the option was enabled in the model. This is what I suspect may be happening. Note that this check is ndb-specific, so it will affect your app code, but not the console viewer or apps using other client libraries.



Look at all entities of that kind in the Entity menu, checking which don't have the property set.



Try enabling debugging for your app (by passing debug=True in your app's webapp2.WSGIApplication() call), which should show a traceback attached to the respective request log. It would be helpful to figure out where exactly is the error encountered.



The duplicates you highlighted in the Dashboard image may be red herrings - I see similar ones on my apps as well, with no ill effects (or at least none that I noticed).



I'm not sure if some of them aren't side effects of the various changes I did in time to the entity models, in particular flipping the indexed setting for some properties.



But I'm almost certain the String/Text ones are simply caused by the datastore Text string properties being indexed only if the value has less than 1500 bytes (i.e what's considered as different property types in ndb - TextProperty and StringProperty).



Also note the 0B indexes are normal for properties being not indexed, see for example your description property.






share|improve this answer





















    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f52821801%2fraised-badvalueerrorentity-has-uninitialized-properties-created-by%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    If you are in local environment, I would suggest you to delete/flush all entities of this model.



    Then try to reproduce it using another word than classes as property name.






    share|improve this answer





















    • classes is not issue but the Bad Value Error(Entity has uninitialized properties: created_by) the app is still runs but i have to refresh the page to move forward in app.
      – Ashish Yadav
      Oct 16 at 0:56















    up vote
    0
    down vote













    If you are in local environment, I would suggest you to delete/flush all entities of this model.



    Then try to reproduce it using another word than classes as property name.






    share|improve this answer





















    • classes is not issue but the Bad Value Error(Entity has uninitialized properties: created_by) the app is still runs but i have to refresh the page to move forward in app.
      – Ashish Yadav
      Oct 16 at 0:56













    up vote
    0
    down vote










    up vote
    0
    down vote









    If you are in local environment, I would suggest you to delete/flush all entities of this model.



    Then try to reproduce it using another word than classes as property name.






    share|improve this answer












    If you are in local environment, I would suggest you to delete/flush all entities of this model.



    Then try to reproduce it using another word than classes as property name.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Oct 15 at 19:37









    ThisIsMyName

    1325




    1325












    • classes is not issue but the Bad Value Error(Entity has uninitialized properties: created_by) the app is still runs but i have to refresh the page to move forward in app.
      – Ashish Yadav
      Oct 16 at 0:56


















    • classes is not issue but the Bad Value Error(Entity has uninitialized properties: created_by) the app is still runs but i have to refresh the page to move forward in app.
      – Ashish Yadav
      Oct 16 at 0:56
















    classes is not issue but the Bad Value Error(Entity has uninitialized properties: created_by) the app is still runs but i have to refresh the page to move forward in app.
    – Ashish Yadav
    Oct 16 at 0:56




    classes is not issue but the Bad Value Error(Entity has uninitialized properties: created_by) the app is still runs but i have to refresh the page to move forward in app.
    – Ashish Yadav
    Oct 16 at 0:56












    up vote
    0
    down vote













    I think I saw this error as well in my early GAE days, when I was modifying the entity models all the time, I'm much more reluctant to do it nowadays as I know that such changes need extra care and almost always a migration strategy.



    I got it after I added the required=True option to a model's property. The option causes an error if you're trying to put am entity without that property set, obviously. But it also causes an error when trying to get an entity put in the datastore without the property being set, before the option was enabled in the model. This is what I suspect may be happening. Note that this check is ndb-specific, so it will affect your app code, but not the console viewer or apps using other client libraries.



    Look at all entities of that kind in the Entity menu, checking which don't have the property set.



    Try enabling debugging for your app (by passing debug=True in your app's webapp2.WSGIApplication() call), which should show a traceback attached to the respective request log. It would be helpful to figure out where exactly is the error encountered.



    The duplicates you highlighted in the Dashboard image may be red herrings - I see similar ones on my apps as well, with no ill effects (or at least none that I noticed).



    I'm not sure if some of them aren't side effects of the various changes I did in time to the entity models, in particular flipping the indexed setting for some properties.



    But I'm almost certain the String/Text ones are simply caused by the datastore Text string properties being indexed only if the value has less than 1500 bytes (i.e what's considered as different property types in ndb - TextProperty and StringProperty).



    Also note the 0B indexes are normal for properties being not indexed, see for example your description property.






    share|improve this answer

























      up vote
      0
      down vote













      I think I saw this error as well in my early GAE days, when I was modifying the entity models all the time, I'm much more reluctant to do it nowadays as I know that such changes need extra care and almost always a migration strategy.



      I got it after I added the required=True option to a model's property. The option causes an error if you're trying to put am entity without that property set, obviously. But it also causes an error when trying to get an entity put in the datastore without the property being set, before the option was enabled in the model. This is what I suspect may be happening. Note that this check is ndb-specific, so it will affect your app code, but not the console viewer or apps using other client libraries.



      Look at all entities of that kind in the Entity menu, checking which don't have the property set.



      Try enabling debugging for your app (by passing debug=True in your app's webapp2.WSGIApplication() call), which should show a traceback attached to the respective request log. It would be helpful to figure out where exactly is the error encountered.



      The duplicates you highlighted in the Dashboard image may be red herrings - I see similar ones on my apps as well, with no ill effects (or at least none that I noticed).



      I'm not sure if some of them aren't side effects of the various changes I did in time to the entity models, in particular flipping the indexed setting for some properties.



      But I'm almost certain the String/Text ones are simply caused by the datastore Text string properties being indexed only if the value has less than 1500 bytes (i.e what's considered as different property types in ndb - TextProperty and StringProperty).



      Also note the 0B indexes are normal for properties being not indexed, see for example your description property.






      share|improve this answer























        up vote
        0
        down vote










        up vote
        0
        down vote









        I think I saw this error as well in my early GAE days, when I was modifying the entity models all the time, I'm much more reluctant to do it nowadays as I know that such changes need extra care and almost always a migration strategy.



        I got it after I added the required=True option to a model's property. The option causes an error if you're trying to put am entity without that property set, obviously. But it also causes an error when trying to get an entity put in the datastore without the property being set, before the option was enabled in the model. This is what I suspect may be happening. Note that this check is ndb-specific, so it will affect your app code, but not the console viewer or apps using other client libraries.



        Look at all entities of that kind in the Entity menu, checking which don't have the property set.



        Try enabling debugging for your app (by passing debug=True in your app's webapp2.WSGIApplication() call), which should show a traceback attached to the respective request log. It would be helpful to figure out where exactly is the error encountered.



        The duplicates you highlighted in the Dashboard image may be red herrings - I see similar ones on my apps as well, with no ill effects (or at least none that I noticed).



        I'm not sure if some of them aren't side effects of the various changes I did in time to the entity models, in particular flipping the indexed setting for some properties.



        But I'm almost certain the String/Text ones are simply caused by the datastore Text string properties being indexed only if the value has less than 1500 bytes (i.e what's considered as different property types in ndb - TextProperty and StringProperty).



        Also note the 0B indexes are normal for properties being not indexed, see for example your description property.






        share|improve this answer












        I think I saw this error as well in my early GAE days, when I was modifying the entity models all the time, I'm much more reluctant to do it nowadays as I know that such changes need extra care and almost always a migration strategy.



        I got it after I added the required=True option to a model's property. The option causes an error if you're trying to put am entity without that property set, obviously. But it also causes an error when trying to get an entity put in the datastore without the property being set, before the option was enabled in the model. This is what I suspect may be happening. Note that this check is ndb-specific, so it will affect your app code, but not the console viewer or apps using other client libraries.



        Look at all entities of that kind in the Entity menu, checking which don't have the property set.



        Try enabling debugging for your app (by passing debug=True in your app's webapp2.WSGIApplication() call), which should show a traceback attached to the respective request log. It would be helpful to figure out where exactly is the error encountered.



        The duplicates you highlighted in the Dashboard image may be red herrings - I see similar ones on my apps as well, with no ill effects (or at least none that I noticed).



        I'm not sure if some of them aren't side effects of the various changes I did in time to the entity models, in particular flipping the indexed setting for some properties.



        But I'm almost certain the String/Text ones are simply caused by the datastore Text string properties being indexed only if the value has less than 1500 bytes (i.e what's considered as different property types in ndb - TextProperty and StringProperty).



        Also note the 0B indexes are normal for properties being not indexed, see for example your description property.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 11 at 6:49









        Dan Cornilescu

        27k113161




        27k113161






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f52821801%2fraised-badvalueerrorentity-has-uninitialized-properties-created-by%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Florida Star v. B. J. F.

            Danny Elfman

            Lugert, Oklahoma