Bug 893959 - Disable Gadgets that needs internet connection
Summary: Disable Gadgets that needs internet connection
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: JBoss Enterprise Portal Platform 6
Classification: JBoss
Component: Portal
Version: unspecified
Hardware: All
OS: All
medium
medium
Target Milestone: ER03
: 6.1.0
Assignee: Nobody
QA Contact: vramik
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-01-10 11:08 UTC by Martin Weiler
Modified: 2025-02-10 03:27 UTC (History)
4 users (show)

Fixed In Version:
Clone Of: 841343
Environment:
Last Closed: 2025-02-10 03:27:14 UTC
Type: Enhancement
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker GTNPORTAL-2518 0 Major Resolved Shindig startup issue when there's no internet connection 2016-05-23 10:16:03 UTC

Description Martin Weiler 2013-01-10 11:08:52 UTC
Description of problem:

JPP 6 comes with some samples Gadgets. Some gadgets tries to access the internet which leads to errors when starting JPP. This is known and we have a procedure to solve this (for 5.2) [1], but the goal of this request is to remove/disable these gadgets from future JPP releases, as the workaround is quite cumbersome. One alternative is to make these Gadgets optional, not enabled by default.

[1] https://access.redhat.com/knowledge/solutions/62004

Comment 1 Thomas Heute 2013-01-10 11:52:54 UTC
Is it only the currency one ?

Comment 2 Martin Weiler 2013-01-10 12:35:01 UTC
Yes, it's the currency one. 

But in addition, there are also attempts to load the following javascript files:

http://www.google-analytics.com/urchin.js
http://www.google.com/ig/lib/libanalytics.js
http://www.google.com/ig/lib/libga.js

These are defined in the shindig features, as described here:
https://access.redhat.com/knowledge/node/68308

Comment 3 Adam Kovari 2013-01-10 12:38:49 UTC
In EPP 6 it is in jboss-jpp-6.0/modules/org/gatein/lib/main/shindig-features-2.0.2.Final-gatein-3-redhat-1.jar but this JAR is signed.

Comment 4 Thomas Heute 2013-01-10 12:47:08 UTC
Adam, what makes you think it's signed ? I don't see it signed in my package (and it shouldn't be in 6.0)

I think it's quite risky to alter feature jar now (too late for ER5 and next release is a CR). 

Maybe we can remove the currency gadget now (for CR1) this would have to be properly tested though so we need PM, PMM and QA approval. 

We can deactivate the JS loading of those files in 6.1 (People can re-enable them if needed) that seems more risky and we need to see if there is a better way but altering Shindig. (Ideally we would just have that feature.xml file within the portal, not in Shindig)

Comment 5 Thomas Heute 2013-01-10 12:47:29 UTC
features.txt I meant

Comment 6 Adam Kovari 2013-01-10 12:53:15 UTC
Ah, sorry Thomas, you're right, it's not signed. I don't know where I was looking...
Martin, what do you think about removing the currency gadget?

Comment 7 Martin Weiler 2013-01-10 13:15:46 UTC
+1 for providing features.txt outside of the shindig*.jar

Removing the currency gadget is unrelated to the js loading caused by shindig. If it's too late for 6.0, then we should provide an easy way to (optionally) disable both (gadget + shindig features) in 6.1.

Comment 8 Thomas Heute 2013-01-10 13:34:18 UTC
What I'm proposing is that we remove currency gadget now (so that we don't remove that "feature" in a minor release) and check the other issue carefully for next release.

We have to see the risks of doing so but that seems doable and not too dangerous for CR1. At least that would be less steps for customers...

Comment 9 Thomas Heute 2013-01-24 12:35:57 UTC
Pushed to 6.1

Comment 10 Boleslaw Dawidowicz 2013-04-18 09:23:15 UTC
Setting for 6.1.0 and assigning to keep track but we need to discuss and decide how and if to do it now.

Comment 11 JBoss JIRA Server 2013-04-24 13:46:26 UTC
Matt Wringe <mwringe> made a comment on jira GTNPORTAL-2518

Is there any update on this?

