Publish Error

Post Reply
shivs
Posts: 2
Joined: 24 Jan 2023, 22:36

I am new to Essential OS. I installed Tomcat via the windows installer and using a single, local instance of Essential on my machine. When I go to publish , I get the error, "Failed to send snapshot to the Report Service : No response from the Report Service at this URL."" Appears this may be happening as I do not have write permissions on the essential__viewer directory under webapps in the tomcat installation folder, but I cannot work out how to change this. Can someone please let me how to get around this issue? Thanks
User avatar
neil.walsh
Posts: 445
Joined: 16 Feb 2009, 13:45
Contact:

Hi,

Is your Essential Viewer WAR file in the Tomcat "webapps" folder called essential_viewer.war or essential_viewer_6162.war?

The name of this file determines the URL you should use in Protege when publishing.

You can either:

1. Rename the WAR file to essential_viewer.war in which case the URL in Protege for publishing will be http://localhost:8080/essential_viewer
or
2. Leave the WAR file as essential_viewer_6162.war in which case the URL in Protege for publishing will be http://localhost:8080/essential_viewer_6162

Also, it's work checking if Tomcat is running correctly.
Do you see a Tomcat page when visiting http://localhost:8080/ ?
Can you access Viewer in the browser on http://localhost:8080/essential_viewer ( or http://localhost:8080/essential_viewer_6162)?

If not, you will need to start up Tomcat.

Let me know how you get on

Cheers

Neil
shivs
Posts: 2
Joined: 24 Jan 2023, 22:36

Hi Neil,
Thanks for your response. My setup is exactly as you stated with the essential_viewer.war file placed in the webapps directoty, tomcat runnning and able to access the views via localhost. However, when trying to publish changes using Essentiual Update, I get the error stated. As mentioned, I believe the error is because I do not write permissions on the Tomcat-WebApps program folder in windows. Any other suggestions?
Thank you.
User avatar
neil.walsh
Posts: 445
Joined: 16 Feb 2009, 13:45
Contact:

