Issue: The mobile device has submitted an object to the server, however the server rejects the submission with error code 422.
Cause: The cause can vary and the conflict itself usually indicates why the entity was rejected. In the sample provided above the error is caused by a unique constraint named ent_rel_unq_enf. It is necessary to check the data that was submitted and correct the conditions under which the rejection was caused.
C:\Program Files (x86)\Mohawk College\OpenIZ, or installation directory where OpenIZ server tools are installed.
oizac -r <<server address>>
Provide an administrator password for your session:
Open Immunize Administration & Security Console v0.9.9.22162 (Fredericton CTP1) Copyright (C) 2015 - 2017, Mohawk College of Applied Arts and Technology Access denied, authentication required. Username:administrator Password:************* * http://XXX.XXX.XXX.XXX:8080/ami -> v.0.9.9.21739 (Fredericton CTP1) Ready... >
> logcat openiz_20171116 -g <search_term> 2017-11-16T19:10:31.0000000 Error THD#:5 Error : Npgsql.PostgresException (0x80004005): 23505: duplicate key value violates unique constraint "ent_rel_unq_enf" at OpenIZ.Persistence.Data.ADO.Services.Persistence.BundlePersistenceService.InsertInternal(DataContext context, Bundle data, IPrincipal principal) in C:\Users\justin\Source\Repos\openiz\OpenIZ.Persistence.Data.ADO\Services\Persistence\BundlePersistenceService.cs:line 179 at OpenIZ.Persistence.Data.ADO.Services.AdoBasePersistenceService`1.Insert(DataContext context, TData data, IPrincipal principal) in C:\Users\justin\Source\Repos\openiz\OpenIZ.Persistence.Data.ADO\Services\AdoBasePersistenceService.cs:line 706 at OpenIZ.Persistence.Data.ADO.Services.AdoBasePersistenceService`1.Insert(TData data, IPrincipal principal, TransactionMode mode) in C:\Users\justin\Source\Repos\openiz\OpenIZ.Persistence.Data.ADO\Services\AdoBasePersistenceService.cs:line 200 -- <?xml version="1.0"?> <Bundle xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://openiz.org/model">
If you wish to save the log file contents you can save them to a file by running:
logcat openiz_20171116 -g <search_term> > file.txt
Correct the issue mentioned in the log file. This may require someone with developmental skills to correct a defect, or may require updating of a particular business rule. It is always recommended when developing business rules, that you add the name of the rule to the detail you return.