Comment 12 Matt Wringe 2013-05-28 17:46:42 UTC
An update on this, the currency gadget is no longer included.

The rss reader gadget obviously doesn't work by default since the default rss url is an external one (http://feeds.feedburner.com/gatein). The gadget itself displays an error message about not being able to access this url. There is a warning in the logs about not being able to access this url.

There is still some warning messages in the logs about not being able to access some javascript files from google url which is what is mentioned in https://access.redhat.com/site/node/68308.

There are no stack traces or errors in the logs about this, only warnings.

Are warnings really that bad in this situation? As far as I can tell the missing javascript warnings are due to optional features available in shindig.

In order to get rid of the warnings we would need to modify the shindig component. But I don't know if its worth trying to remove the warnings in this situation.

Comment 13 Boleslaw Dawidowicz 2013-05-28 18:09:31 UTC
Martin, could you look at this again and comment what would be desired outcome at this point? You can test current status with DR1 build that I shared recently.

Comment 14 Thomas Heute 2013-05-28 18:13:37 UTC
I would say that Warning is ok, Martin ?

Comment 15 Martin Weiler 2013-05-30 07:18:14 UTC
I raised this initially to give users a chance to easily configure shindig, so that no calls to google urls happen during startup.

If I test DR1 after disabling internet connection, I can see that the google lookup fails immediately:
08:58:30,044 INFO  [org.apache.shindig.gadgets.http.BasicHttpFetcher] (ServerService Thread Pool -- 52) Timeout for http://www.google-analytics.com/urchin.js Exception: java.net.UnknownHostException - www.google-analytics.com - 55ms
327:08:58:30,224 WARNING [org.apache.shindig.gadgets] (ServerService Thread Pool -- 52) Unable to retrieve remote library from http://www.google-analytics.com/urchin.js

This wouldn't be a problem IMO.

BUT, a customer reported that in their server environment, the startup of JPP 6.0.0 was delayed by 30 seconds for each failing google lookup:

11:12:58,041 INFO  [org.apache.shindig.gadgets.http.BasicHttpFetcher] (MSC service thread 1-2) Got Exception fetching http://www.google-analytics.com/urchin.js - 30095ms: org.apache.http.conn.ConnectTimeoutException: Connect to www.google-analytics.com/173.194.78.102:80 timed out
	at org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:125)
...
11:12:58,042 WARNING [org.apache.shindig.gadgets] (MSC service thread 1-2) Unable to retrieve remote library from http://www.google-analytics.com/urchin.js

This long blocking lookup was the reason for opening this bug, and therefore I think we cannot just ignore the warning.

Comment 16 Thomas Heute 2013-05-30 07:50:01 UTC
Good point, 30s delay is the issue to solve now that no ERROR are present anymore.

Comment 17 Matt Wringe 2013-05-30 13:05:44 UTC
So, how do I check this 30 second delay? It fails quickly on my machine.

Comment 18 Martin Weiler 2013-05-31 11:43:48 UTC
I could not reproduce this either, after disabling network access the google lookup failed quickly with an UnknownHostException. The customer was running into a ConnectTimeoutException after 30secs instead.

Comment 19 JBoss JIRA Server 2013-06-07 08:05:44 UTC
Trong Tran <trongtt> updated the status of jira GTNPORTAL-2518 to Coding In Progress

Comment 21 JBoss JIRA Server 2013-06-28 04:46:08 UTC
Trong Tran <trongtt> made a comment on jira GTNPORTAL-2518

I have sent a PR https://github.com/gatein/gatein-portal/pull/546 to solve the problem with following changes :

1. Support to be able to configure shindig.properties as an external configuration file by setting the location path via {gatein.gadgets.dir} property. Of course, It sill be kept backward compatibility if the property is NOT set.

2. Splitting the default features.txt into two files : default-features.txt and online-features.txt. So customers can ignore online-features.txt if they want to run product in offline mode.

Please let me know if I missed something.

Comment 22 Boleslaw Dawidowicz 2013-06-28 08:16:58 UTC
Merged. Matt could you look at documenting this and close?

