Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not put (-30786) (10199) #72

Open
debmalyakar opened this issue Jan 4, 2023 · 17 comments
Open

Could not put (-30786) (10199) #72

debmalyakar opened this issue Jan 4, 2023 · 17 comments
Labels
bug Something isn't working

Comments

@debmalyakar
Copy link

debmalyakar commented Jan 4, 2023

Describe the bug
While trying to insert around 200 records the following error is received.

[ERROR] Storage error (code -30786)
Error occurred: Could not put (-30786) (10199)
"storageGeneral" "Could not put (-30786)"

Basic info (please complete the following information):

  • ObjectBox version (are you using the latest version?): 1.6.0 (No the latest version is not used)
  • Reproducibility: occasionally without visible pattern
  • Device: Iphone 12 mini
  • OS: iOS 15.7

To Reproduce
Steps to reproduce the behavior:

  1. Try to insert around 200 rows in a table
  2. Apply the generic put statement for eg - try box?.put(arrayOfObjects)
  3. Sometimes this error is received - "storageGeneral" "Could not put (-30786)"

Expected behavior
It is expected that the data should be inserted in the database on "put" statement.

Code
If applicable, add code to help explain your problem.

  • Include affected entity classes.
class Assignment : Entity{
    var id : Id
    // objectbox: unique
    var assignmentId : String
    
    var createdDate : String
    var name : String
    var signature : String
    var picture : String
    var picture1 : String
    var picture2 : String

//    var startTime : String
//    var endTime : String
    var priority : String
    var employeeFullName : String
    var roomId : String
    var roomType : String
    var roomName : String
    var buildingName : String
    var floorPicklist : String
    var functionalAreaName : String
    var asset : String
    var status : String
    var formattedDate : String
    var dueDate : String
    var startDueTime : String
    var endDueTime : String
    var order: Int
    var sortDate: Date
    var isOverdue: Bool

    var isLocallyEdited : Bool
    var isAddedAfterStart : Bool
    var deSelectedQuestionCommaSeparated : String

    var site : ToOne<Site> = nil
    var nameValue : String
    
    var assignmentStartTime : String
    var assignmentEndTime : String
    
    var comment : String
    var isquestionONEselected : Bool
    var isquestionTWOselected : Bool
    var isquestionTHREEselected : Bool
    var description : String
    var siteEquipmentname : String
    
    var signatureImageName : String
    
    var firstPictureImageName : String
    var secondPictureImageName : String
    var thirdtPictureImageName : String
    var helpDeskId : String
   
    // Requestor Info
    var requestorVisible: Bool
    var requestorName: String
    var requestorEmail: String
    var requestorPhone: String
    
    var clientServiceName: String
    var workType: String
    
    // objectbox: backlink = "assignment"
    var interruptions : ToMany<Interruption> = nil
   
    // objectbox: backlink = "assignment"
    var issues : ToMany<Issue> = nil
    
 
    
    required init() {
        self.id = 0
        self.assignmentId = ""
        self.createdDate = ""
        self.name = ""
        self.signature = ""
        self.picture = ""
        self.picture1 = ""
        self.picture2 = ""

        self.priority = ""
        self.employeeFullName = ""
        self.roomId = ""
        self.roomType = ""
        self.roomName = ""
        self.buildingName = ""
        self.floorPicklist = ""
        self.functionalAreaName = ""
        self.asset = ""
        self.status = ""
        self.formattedDate = ""
        self.isLocallyEdited = false
        self.isAddedAfterStart = false
        self.dueDate = ""
        self.startDueTime = ""
        self.endDueTime = ""
        self.deSelectedQuestionCommaSeparated = ""
        self.nameValue = ""
        self.assignmentStartTime = ""
        self.assignmentEndTime = ""
        order = Int.max
        sortDate = Date()
        isOverdue = false
        
        self.comment = ""
        self.isquestionONEselected = true
        self.isquestionTWOselected = true
        self.isquestionTHREEselected = true
        self.description = ""
        self.siteEquipmentname = ""
        self.signatureImageName = ""
      
        self.firstPictureImageName = ""
        self.secondPictureImageName = ""
        self.thirdtPictureImageName = ""
        
        self.helpDeskId = ""
        requestorVisible = false
        requestorName = ""
        requestorEmail = ""
        requestorPhone = ""
        
        clientServiceName = ""
        workType = ""
    }

This is the method that have been used to insert - try assignmentBox?.put(assignments)
assignments is an array.

Logs, stack traces

[ERROR] Storage error (code -30786)
Error occurred: Could not put (-30786) (10199)
"storageGeneral" "Could not put (-30786)"

Additional context
Add any other context about the problem here.

