GGCE Server issueshttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues2023-01-18T16:28:17+01:00https://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/382Updated liquibase incompatible with existing yaml2023-01-18T16:28:17+01:00Matija ObrezaUpdated liquibase incompatible with existing yamlStarting GGCE on a blank mssql database results in:
```
Caused by: liquibase.exception.ValidationFailedException: Validation Failed:
6 changes have validation failures
addBeforeColumn is not allowed on mssql, classpath:li...Starting GGCE on a blank mssql database results in:
```
Caused by: liquibase.exception.ValidationFailedException: Validation Failed:
6 changes have validation failures
addBeforeColumn is not allowed on mssql, classpath:liquibase/liquibase-changeLog.yml::1591376777000-1::mobreza
addBeforeColumn is not allowed on mssql, classpath:liquibase/liquibase-changeLog.yml::1591376777000-1::mobreza
addAfterColumn is not allowed on mssql, classpath:liquibase/liquibase-changeLog.yml::1591376792000-3b2::mobreza
addAfterColumn is not allowed on mssql, classpath:liquibase/liquibase-changeLog.yml::1591376792000-4c1b::mobreza
addBeforeColumn is not allowed on mssql, classpath:liquibase/liquibase-changeLog.yml::1618393601951-2::mborodenko
addAfterColumn is not allowed on mssql, classpath:liquibase/liquibase-changeLog.yml::1618393601951-4::mborodenko
```
Please revise and update these changesets (with new `IDs`) in a way that they don't execute (but are `mark_ran`) if their previous version was already executed.2023.1Artem HrybeniukArtem Hrybeniukhttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/381Taxonomy database update fails2023-01-13T17:34:37+01:00Matija ObrezaTaxonomy database update failsUpdating Taxonomy from the most recent available GRIN Taxonomy dump results in:
> Cannot insert duplicate key row in object 'dbo.taxonomy_species' with unique index 'ndx_uniq_ts'. The duplicate key value is (Gordonia spp., <NULL>).
Thi...Updating Taxonomy from the most recent available GRIN Taxonomy dump results in:
> Cannot insert duplicate key row in object 'dbo.taxonomy_species' with unique index 'ndx_uniq_ts'. The duplicate key value is (Gordonia spp., <NULL>).
This is a result of `spp.` registered with different `Gordonia` genus with different name authorities.
Please remove the current unique index `taxonomy_species.ndx_uniq_ts` and replace it with a new unique index `ndx_uniq_ts` in columns: `name`, `name_authority`, `taxonomy_genus_id`.2023.1Artem HrybeniukArtem Hrybeniukhttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/380Allow caching OPTIONS response2023-03-09T09:44:48+01:00Matija ObrezaAllow caching OPTIONS responseThe API headers to OPTIONS request use `Expires: 0`, effectively disabling caching:
![image](/uploads/479cfc0d8f70194be0c70b2a7653d237/image.png)
Please update response to OPTIONS pre-flight requests and allow caching for a week -- if ...The API headers to OPTIONS request use `Expires: 0`, effectively disabling caching:
![image](/uploads/479cfc0d8f70194be0c70b2a7653d237/image.png)
Please update response to OPTIONS pre-flight requests and allow caching for a week -- if the response is `200 OK`.2023.1Artem HrybeniukArtem Hrybeniukhttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/379Error when mounting two GG-CE on the same server2023-01-29T17:27:26+01:00James AriasError when mounting two GG-CE on the same server**Good Morning** @mobreza
To report that we have encountered a problem when mounting two **GG-CE** on the same server, previously in past versions (<= 2022.8.1) this error did not happen, in **CIAT-RED** it sent me the following error:
...**Good Morning** @mobreza
To report that we have encountered a problem when mounting two **GG-CE** on the same server, previously in past versions (<= 2022.8.1) this error did not happen, in **CIAT-RED** it sent me the following error:
**"maybe these locations are not writable or multiple nodes
were started without increasing [node.max_local_storage_nodes] (was [1])?"**
It is an error that is caused by **ElasticSearch**
Also, because of this error, apparently **GG-CE** is using all the server cores, and it is affecting all the **server performance**, even putting **GG-CE** in long waits in the requests showing the following error
![edd40a14-5f7c-482b-bc38-177aaf898e09](/uploads/64a5fee01698cf1e9433abf9585aea44/edd40a14-5f7c-482b-bc38-177aaf898e09.jpg)
Thank you very much for your attention
Regards2023.1Matija ObrezaMatija Obrezahttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/378Create Withdrawn Inventory2023-01-29T17:27:26+01:00James AriasCreate Withdrawn Inventory**Good Morning** @mobreza
The proposal is that when creating the WithdrawnInventory the system will show a modal to select the `inventory_maint_policy`.
This new way of creating the WithdrawnInventory would be extremely helpful, since...**Good Morning** @mobreza
The proposal is that when creating the WithdrawnInventory the system will show a modal to select the `inventory_maint_policy`.
This new way of creating the WithdrawnInventory would be extremely helpful, since the parent inventory (Inventory) can have a child inventory (WithdrawnInebntory) with a different purpose than its parent.
As shown in the following images
**Step1:** Creating the items
![1](/uploads/27e609955b3f777caaa3f3f74e624418/1.png)
**Step2:** The modal with a select (List `inventory_maint_policy`) and the previously selected inventories to create their respective WithdrawnInventory
![2](/uploads/e4a14aaf9d9f187c4e186cc0ae866733/2.png)
**Step3:** The WithdrawnInventory with its respective `inventory_maint_policy`
![3](/uploads/ccdc60a4acd33b61c8811eec8e8e06d5/3.png)
At this point it would be very helpful for us as we are going to perform the base monitoring orders with the end user and following the **INVENTORY RELATIONSHIP** diagram that we have developed in CIAT.
![image](/uploads/57f2d64562e57601465633889581d870/image.png)
Thank you very much for your attention
Regards2023.1Matija ObrezaMatija Obrezahttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/377Updating taxonomy2023-01-08T10:32:03+01:00Matija ObrezaUpdating taxonomyWe need to ensure that `TaxonomyXxxx` records that were sourced from GRIN Taxonomy (that's the ones with `grinId != null`) are not modified.
GGCE should not allow updating such records, but they can be removed if not referenced, since t...We need to ensure that `TaxonomyXxxx` records that were sourced from GRIN Taxonomy (that's the ones with `grinId != null`) are not modified.
GGCE should not allow updating such records, but they can be removed if not referenced, since they will be recreated at the next update of GRIN Taxonomy anyway.
We also need a new `SecurityAction` for `Taxonomy` that controls who may update `Taxonomy...` records.2023.1Artem HrybeniukArtem Hrybeniukhttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/376Unknown time-zone in AcceptHeaderLocaleTzResolver2023-01-04T15:04:11+01:00Matija ObrezaUnknown time-zone in AcceptHeaderLocaleTzResolverI spotted this error in the server logs:
```
09:44:12,926 qtp795372831-100 WARN AcceptHeaderLocaleTzResolver:74 - Unknown time-zone ID from request
java.time.zone.ZoneRulesException: Unknown time-zone ID: Europe/Kyiv
at java.time.zone...I spotted this error in the server logs:
```
09:44:12,926 qtp795372831-100 WARN AcceptHeaderLocaleTzResolver:74 - Unknown time-zone ID from request
java.time.zone.ZoneRulesException: Unknown time-zone ID: Europe/Kyiv
at java.time.zone.ZoneRulesProvider.getProvider(ZoneRulesProvider.java:279) ~[?:?]
at java.time.zone.ZoneRulesProvider.getRules(ZoneRulesProvider.java:234) ~[?:?]
at java.time.ZoneRegion.ofId(ZoneRegion.java:120) ~[?:?]
at java.time.ZoneId.of(ZoneId.java:408) ~[?:?]
at java.time.ZoneId.of(ZoneId.java:356) ~[?:?]
at org.gringlobal.application.resolver.AcceptHeaderLocaleTzResolver.resolveTimezone(AcceptHeaderLocaleTzResolver.java:72) ~[classes/:?]
at org.gringlobal.application.resolver.AcceptHeaderLocaleTzResolver.resolveLocaleContext(AcceptHeaderLocaleTzResolver.java:53) ~[classes/:?]
```
Please wrap in try-catch and log a warning message instead of full stack trace.2023.1Artem HrybeniukArtem Hrybeniukhttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/375Add helpers to the Inventory model for reporting purpose2023-01-18T15:16:05+01:00Juan Carlos Alarcon MaldonadoAdd helpers to the Inventory model for reporting purposeWe need to help users conveniently fetch data with new *helper methods*. These helper methods are not getters, they follow `reportXxxxYyyyy` notation.
Helpers:
- Pedigree of the accession. Accession_pedigree.description
- Country of ori...We need to help users conveniently fetch data with new *helper methods*. These helper methods are not getters, they follow `reportXxxxYyyyy` notation.
Helpers:
- Pedigree of the accession. Accession_pedigree.description
- Country of origin. Accession_source.geography.country_code
- Crop name: Crop.name
- Inventory name. Accession_inv_name.plant_name. For this case, if the inventory doesn't have a name associated, the inventory_id to be used must be the system inventory of the accession. if the user wants a specific name, he must specify the category_code and plant_name_rank.
maybe, this diagram can help to see the relations.
![image](/uploads/9795ae9e28894d11cdc1da78437e705b/image.png)2023.1Artem HrybeniukArtem Hrybeniukhttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/374Add helpers methods for Jasper reports2023-01-29T17:27:26+01:00Juan Carlos Alarcon MaldonadoAdd helpers methods for Jasper reportsJasperStudio is not very helpful in navigating the object model.
We need to help users conveniently fetch data with new *helper methods*. These helper methods are not getters, they follow `reportXxxxYyyyy` notation.
## `OrderRequest` h...JasperStudio is not very helpful in navigating the object model.
We need to help users conveniently fetch data with new *helper methods*. These helper methods are not getters, they follow `reportXxxxYyyyy` notation.
## `OrderRequest` helpers
For the documentation generated of an order, the country of the cooperator is requested.
Add a helper to the `OrderRequest` get the country code of :
- final_recipient_cooperator: `OrderRequest#reportFinalRecipientCountryCode()`
- ship_to_cooperator: `OrderRequest#reportShipToCountryCode() { return this.getShipToCooperator().getCountryCode() }`
- requestor_cooperator: `OrderRequest#reportRequestorCountryCode()`
- .... @jalarcon will define more
## `OrderRequestItem` helpers
- `OrderRequestItem#reportAccessionNumber() { return getInventory().getAccession().getAccessionNumber() }`
- `OrderRequestItem#reportAccessionName() { return getInventory().getAccession().getPreferredName() }`
- `OrderRequestItem#reportAccessionCollectCountryCode() { return getInventory().getAccession().getCollectingSource().getCountryCode() }`
- `OrderRequestItem#reportSourceInventoryNumber() { return getInventory().getInventoryNumber() }`
- `OrderRequestItem#reportWithdrawnInventoryNumber() { return getWithdrawnInventory().getInventoryNumber() }`
- .... @jalarcon will define more
The diagram can help to figure out the relationships:
![image](/uploads/b6c8aec185d476237624ef266e08a5c1/image.png)2023.1Artem HrybeniukArtem Hrybeniukhttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/373Add support for sorting by extra.lastViabilityResult and extra.mediaTypeCode2022-12-16T07:48:42+01:00Matija ObrezaAdd support for sorting by extra.lastViabilityResult and extra.mediaTypeCodeTrying to sort by `extra.lastViabilityResult` now returns `500` error with
> No property `lastViabilityResult` found for type `InventoryExtra`! Traversed path: `Inventory.extra`.
Please add support to sort by properties of `InventoryEx...Trying to sort by `extra.lastViabilityResult` now returns `500` error with
> No property `lastViabilityResult` found for type `InventoryExtra`! Traversed path: `Inventory.extra`.
Please add support to sort by properties of `InventoryExtra`.2023.1Artem HrybeniukArtem Hrybeniukhttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/372parentInventory cannot be a SYSTEM inventory2022-11-30T10:50:28+01:00Matija ObrezaparentInventory cannot be a SYSTEM inventoryAdd a liquibase SQL changelog that sets `inventory.parentInventory = null` when `inventory.parentInventory.formTypeCode = '**'`.
Add a `throw new DataIntegrityViolationException("Parent inventory cannot be a SYSTEM inventory")` to `Inve...Add a liquibase SQL changelog that sets `inventory.parentInventory = null` when `inventory.parentInventory.formTypeCode = '**'`.
Add a `throw new DataIntegrityViolationException("Parent inventory cannot be a SYSTEM inventory")` to `Inventory#prePersist()` for the same condition.2022.9Artem HrybeniukArtem Hrybeniukhttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/371Extending Inventory with extra data2022-12-06T09:45:43+01:00Matija ObrezaExtending Inventory with extra dataThe `inventory` table is the biggest in the database and while adding new columns directly to `Inventory` is the fastest (for development and querying), it can quickly become messy with columns that belong to specific types of inventorie...The `inventory` table is the biggest in the database and while adding new columns directly to `Inventory` is the fastest (for development and querying), it can quickly become messy with columns that belong to specific types of inventories only (and there's an endless list of those).
In an ideal world, we would have `SystemInventory extends Inventory`, `SeedInventory extends Inventory`, `CryoInventory extends Inventory`, etc. and then have inheritance by table joins. But we unfortunately cannot use `formTypeCode` as a `@Discriminator` because that would break compatibility with existing databases.
We are looking for a solution that will allow us to add "extra columns" used by only some inventories to some other table. Call it `InventoryExtra`. This table can eventually use inheritance (single table or join), but let's start without inheritance.
We would like to store the reference to the last finished viability in `InventoryExtra`:
```java
class InventoryExtra {
...
InventoryViability lastViability; // points to last viability test, can be null
}
```
We don't want to eager join inventory extra, we would probably use a separate endpoint that does a `left join` and returns joined results.
Users also are not able to modify `extra.lastViability`, it will be handled in the service implementation.
## Indexing
We include `InventoryExtra` in `prepareForIndexing` so it ends up in ES.
If `extra` changes, then Inventory must be reindexed, we can use `ElasticTrigger` for that.
## Unit testing
- Test adding `InventoryExtra` to an inventory
- Deleting `Inventory` must delete `InventoryExtra`
- Deleting `InventoryExtra` must not delete inventory
- Test that we can filter `Inventory` for `extra.lastViability.percentViable`
## Phase 2
An example for **phase 2** of an extra is `mediaTypeCode` which only applies to some inventories and can serve as an example of upgrading `InventoryExtra` to using inheritance:
```java
class TissueCultureExtra extends InventoryExtra {
@CodeValueField
String mediaTypeCode; // type of media used for tissue culture
}
```2022.9Artem HrybeniukArtem Hrybeniukhttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/370Bug: Reindex All ES does not reindex all?2022-11-21T17:45:21+01:00Matija ObrezaBug: Reindex All ES does not reindex all?I was upgrading hosted GGCE instances to the `2022.8.1` release and fixing some of the broken/outdated indexes.
When using the Reindex All, it appeared that only the first entity (usually `Site`) was indexed. Nothing else was logged aft...I was upgrading hosted GGCE instances to the `2022.8.1` release and fixing some of the broken/outdated indexes.
When using the Reindex All, it appeared that only the first entity (usually `Site`) was indexed. Nothing else was logged after the one table was finished.
Please validate that `reindexAll` ES indexes actually reindexes all entities.2022.8Artem HrybeniukArtem Hrybeniukhttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/369Easy-SMTA reporting2023-01-26T09:55:42+01:00Matija ObrezaEasy-SMTA reportingImplement reporting on distribution of SMTA materials to the Easy-SMTA system of the Secretariat of the International Plant Treaty.
## `reportToITPGRFA(OrderRequest)`
API calls to Easy-SMTA are usually done record-by-record and for eac...Implement reporting on distribution of SMTA materials to the Easy-SMTA system of the Secretariat of the International Plant Treaty.
## `reportToITPGRFA(OrderRequest)`
API calls to Easy-SMTA are usually done record-by-record and for each record, the response from the remote API needs to be stored in GGCE. We'll learn about the response model in genesys-pgr/glis-client#32 and decide if we add to `OrderRequest` or a new entity `OrderRequestITPGRFA` linked to it.
This method will eventually include data checks and throw relevant validation exceptions.
## `Page<OrderRequest + Extra> listForITPGRFA(OrderRequest filter, pageRequest)`
We need a method that lists existing `OrderRequests` that can be reported with Easy-SMTA. It will fetch `OrderRequests` for the filter (+page) and will then check each record if it is complete and ready to submit, or already submitted.
The `+ Extra` includes the validation data, status checks and data from previous Easy-SMTA registration. The user will then be able to select the rows to submit to ITPGRFA.
We first need to learn which fields are required in the API request and what data is returned.
Depends on:
- [x] genesys-pgr/glis-client#322023.1Artem HrybeniukArtem Hrybeniukhttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/368One-server cache engine2023-01-09T08:59:16+01:00Matija ObrezaOne-server cache engineWhen running GGCE in one-server configuration there is no need for Hazelcast (and its processing overhead). Please add support for a non-clustered Spring caching library (ehcache?).
The cache implementation is configurable in *.propert...When running GGCE in one-server configuration there is no need for Hazelcast (and its processing overhead). Please add support for a non-clustered Spring caching library (ehcache?).
The cache implementation is configurable in *.properties* file with key `cache.library` (and environment variable `CACHE_LIBRARY`).
Development should default to the current (hazelcast) caching.2023.1Artem HrybeniukArtem Hrybeniukhttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/367Startup: Warn about users without site2022-11-21T17:45:21+01:00Matija ObrezaStartup: Warn about users without siteWe currently add an admin alert message when there are users without a `Cooperator`.
![image](/uploads/c59627226b6479db8b9fe60ca993c003/image.png)
This needs to be updated to
1. Check only user accounts that are `active` and
2. Add ...We currently add an admin alert message when there are users without a `Cooperator`.
![image](/uploads/c59627226b6479db8b9fe60ca993c003/image.png)
This needs to be updated to
1. Check only user accounts that are `active` and
2. Add a new check that all active users have a cooperator with `site.isNotNull()`
There is a quirk in the CT: it requires that users are associated with a `Site`. When there is one with `site == null` all hell breaks loose.2022.9Artem HrybeniukArtem Hrybeniukhttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/366OAuth token API2022-12-29T15:24:53+01:00Matija ObrezaOAuth token APIAfter #361 is implemented, we'll need API endpoints for users to see and manage their tokens. Similarly, we'll want to see which tokens were issued for an `OAuthClient`.After #361 is implemented, we'll need API endpoints for users to see and manage their tokens. Similarly, we'll want to see which tokens were issued for an `OAuthClient`.2022.9Artem HrybeniukArtem Hrybeniukhttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/365Download file in repositories in not working2022-12-06T09:45:43+01:00Antonio RiveraDownload file in repositories in not workingThe download button is raising a 403 Forbidden.
![image](/uploads/e1dbf6fc8130d52c4351846375455c06/image.png)
![image](/uploads/786704da79bcae4bcdd4ee5f7e05e479/image.png)
Even if I assing all the permissions to an specific account th...The download button is raising a 403 Forbidden.
![image](/uploads/e1dbf6fc8130d52c4351846375455c06/image.png)
![image](/uploads/786704da79bcae4bcdd4ee5f7e05e479/image.png)
Even if I assing all the permissions to an specific account the error persists.
![image](/uploads/746e4797f808bca02b3d48e7457a1d5c/image.png)
Even if the owner user tries to download the file the error persists2022.9https://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/363Unzip feature is not working2022-09-28T13:57:19+02:00Antonio RiveraUnzip feature is not workingThe UNZIP button is raising a 400 error after upload a zip file
![image](/uploads/2ed7fdbb3ecf4519419b2a8b28dd8ee2/image.png)
Error ramains even after refresh the window: using the browser command or using the refresh command
![image]...The UNZIP button is raising a 400 error after upload a zip file
![image](/uploads/2ed7fdbb3ecf4519419b2a8b28dd8ee2/image.png)
Error ramains even after refresh the window: using the browser command or using the refresh command
![image](/uploads/9053490d71b3e9deacde87c6cdd75dd1/image.png)
![image](/uploads/479c64faf2b001ad61d70a35566a0bf0/image.png)
All permissions are assigend to the account
![image](/uploads/bf743637fd0bdf2e2a35266b9acfcc0f/image.png)
The problem could be in the query param?
![image](/uploads/93b2a85ce4e4559342fd768431b01848/image.png)2022.8Matija ObrezaMatija Obrezahttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/361OAuth Revoke and Logout2023-01-03T12:35:56+01:00Matija ObrezaOAuth Revoke and LogoutWe need to test the revoking of issued OAuth tokens (https://docs.spring.io/spring-authorization-server/docs/current/reference/html/protocol-endpoints.html#oauth2-token-revocation-endpoint) and instructions for UI what API call to make.
...We need to test the revoking of issued OAuth tokens (https://docs.spring.io/spring-authorization-server/docs/current/reference/html/protocol-endpoints.html#oauth2-token-revocation-endpoint) and instructions for UI what API call to make.
Please test the current implementation and provide feedback on how UI can properly log out authorized clients.
Related to grin-global/grin-global-ui#4732023.1Artem HrybeniukArtem Hrybeniuk