Comment 23 Matt Wringe 2013-07-05 19:39:35 UTC
Documentation added at https://docs.jboss.org/author/display/GTNPORTAL36/Shindig+Configuration.

It just requires modifying one line of a new shindig configuration file.

Comment 24 JBoss JIRA Server 2013-07-19 03:38:54 UTC
H. Trang Vu <trang.vu> made a comment on jira GTNPORTAL-2518

This commit should be included into gatein-3.5.x for eXo Platform 4.0.

Comment 25 vramik 2013-10-07 15:03:13 UTC
Hi,

I've tried to start portal without internet connection and I can see 

16:52:57,090 INFO  [org.apache.shindig.gadgets] (ServerService Thread Pool -- 55) Loading resources from: res:features/features.txt
16:52:57,146 INFO  [org.apache.shindig.gadgets.http.BasicHttpFetcher] (ServerService Thread Pool -- 55) Timeout for http://www.google-analytics.com/urchin.js Exception: java.net.UnknownHostException - www.google-analytics.com - 34ms

16:52:57,207 WARNING [org.apache.shindig.gadgets] (ServerService Thread Pool -- 55) Unable to retrieve remote library from http://www.google-analytics.com/urchin.js
16:52:57,208 INFO  [org.apache.shindig.gadgets.http.BasicHttpFetcher] (ServerService Thread Pool -- 55) Timeout for http://www.google.com/ig/lib/libanalytics.js Exception: java.net.UnknownHostException - www.google.com - 1ms
16:52:57,208 WARNING [org.apache.shindig.gadgets] (ServerService Thread Pool -- 55) Unable to retrieve remote library from http://www.google.com/ig/lib/libanalytics.js

16:52:57,347 INFO  [org.apache.shindig.gadgets.http.BasicHttpFetcher] (ServerService Thread Pool -- 55) Timeout for http://www.google.com/ig/lib/libga.js Exception: java.net.UnknownHostException - www.google.com - 1ms
16:52:57,347 WARNING [org.apache.shindig.gadgets] (ServerService Thread Pool -- 55) Unable to retrieve remote library from http://www.google.com/ig/lib/libga.js

so in my environment this is very minor delay at startup. Then I've edited $JBOSS_HOME/standalone/configuration/gatein/gadgets/shindig.properties according to https://docs.jboss.org/author/display/GTNPORTAL36/Shindig+Configuration and have tried to start the portal again. I can still see the WARNINGs in log. I suppose this is expected but can you tell if/how can I verify whether the change in the shindig.properties fix the longer delay?

Thanks 
Vlasta

Comment 26 Adam Kovari 2013-10-07 15:27:43 UTC
Hi Vlasta,

I don't remember exactly but I found we recommended editing features.txt file directly: https://access.redhat.com/site/solutions/68308

2. jar -xvf shindig-features-VERSION.jar features

3. Open features/features.txt with a text editor

4. Comment / Remove the following two lines:

#features/analytics/feature.xml
#features/com.google.gadgets.analytics/feature.xml

5. Save file

6. jar -uvf shindig-features-VERSION.jar features


Hope this helps.

Adam

Comment 27 vramik 2013-10-09 10:31:22 UTC
Thanks Adam,

I've followed the steps from https://access.redhat.com/site/solutions/68308 and now I cannot see the WARNINGs in log. 

I suppose this should be documented.

Vlasta

Comment 28 Martin Weiler 2014-02-21 15:53:53 UTC
In JPP 6.1.x, this should be fixed by changing the configuration setting in configuration/gatein/gadgets/shindig.properties:

# Location of feature manifests (comma separated)
# Default settings - require internet access
# shindig.features.default=res://features/default-features.txt,res://features/online-features.txt
# Features not requiring internet access
shindig.features.default=res://features/default-features.txt

But it does not appear to work. I will perform further tests, and might open a new BZ.

Comment 31 Red Hat Bugzilla 2025-02-10 03:27:14 UTC
This product has been discontinued or is no longer tracked in Red Hat Bugzilla.


Note You need to log in before you can comment on or make changes to this bug.