nens / threedi-api-qgis-client

3Di Models & Simulations plugin
https://plugins.lizard.net/
Other
2 stars 0 forks source link

Inherit simulation templates from previous 3Di model #529

Closed leendertvanwolfswinkel closed 2 months ago

leendertvanwolfswinkel commented 6 months ago

The endpoint /v3/schematisations/{schematisation_pk}/revisions/{id}/create-threedimodel/ has an argument inherit_from_previous_revision.

Change page 3 of the Upload wizard

When user clicks "Start upload":

leendertvanwolfswinkel commented 5 months ago

Feedback:

hoanphungt commented 5 months ago

@leendertvanwolfswinkel I updated the threedi-api wheel and fixed your comments. Could you test it again?

leendertvanwolfswinkel commented 4 months ago

@hoanphungt I tested it again (on staging), but unfortunately I get a new error: image.png

hoanphungt commented 4 months ago

The error: Could not copy simulation template ... to threedimodel ... due to Bad Request is apparently a backend issue. @daanvaningen is working on it.

daanvaningen commented 4 months ago

yesterday I created a production hotfix to (hopefully) solve this. We think it's a timing issue in the worker. Can you please check if the hotfix worked?

hoanphungt commented 4 months ago

@daanvaningen it seems to work for me now:

Screenshot from 2024-04-10 10-47-27

leendertvanwolfswinkel commented 4 months ago

@hoanphungt My test was less successful :( image.png

hoanphungt commented 4 months ago

@leendertvanwolfswinkel It said "Internal server error while trying to trigger simulation-template clone.", so I don't think it's a problem with the plugin.

hoanphungt commented 4 months ago

I tested it again. Something happened in the backend and sometimes it works, sometimes not. Maybe @daanvaningen can take a look further to see what goes wrong here.

daanvaningen commented 4 months ago

hotfixed it on prod, can you please check again?

hoanphungt commented 4 months ago

@daanvaningen I still got the same error, but it's a TypeError in sentry:

https://nens.sentry.io/issues/5203987391/?project=1496858&query=is%3Aunresolved&referrer=issue-stream&statsPeriod=90d&stream_index=0

daanvaningen commented 4 months ago

Ah I thought you could do asyncio.sleep(None) but this gives a type error. Although I also wonder why the ThreediModel has not become valid in the meantime.. I hotfixed the error op production

hoanphungt commented 4 months ago

@leendertvanwolfswinkel can you test again? I tested again but run into an exception that the threedimodel is not valid: https://nens.sentry.io/issues/5205286351/?project=1496858&query=is%3Aunresolved&referrer=issue-stream&statsPeriod=90d&stream_index=0

Could not inherit simulation templates because ThreediModel is not valid

Although, for this schematisaion: bug_raster_exists, it created a new 3di model successfully.

daanvaningen commented 4 months ago

I've found the issue: inherit simulation templates task is dependent on a valid threedimodel, but this is not explicitly stated so in our task logic: The completion of the make geojson task is needed for a valid threedimodel but the inherit simulation template task is not directly linked to it. So if the geojson task takes too long the inherit task can't complete. I will let you know when I have a fix

daanvaningen commented 4 months ago

hotfixed it on prod. Should trigger the task now after a valid threedimodel, which should fix the aforementioned bug

hoanphungt commented 4 months ago

@daanvaningen It's working now. Thanks for the fix :)