Where on your file system is Tomcat located (i.e. what's the path)? Is it somewhere that's writable without Admin rights?

On Windows, some folders require special rights (such as "Program Files"). Also OneDrive folders can cause permissions issues if syncing with another computer (usually ok if just syncing with Cloud).

A good place might be your "Documents" folder to which your user would have full rights. Alternatively, you could look at changing the access rights to the web apps folder but this is a more advanced approach.

Also, can I just check you have mis-typed.... You are trying to Publish using the "Essential Viewer" tab and not the "Essential Update" tab, correct?
xiaoqi
Posts: 128
Joined: 09 Feb 2023, 03:33

Hello,

Today I install Essential OS in new Windows laptop, the local TomCat is up and running, the URL: http://localhost:8080/essential_viewer_ ... LABEL=Home can display the correct initial viewer page. But I keep get this publish error.

Could you help to give me some hints on where can be other reason? Thanks.

Regards, Xiaoqi
You do not have the required permissions to view the files attached to this post.
User avatar
neil.walsh
Posts: 445
Joined: 16 Feb 2009, 13:45
Contact:

Are you seeing any errors either in the Tomcat logs (either catalina.out, catalina.somedate or essential-viewer.log)?
Are there any errors in the terminal/command prompt with any further details?
xiaoqi
Posts: 128
Joined: 09 Feb 2023, 03:33

Hi Neil,

Hope I can use the attached diagram to explain my case, it's kind of complexity since I think I may miss something when do package migration which causing now the publishing error.

In short, I have one old laptop before and build the repository initially (the top block), it is working well to publish to the viewer in both my local Tomcat as well as the remote Tomcat (the middle block) which is one Windows server (running in VMWare). The viewer was in v6.16 and I had upgraded it to v6.18 recently and it's no error during upgrading.

I had some customized code + view files added into the Viewer folder, that's also working OK, until one day I started to face Java Heap Size error when I try to publish, after variable testing, I realize that's the physical 16GB RAM limitation and cannot be solved on the local laptop.

So, I tried the workaround while waiting for new laptop with more RAM, which was I RDP to the Windows Server, use the Protege in the server and publish the work to the server's local Viewer, that's works, and also I can publish from server's Protege (not server version, but run Protege locally in server, still single user mode) back to my old laptop's Tomcat viewer. Those green "success" lines.

Then, now the troublesome things I'm facing is on the bottom's new laptop, I've installed single user package of Protege, configured Tomcat and it's working to have the publishing to the empty viewer with empty project. But all kind of publish with my actual project to the viewer folder are failed.

According to make the viewer folder available in my new laptop's Tomcat, I tried below two ways:

1. Directly copy and past the Viewer folder from current working server's Tomcat folder to new laptop's folder, which having all my customizations together.
2. Copy the original WAR file from server Tomcat folder to new laptop's Tomcat folder, after Tomcat extracting the WAR, then overwrite the customized files with mine version

But neither way success.

What's your recommendation or comments on that? Hope I made my case clear, it would be great if we can have the onine connection so that I can demo what's the error message to you lively.

Thanks greatly,
Xiaoqi
You do not have the required permissions to view the files attached to this post.
User avatar
neil.walsh
Posts: 445
Joined: 16 Feb 2009, 13:45
Contact:

Hi,

I guess the key aspect of the error message is that it isn't saying "publish failed" but rather it is saying "no response". This typically means that Protege cannot connect to the Essential Viewer application in Tomcat.

Before I proceed though, can I check you are definitely running Java 8 and Tomcat 8.5/9? No other versions are compatible at this time.

Focusing just on the new PC with 64GB of RAM (ignore the other machines for the moment as that introduces possible network/firewall issues), I'd start troubleshooting as follows:
(I'd follow this even if you feel you know the steps. It should help you spot what's gone wrong.)

Feel free to share any log files (or snippets) here for review.

1. Open the tomcat web apps folder and check the name of the essential viewer web app. For example, is it essential_viewer or essential_viewer_6181 or something else? Are they folders or WAR files? If they are WAR files but not folders, this means Tomcat hasn't started properly or isn't deploying the WARs and you need to check the Tomcat logs for errors. If they are folders, then move to step 2.

2. Open your browser and navigate to http://localhost:8080/THE_WEB_APP_NAME (as you saw in step 1). Browse about just to check you're not seeing some cached version. This should validate that Tomcat is running successfully and you have confirmed the name of the web app. If this fails, then you're back to checking is Tomcat running or are there errors in the Tomcat logs. If you can see Viewer in the browser then onto step 3.

3. Open Protege (on the same machine) and load your project. Check the terminal/command prompt for any Protege loading errors.

4. Go to the Essential Viewer tab in Protege and check the URL for the publish. It should be exactly the same as in step 2, http://localhost:8080/THE_WEB_APP_NAME . Double check this, as this is the most likely cause of the issue you are seeing. Though it shouldn't matter, I would make sure to remove any trailing slashes or spaces at the end of the URL just in case there are any hidden characters causing an issue.

5. Make sure the "send graph images" button is unchecked and click the "Publish Repository" button. Does this work? If not, what error message do you get now? Is it "Publish Failed" or "No Response". The logs for the publish process can be found in the Protege folder or on the command prompt/terminal.

Let me know what you find.

Best,

Neil
xiaoqi
Posts: 128
Joined: 09 Feb 2023, 03:33

Thanks greatly Neil, yes, you catch the point.

I've troubleshot with my colleague and he also found the issue was due to setting in Tomcat, see following log:

10-Jul-2023 13:50:45.093 SEVERE [http-nio-8080-exec-3] org.apache.coyote.AbstractProtocol$ConnectionHandler.process Failed to complete processing of a request
java.lang.OutOfMemoryError: Java heap space

My Tomcat is v9 which is recommended in our installation guide, but for this new PC, I forget to set larger Java heap size in Tomcat, default is 256, after I change this and keep all 3 environment to 1024 (see attached diagram), now the publishing is working.

Lessons learnt from that in my view:
1. Protege: when installing, use the system JVM, so that Protege and Tomcat are using same Java VM version, which will be easier for troubleshooting if any
2. Protege setting need to have Java heap size set as 2048000000
3. Tomcat need to set Java max heap size to 1024

Sorry for making this troublesome, I'll also taking notes of your five steps as guide for future issue investigating, for now, I can continue my modeling work ;-)

Nice day,
Xiaoqi
You do not have the required permissions to view the files attached to this post.
User avatar
neil.walsh
Posts: 445
Joined: 16 Feb 2009, 13:45
Contact:

Hi Xiaoqi,

I'm delighted to hear you have this working.

For future reference, we have an Essential University page which covers the memory settings for Essential. You may need to review the settings as your repository grows.
https://university.enterprise-architect ... ing-memory

Cheers,

Neil
jason.muscat
Posts: 5
Joined: 08 Jul 2023, 20:43

Hi Neil, Xiaoqi,

Thanks for both of your posts. I too was experiencing some issues with the Setup and following this helped me to rectify all my issues.

Jason
xiaoqi
Posts: 128
Joined: 09 Feb 2023, 03:33

Got it Neil, will refer the page and keep monitoring the repository. Now it's already having 17K+ instances, and I'll try to keep increase both heap size and get the good-enough settings.
xiaoqi
Posts: 128
Joined: 09 Feb 2023, 03:33

Hello,

My viewer publishing have run smoothly after I've moved to this 64GB RAM machine, with proper Java Heap Size setting in both Protege and Tomcat side.

But today, I got below error again,

Code: Select all

Rendering repository...
Sending repository snapshot...
Checking for access...
Sending XML snapshot...
Exception encountered during send
Failed to send snapshot to the Report Service : 
No response from the Report Service at this URL.
I login to the server that viewer is located, and found below two errors in the "essential-viewer" log file under Tomcat logs folder:

Code: Select all

2023-09-28 10:03:20,897 | ERROR | No login server OAuth Token url defined. Make sure to set the loginService.oauth.token.url property in the property file /WEB-INF/security/.authn-server/authn-server.properties | : | ValidateOauthBearerToken.java | 97
2023-09-28 10:03:20,897 | ERROR | No login server API key defined. Make sure to set the loginService.apiKey property in the property file /WEB-INF/security/.authn-server/authn-server.properties | : | ValidateOauthBearerToken.java | 101
Now I cannot publish to this remove server's viewer, while I can still publish to my local host view without error.

Any hints? Thanks a lot.
Xiaoqi
User avatar
neil.walsh
Posts: 445
Joined: 16 Feb 2009, 13:45
Contact:

Have you changed/updated Viewer at all? If so, which version and where did you download from - GitHub or our Website?
xiaoqi
Posts: 128
Joined: 09 Feb 2023, 03:33

I recently upgrade viewer 6.18.9 from our website and upgraded.
xiaoqi
Posts: 128
Joined: 09 Feb 2023, 03:33

It's really strange this time, below are some more testing I've done:

- it's not all the time cannot publish, some seldom times it's just "successful". but most of the time it's error.
- the URL is working when opening in browser, Tomcat is running without problem

When it's failed publish, I've tried below scenarios but no help:

1. publish from my PC to remote server viewer URL --> failed
2. copy project file to remote server, run Protege on server and do publish to localhost viewer URL --> failed
3. restart Tomcat, either remote or server local --> failed

I notice in the Protege console, looks like when the "No response" error message pop up, there's one new warning added in the concole:

Code: Select all

WARNING: Invalid cookie header: "Set-Cookie: essential_viewer.i18n=en-gb; Max-Age=31535000; Expires=Sat, 28 Sep 2024 01:56:52 GMT; Path=/". Invalid 'expires' attribute: Sat, 28 Sep 2024 01:56:52 GMT -- ResponseProcessCookies.processCookies()
But I don't know how this could be the reason, hope this give you some more information.

Thanks,
Xiaoqi
xiaoqi
Posts: 128
Joined: 09 Feb 2023, 03:33

Further troubleshooting try with following steps, but still no help:

1. I've stopped the Tomcat in server side, delete the current Viewer folder;
2. then from the downloaded "essential_viewer_6187.war", rename it to my model's viewer name;
3. copy the war file to server's webapps folder
4. Start Tomcat in server, and the WAR file is identified and extracted to the folder with the needed name
5. Try to do the publish, first time failed, 2nd time success, but from 3rd time keep failure

I also need to copy my customized elements and views to the new folders to show my own contents, but that is not changing the URL I think.

The big part I cannot understand is why in seldom chance it can be successful. Now every time I need to prey for the result ;-)

Must somewhere I have missed check, need your help!

Regards, Xiaoqi
xiaoqi
Posts: 128
Joined: 09 Feb 2023, 03:33

Hi there,

update my current status, after following steps, the viewer is now published successfully --

1. Login to remote server.
2. Stop TomCat
3. Delete all war files and extracted folders in webapps folder
4. Use the latest downloaded viewer war, rename to my target name, copy to webapps folder
5. Wait for war file auto-extracted to folder
6. Test publishing, it's working
7. Add all customized components (files, views) to overwrite the default files
8. Test publishing again, still working

So I suspect there's something wrong in the previous extracted folder which have certain wrong meta-data relating to URL, just guess.

Thanks,
Xiaoqi
Post Reply