  • Is there anything special about your code?
    Nothing special is done. Server is called and the response is being tried to insert into database.
  • May transactions or multi-threading play a role?
    Transactions is not used.
  • Did you find any workarounds to prevent the issue?
    Not as of yet.

Kindly let me know the probable cases where this error may appear.

@debmalyakar debmalyakar added the bug Something isn't working label Jan 4, 2023
@greenrobot
Copy link
Member

@debmalyakar Could you please adjust the issue text and ensure you provide the information the issue template asks for? That would be helpful to give you a better answer. Thanks.

@debmalyakar
Copy link
Author

@debmalyakar Could you please adjust the issue text and ensure you provide the information the issue template asks for? That would be helpful to give you a better answer. Thanks.

I have adjusted the issue text according to the template. Kindly let me know if you need added information.

@greenrobot
Copy link
Member

Thanks for the additional info. I believe a similar issue was reported on another platform. It's likely related to the unique constraint; so maybe we can track it down starting with that assumption. Can you tell somehow if it occurs in certain conditions only, e.g. if the unique constraint is violated?

@debmalyakar
Copy link
Author

I removed the unique constraint but the error still occurs after removing.
I'm trying to find other concrete conditions that may help to solve the issue....

@greenrobot
Copy link
Member

greenrobot commented Jan 9, 2023

Thanks, if it's possible that you share the Xcode project (or a reduced sample project), we would be glad to look into it.

PS.: Does this only occur on the said iPhone, or also using the simulator?

@debmalyakar
Copy link
Author

I'm trying to create a reduced sample project that will have the same issue. I'll surely share if i can create similar issue there.

I tested on the simulator (iPhone 12 mini , iOS 15.5). It is working fine on simulator. The problem only occurs on device.

@debmalyakar
Copy link
Author

I have made another observation.
If i comment or remove some properties on the Entity class like the below mentioned ones

var requestorVisible: Bool
var requestorName: String
var requestorEmail: String
var requestorPhone: String
var clientServiceName: String
var workType: String
var dueDate : String
var startDueTime : String
var endDueTime : String
var sortDate: Date

The insertion process works fine. Is there any sort of limitations on the number of properties in an Entity class that i may have missed from the documentation ?

@greenrobot
Copy link
Member

Is there any sort of limitations on the number of properties in an Entity class

In theory no; we have test for these cases and know of successful apps that have lots of properties. However, you may be hitting some problematic scenario...

@debmalyakar
Copy link
Author

Thanks, if it's possible that you share the Xcode project (or a reduced sample project), we would be glad to look into it.

PS.: Does this only occur on the said iPhone, or also using the simulator?

Can you please share an email id where i can share the Xcode project?

@greenrobot
Copy link
Member

Can you please share an email id where i can share the Xcode project?

markus
@
objectbox
io

@debmalyakar
Copy link
Author

Can you please share an email id where i can share the Xcode project?

markus @ objectbox io

I have sent you a demo project replicating the error on the above email. Please let me know if you have received the code sample.

Kindly go through the code and let me know if we are missing anything that might cause the problem.

@objectbox objectbox deleted a comment from debmalyakar Jan 13, 2023
@greenrobot
Copy link
Member

Thanks, I received it.

@debmalyakar
Copy link
Author

Kindly go through the code and let me know if we are missing anything that might cause the problem.

@debmalyakar
Copy link
Author

If possible kindly let me know of any workarounds to solve this issue...
we have faced this issue in production... it will be very helpful if we can get any workarounds..

@greenrobot
Copy link
Member

greenrobot commented Jan 17, 2023

Status update: after removing the unique constraint, the project you sent me was able to put all objects.

PS.: Adding a // objectbox: index = value to the unique constraint also fixed the issue.

@greenrobot
Copy link
Member

An actual fix was completed internally. We'll likely release a 1.8.1 patch version soon.

@greenrobot
Copy link
Member

Fixed in 1.8.1, which was released Jan 30th. If possible, it'd be great to have your feedback on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants