Uploaded image for project: 'Red Hat Fuse'
  1. Red Hat Fuse
  2. ENTESB-1558

Fabric Maven Repo ignores proxy.nonProxyHosts setting for newly mvn:deploy'ed artifacts

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • jboss-fuse-6.2
    • jboss-fuse-6.1
    • None
    • None
    • % %
    • Hide

      How to reproduce.

      Two boxes will be required:

      • Hosting apache forward proxy (in my example - wuxiaohui-proxy its ip is 10.66.218.42)
      • Hosting FUSE fabric (in my example xiwu-fuse6-fabric its ip is 10.66.218.148)

      The idea is that forward proxy is behind firewall, so the only connections permitted are those FROM fabric TO proxy. Proxy is not permitted to establish new connections back to the fabric node.

      wuxiaohui-proxy - Apache Proxy

      install httpd.

      Create /etc/httpd/conf.d/proxy.conf:

      ----------------

      Listen *:9001
      LogLevel Info
      
      <IfModule mod_proxy.c>
      ProxyRequests On
      ProxyVia On
      AllowCONNECT 443
      AllowCONNECT 80
      <Proxy *>
          Order deny,allow
          Deny from all
          Allow from all
      </Proxy>
      </IfModule>
      

      ----------------
      Execute:

      setenforce 0
      service iptables stop
      service httpd restart 
      

      xiwu-fuse6-fabric - fabric

      Edit /etc/sysconfig/iptables

      After these two lines:

      -A INPUT -p icmp -j ACCEPT
      -A INPUT -i lo -j ACCEPT
      

      Add :

      -A INPUT -s 10.66.218.42 -p tcp -m state --state NEW -j DROP
      -A INPUT -s 10.66.218.42 -p tcp -m state --state NEW -j REJECT
      

      then

      service iptables restart.
      

      This prevents proxy from talking back to the fabric, while permitting fabric to establish connection through proxy.

      Next - replace "system/io/fabric8/fabric-git/1.0.0.redhat-379/fabric-git-1.0.0.redhat-379.jar" in jboss-fuse-full-6.1.0.redhat-379.zip (distribution) with one attached to https://issues.jboss.org/browse/ENTESB-1460.

      Otherwise the setup will not work at all.

      Installation shell script:

      ---------------------------------------

      killall java
      
      cd /home/daniel/fuse/fabric
      rm -rf jboss-fuse-6.1.0.redhat-379
      unzip /home/daniel/jboss-fuse-full-6.1.0.redhat-379.zip -d .
      
      
      sed -i 's/#admin=admin,admin/admin=admin,admin/' /home/daniel/fuse/fabric/jboss-fuse-full-6.1.0.redhat-379/etc/users.properties
      
      cd jboss-fuse-full-6.1.0.redhat-379/bin
      ./start
      

      ---------------------------------------

      > ssh -l admin -p 8101 xiwu-fuse61-fabric
      
       
      fabric:create  --wait-for-provisioning
      wait-for-provisioning
      
      fabric:container-remove-profile root jboss-fuse-full
      wait-for-provisioning
      
      fabric:profile-edit --pid io.fabric8.maven/proxy.host=wuxiaohui-proxy fabric 
      fabric:profile-edit --pid io.fabric8.maven/proxy.port=9001 fabric 
      fabric:profile-edit --pid io.fabric8.maven/proxy.protocol=http fabric 
      fabric:profile-edit --pid io.fabric8.maven/proxy.nonProxyHosts=xiwu-fuse6-fabric fabric
      
      wait-for-provisioning
      
      fabric:profile-edit --features jasypt-encryption fabric
      fabric:profile-edit --features fabric-zookeeper-commands fabric
      wait-for-provisioning
      
      fabric:profile-edit --features kar default
      fabric:profile-edit --features spring default
      fabric:profile-edit --features spring-dm default
      wait-for-provisioning
      

      ------------------------------------

      Now upload the attached file (It is an empty JAR):

      mvn deploy:deploy-file -DgroupId=com.westfield.au.fuse -DartifactId=wf-nop -Dversion=1.0.6 -Dpackaging=jar -Dfile=wf-nop-1.0.6.jar -Durl=http://admin:admin@xiwu-fuse6-fabric:8181/maven/upload
      

      ------------------------------------
      Back to fabric console:

      fabric:profile-delete --force fail-test-6
      fabric:profile-create --version 1.0 fail-test-6
      fabric:profile-edit --bundles mvn:com.w.a.fuse/wf/1.0.6 fail-test-6 1.0
      fabric:profile-edit -p fail.test/property1=value fail-test-6 1.0
      fabric:profile-edit -p fail.test/property2=value2 fail-test-6 1.0
      container-add-profile root fail-test-6
      container-list
      

      As you can see container-list is stuck in "downloading" mode, even though the artifact is local to the node. No need to download anything.

      If the node is killed in that state (kill -9) it looses fabric configuration sometimes.

      Show
      How to reproduce. Two boxes will be required: Hosting apache forward proxy (in my example - wuxiaohui-proxy its ip is 10.66.218.42) Hosting FUSE fabric (in my example xiwu-fuse6-fabric its ip is 10.66.218.148) The idea is that forward proxy is behind firewall, so the only connections permitted are those FROM fabric TO proxy. Proxy is not permitted to establish new connections back to the fabric node. wuxiaohui-proxy - Apache Proxy install httpd. Create /etc/httpd/conf.d/proxy.conf: ---------------- Listen *:9001 LogLevel Info <IfModule mod_proxy.c> ProxyRequests On ProxyVia On AllowCONNECT 443 AllowCONNECT 80 <Proxy *> Order deny,allow Deny from all Allow from all </Proxy> </IfModule> ---------------- Execute: setenforce 0 service iptables stop service httpd restart xiwu-fuse6-fabric - fabric Edit /etc/sysconfig/iptables After these two lines: -A INPUT -p icmp -j ACCEPT -A INPUT -i lo -j ACCEPT Add : -A INPUT -s 10.66.218.42 -p tcp -m state --state NEW -j DROP -A INPUT -s 10.66.218.42 -p tcp -m state --state NEW -j REJECT then service iptables restart. This prevents proxy from talking back to the fabric, while permitting fabric to establish connection through proxy. Next - replace "system/io/fabric8/fabric-git/1.0.0.redhat-379/fabric-git-1.0.0.redhat-379.jar" in jboss-fuse-full-6.1.0.redhat-379.zip (distribution) with one attached to https://issues.jboss.org/browse/ENTESB-1460 . Otherwise the setup will not work at all. Installation shell script: --------------------------------------- killall java cd /home/daniel/fuse/fabric rm -rf jboss-fuse-6.1.0.redhat-379 unzip /home/daniel/jboss-fuse-full-6.1.0.redhat-379.zip -d . sed -i 's/#admin=admin,admin/admin=admin,admin/' /home/daniel/fuse/fabric/jboss-fuse-full-6.1.0.redhat-379/etc/users.properties cd jboss-fuse-full-6.1.0.redhat-379/bin ./start --------------------------------------- > ssh -l admin -p 8101 xiwu-fuse61-fabric fabric:create --wait- for -provisioning wait- for -provisioning fabric:container-remove-profile root jboss-fuse-full wait- for -provisioning fabric:profile-edit --pid io.fabric8.maven/proxy.host=wuxiaohui-proxy fabric fabric:profile-edit --pid io.fabric8.maven/proxy.port=9001 fabric fabric:profile-edit --pid io.fabric8.maven/proxy.protocol=http fabric fabric:profile-edit --pid io.fabric8.maven/proxy.nonProxyHosts=xiwu-fuse6-fabric fabric wait- for -provisioning fabric:profile-edit --features jasypt-encryption fabric fabric:profile-edit --features fabric-zookeeper-commands fabric wait- for -provisioning fabric:profile-edit --features kar default fabric:profile-edit --features spring default fabric:profile-edit --features spring-dm default wait- for -provisioning ------------------------------------ Now upload the attached file (It is an empty JAR): mvn deploy:deploy-file -DgroupId=com.westfield.au.fuse -DartifactId=wf-nop -Dversion=1.0.6 -Dpackaging=jar -Dfile=wf-nop-1.0.6.jar -Durl=http: //admin:admin@xiwu-fuse6-fabric:8181/maven/upload ------------------------------------ Back to fabric console: fabric:profile-delete --force fail-test-6 fabric:profile-create --version 1.0 fail-test-6 fabric:profile-edit --bundles mvn:com.w.a.fuse/wf/1.0.6 fail-test-6 1.0 fabric:profile-edit -p fail.test/property1=value fail-test-6 1.0 fabric:profile-edit -p fail.test/property2=value2 fail-test-6 1.0 container-add-profile root fail-test-6 container-list As you can see container-list is stuck in "downloading" mode, even though the artifact is local to the node. No need to download anything. If the node is killed in that state (kill -9) it looses fabric configuration sometimes.

    Description

      The fabric still download the bundles through the proxy even I set the proxy.nonProxyHosts like:

      fabric:profile-edit --pid io.fabric8.maven/proxy.nonProxyHosts=xiwu-fuse61-fabric fabric
      

      We can see the exception in the proxy logs:

      10.66.218.148 - - [16/May/2014:11:19:13 +0800] "GET http://xiwu-fuse61-fabric:8181/maven/download/com/w/a/fuse/wf/1.0.6/wf-1.0.6.jar HTTP/1.1" 503 410 "-" "Java/1.7.0_45"
      

      exception in the fuse logs:

      2014-05-16 11:20:17,039 | ERROR | agent-2-thread-1 | DeploymentAgent                  | .fabric8.agent.DeploymentAgent$2  255 | 60 - io.fabric8.fabric-agent - 1.0.0.redhat-379 | Unable to update agent
      io.fabric8.agent.utils.MultiException: Error while downloading artifacts
      	at io.fabric8.agent.utils.AgentUtils$ArtifactDownloader.await(AgentUtils.java:314)[60:io.fabric8.fabric-agent:1.0.0.redhat-379]
      	at io.fabric8.agent.DeploymentBuilder.download(DeploymentBuilder.java:160)[60:io.fabric8.fabric-agent:1.0.0.redhat-379]
      	at io.fabric8.agent.DeploymentAgent.doUpdate(DeploymentAgent.java:503)[60:io.fabric8.fabric-agent:1.0.0.redhat-379]
      	at io.fabric8.agent.DeploymentAgent$2.run(DeploymentAgent.java:252)[60:io.fabric8.fabric-agent:1.0.0.redhat-379]
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)[:1.7.0_45]
      	at java.util.concurrent.FutureTask.run(FutureTask.java:262)[:1.7.0_45]
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[:1.7.0_45]
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[:1.7.0_45]
      	at java.lang.Thread.run(Thread.java:744)[:1.7.0_45]
      Caused by: java.io.IOException: Error downloading mvn:com.w.a.fuse/wf/1.0.6
      	at io.fabric8.agent.download.AbstractDownloadTask.initIOException(AbstractDownloadTask.java:108)[60:io.fabric8.fabric-agent:1.0.0.redhat-379]
      	at io.fabric8.agent.download.AbstractDownloadTask.run(AbstractDownloadTask.java:88)[60:io.fabric8.fabric-agent:1.0.0.redhat-379]
      	... 5 more
      Caused by: java.io.IOException: URL [mvn:com.w.a.fuse/wf/1.0.6] could not be resolved.
      	at io.fabric8.agent.download.MavenDownloadTask.download(MavenDownloadTask.java:123)[60:io.fabric8.fabric-agent:1.0.0.redhat-379]
      	at io.fabric8.agent.download.AbstractDownloadTask.run(AbstractDownloadTask.java:77)[60:io.fabric8.fabric-agent:1.0.0.redhat-379]
      	... 5 more
      2014-05-16 11:21:13,039 | ERROR | de startup timer | AsyncMavenIndexerFacadeFactory   | AsyncMavenIndexerFacadeFactory$1   52 | 250 - io.hawt.hawtio-maven-indexer - 1.2.0.redhat-379 | Failed to create the MavenIndexerFacade: java.lang.NullPointerException
      java.lang.NullPointerException
      	at org.apache.lucene.store.Directory.copy(Directory.java:234)[250:io.hawt.hawtio-maven-indexer:1.2.0.redhat-379]
      	at org.apache.lucene.store.Directory.copy(Directory.java:277)[250:io.hawt.hawtio-maven-indexer:1.2.0.redhat-379]
      	at org.apache.maven.index.context.IndexUtils.copyDirectory(IndexUtils.java:51)[250:io.hawt.hawtio-maven-indexer:1.2.0.redhat-379]
      	at org.apache.maven.index.context.DefaultIndexingContext.replace(DefaultIndexingContext.java:571)[250:io.hawt.hawtio-maven-indexer:1.2.0.redhat-379]
      	at org.apache.maven.index.updater.DefaultIndexUpdater.loadIndexDirectory(DefaultIndexUpdater.java:218)[250:io.hawt.hawtio-maven-indexer:1.2.0.redhat-379]
      	at org.apache.maven.index.updater.DefaultIndexUpdater.access$300(DefaultIndexUpdater.java:76)[250:io.hawt.hawtio-maven-indexer:1.2.0.redhat-379]
      	at org.apache.maven.index.updater.DefaultIndexUpdater$LuceneIndexAdaptor.setIndexFile(DefaultIndexUpdater.java:642)[250:io.hawt.hawtio-maven-indexer:1.2.0.redhat-379]
      	at org.apache.maven.index.updater.DefaultIndexUpdater.fetchAndUpdateIndex(DefaultIndexUpdater.java:862)[250:io.hawt.hawtio-maven-indexer:1.2.0.redhat-379]
      	at org.apache.maven.index.updater.DefaultIndexUpdater.fetchAndUpdateIndex(DefaultIndexUpdater.java:157)[250:io.hawt.hawtio-maven-indexer:1.2.0.redhat-379]
      	at io.hawt.maven.indexer.MavenIndexerFacade.downloadOrUpdateIndices(MavenIndexerFacade.java:171)[250:io.hawt.hawtio-maven-indexer:1.2.0.redhat-379]
      	at io.hawt.maven.indexer.MavenIndexerFacade.init(MavenIndexerFacade.java:129)[250:io.hawt.hawtio-maven-indexer:1.2.0.redhat-379]
      	at io.hawt.maven.indexer.AsyncMavenIndexerFacadeFactory.createMavenIndexer(AsyncMavenIndexerFacadeFactory.java:134)[250:io.hawt.hawtio-maven-indexer:1.2.0.redhat-379]
      	at io.hawt.maven.indexer.AsyncMavenIndexerFacadeFactory$1.run(AsyncMavenIndexerFacadeFactory.java:49)[250:io.hawt.hawtio-maven-indexer:1.2.0.redhat-379]
      	at java.util.TimerThread.mainLoop(Timer.java:555)[:1.7.0_45]
      	at java.util.TimerThread.run(Timer.java:505)[:1.7.0_45]
      
      

      Attachments

        1. demo.sh
          9 kB
        2. log0522.zip
          22 kB
        3. logs.zip
          23 kB

        Activity

          People

            pantinor@redhat.com Paolo Antinori
            rhn-support-xiwu Xiaohui Wu
            Votes:
            1 Vote for this issue
            Watchers:
            10 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: