archimatetool / archi-modelrepository-plugin

coArchi - a plug-in to share and collaborate on Archi models.
154 stars 53 forks source link

CommandLine HTML report - Model had unresolved objects! #202

Closed jmonsel closed 1 year ago

jmonsel commented 1 year ago

We generate HTML report from Commandline on Linux and it return an error :

##############

Execute Archi with _args: --modelrepository.loadModel /opt/Octopia_Model/ --html.createReport /opt/Octopia_Model/report/ (java:57): dbind-WARNING **: 15:46:43.677: AT-SPI: Error retrieving accessibility bus address: org.freedesktop.DBus.Error.ServiceUnknown: The name org.a11y.Bus was not provided by any .service files [LoadModelFromRepositoryProvider] Loading model at /opt/Octopia_Model java.io.IOException: Model had unresolved objects! at org.archicontribs.modelrepository.commandline.LoadModelFromRepositoryProvider.loadModel(LoadModelFromRepositoryProvider.java:166) at org.archicontribs.modelrepository.commandline.LoadModelFromRepositoryProvider.run(LoadModelFromRepositoryProvider.java:153) at com.archimatetool.commandline.CentralScrutinizer.runProviderOptions(CentralScrutinizer.java:164) at com.archimatetool.commandline.CentralScrutinizer.start(CentralScrutinizer.java:82) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:402) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.base/java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:596) at org.eclipse.equinox.launcher.Main.run(Main.java:1467) at org.eclipse.equinox.launcher.Main.main(Main.java:1440) java.io.IOException: Model was not loaded at com.archimatetool.reports.commandline.HTMLReportProvider.run(HTMLReportProvider.java:66) at com.archimatetool.commandline.CentralScrutinizer.runProviderOptions(CentralScrutinizer.java:164) at com.archimatetool.commandline.CentralScrutinizer.start(CentralScrutinizer.java:82) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:402) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.base/java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:596) at org.eclipse.equinox.launcher.Main.run(Main.java:1467) at org.eclipse.equinox.launcher.Main.main(Main.java:1440) ##############

This error appears only on one specific Archimate model. We have 3 others archimate models we are able to generate HTML report from command line with no issue

Version of Archi

Either archimate 4.10.0 or 4.9.3

Archi Plug-ins

coarchi 0.8.7 but I'm not plugIn is involved in that case

Operating System

either Linux debian11 or ubuntu 18.04

Expected Behaviour

Html report successfully generated

Actual Behaviour

See error message above

Steps to Reproduce the Behaviour

I'm sorry, I can not share model due to confidentiallity issue

Thank you

Phillipus commented 1 year ago

I've moved this to the archi-modelrepository-plugin (coArchi) issue tracker as the problem is occuring in coArchi not the report generation logic:

java.io.IOException: Model had unresolved objects!
at org.archicontribs.modelrepository.commandline.LoadModelFromRepositoryProvider.loadModel(LoadModelFromRepositoryProvider.java:166)

To diagnose this, you should try to work with the model in coArchi and not the command line. Can you work with the model? Can you commit and push? It may be that the model in the target folder is not fully up to date.

jmonsel commented 1 year ago

I'm not sure understand... "....work with the model in coArchi"... do you suggest me to work with the model stored into git repo ?

Phillipus commented 1 year ago

do you suggest me to work with the model stored into git repo ?

Yes. I mean to use the model in Archi and not the Command line.

How did you get the model located at /opt/Octopia_Model? Did you manually clone it? Or did you clone it in Archi?

jmonsel commented 1 year ago

OK, thank you so here is the status : saving model locally is OK, committing is OK, ...and publishing is OK...however I'm working on a "Main" branch that is not the branch used in command line...

Phillipus commented 1 year ago

The model state is probably out of sync. How did you get the model located at /opt/Octopia_Model? Did you manually clone it? Or did you clone it in Archi? Try cloning it again and re-importing.

jbsarrodie commented 1 year ago

In addition, make sure that no merges have been donne on thé model outsider Archi itself (reminder: git commands should not be run on a model managed by Archi or this could lead to some corruption)

jmonsel commented 1 year ago

OK, I guess you're right as I cannot sware no one execute git command outside Archi. I have to define policies avoiding this. So would close the issue

Phillipus commented 1 year ago

If you are going to use the CLI it's better to clone the repo into an empty target folder and then load it into a model to generate the report. This ensures you are getting the correct model. So the full command args would be:

--modelrepository.cloneModel "https://github.com/somewhere/myrepo.git"
--modelrepository.loadModel "pathto/afolder"
--modelrepository.userName "UserName"
--modelrepository.passFile "pathto/password.txt"
--html.createReport "pathto/report"
jmonsel commented 1 year ago

OK, thank you again for all your advise

Phillipus commented 1 year ago

In fact you can generate a report directly from the temp.archimate file in the repository location:

--loadModel "pathto/repository/.git/temp.archimate"
--html.createReport "pathto/report"