[ https://issues.apache.org/jira/browse/STRATOS-1516?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Akila resolved STRATOS-1516. ---------------------------- Resolution: Fixed Fix Version/s: (was: FUTURE) 4.1.2 Issue analysis: All the bundles in jclouds do not have proper OSGi imports for external 3rd party dependencies. That will work as long as it does not have any conflicts in OSGi run time environment. But unfortunately in our case there are some conflicts with bundles coming from the kernel and other WSO2 features which we depend on. The exact reason is jclouds rely on Google Guice which is a dependency injection framework. But guice is not an OSGi bundle in Maven central. We are using guice_3.0.0.wso2v1.jar which is an orbit bundle in WSO2 Nexus. This orbit bundle does not have proper OSGi export package versions. The real issue is jclouds components have been hard wired with guice ver. 1.3 (in MANIFEST.MF file) although it actually needs guice ver. 3.0. And this WSO2 orbit bundle is somehow wired to export guice ver. 1.3. I've no idea why these bundles got wired that way and I couldn't find any guice version of 1.3 in Maven central which is really weird. Now even though we include guice ver. 3.0 in OSGi environment, it got wired with 1.3 version which is provided by WSO2 orbit bundle and since that is not the bundle it actually needs we ran into multiple run time issues with GCE. It seems this incompatibility only exists for GCE IaaS provider, but it is likely that we might run into issues with other IaaS types too. As a fix for this problem, I had to wrap all the jclouds components that we need in separate pom files and specify the correct OSGi imports/exports in them. I had to specify the correct imports/exports in cloud controller component as well. Note that I have *not* forked any jclouds code here. Only that I had to wrap them with correct OSGi parameters. Fixed in commit: 0478f14cdbe194eb25b5a844b0abd1ca38ef28f5 > Error when deploying an application on Google Compute Engine > ------------------------------------------------------------ > > Key: STRATOS-1516 > URL: https://issues.apache.org/jira/browse/STRATOS-1516 > Project: Stratos > Issue Type: Bug > Reporter: Akila > Fix For: 4.1.2 > > > When deploying an application on GCE IaaS the following error is thrown. > [2015-08-19 23:07:20,412] ERROR > {org.apache.stratos.cloud.controller.iaases.JcloudsIaas} - Failed to start > an instance. MemberContext > [applicationId=39578a3c-dd8e-2d0b-99ae-a928c97749ab, cartridgeType=php, > clusterId=39578a3c-dd8e-2d0b-99ae-a928c97749ab.alias2.php.domain, > memberId=39578a3c-dd8e-2d0b-99ae-a928c97749ab.alias2.php.domain1df0c8d0-f1cc-463c-8493-5034a16b5347, > instanceId=null, partition=Partition [id=partition-1, description=null, > isPublic=false, provider=gce, properties=Properties [properties=[Property > [name=region, value=asia-east1]]]], defaultPrivateIP=null, > defaultPublicIP=null, allocatedIPs=null, publicIPs=null, privateIPs=null, > initTime=1440005827341, lbClusterId=null, > networkPartitionId=network-partition-1, kubernetesPodId=null, > kubernetesPodLabel=null, loadBalancingIPType=Private, instanceMetadata=null, > properties=Properties [properties=[Property [name=MIN_COUNT, value=1]]]] > Cause: command: POST > https://www.googleapis.com/compute/v1/projects/xz-fluent-cable-w/global/firewalls > HTTP/1.1 failed with response: HTTP/1.1 400 Bad Request; content: [{ > "error": { > "errors": [ > { > "domain": "global", > "reason": "invalid", > "message": "Invalid value for field 'resource.allowed': ''. Must specify > at least one allowed rule." > } > ], > "code": 400, > "message": "Invalid value for field 'resource.allowed': ''. Must specify > at least one allowed rule." > } > } > ] > org.jclouds.http.HttpResponseException: command: POST > https://www.googleapis.com/compute/v1/projects/xz-fluent-cable-w/global/firewalls > HTTP/1.1 failed with response: HTTP/1.1 400 Bad Request; content: [{ > "error": { > "errors": [ > { > "domain": "global", > "reason": "invalid", > "message": "Invalid value for field 'resource.allowed': ''. Must specify > at least one allowed rule." > } > ], > "code": 400, > "message": "Invalid value for field 'resource.allowed': ''. Must specify > at least one allowed rule." > } > } > ] > at > org.jclouds.googlecomputeengine.handlers.GoogleComputeEngineErrorHandler.handleError(GoogleComputeEngineErrorHandler.java:37) > at > org.jclouds.http.handlers.DelegatingErrorHandler.handleError(DelegatingErrorHandler.java:65) > at > org.jclouds.http.internal.BaseHttpCommandExecutorService.shouldContinue(BaseHttpCommandExecutorService.java:136) > at > org.jclouds.http.internal.BaseHttpCommandExecutorService.invoke(BaseHttpCommandExecutorService.java:105) > at > org.jclouds.rest.internal.InvokeHttpMethod.invoke(InvokeHttpMethod.java:90) > at > org.jclouds.rest.internal.InvokeHttpMethod.apply(InvokeHttpMethod.java:73) > at > org.jclouds.rest.internal.InvokeHttpMethod.apply(InvokeHttpMethod.java:44) > at > org.jclouds.reflect.FunctionalReflection$FunctionalInvocationHandler.handleInvocation(FunctionalReflection.java:117) > at > com.google.common.reflect.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:87) > at com.sun.proxy.$Proxy145.createInNetwork(Unknown Source) > at > org.jclouds.googlecomputeengine.compute.strategy.CreateNodesWithGroupEncodedIntoNameThenAddToSet.getOrCreateFirewalls(CreateNodesWithGroupEncodedIntoNameThenAddToSet.java:169) > at > org.jclouds.googlecomputeengine.compute.strategy.CreateNodesWithGroupEncodedIntoNameThenAddToSet.execute(CreateNodesWithGroupEncodedIntoNameThenAddToSet.java:113) > at > org.jclouds.compute.internal.BaseComputeService.createNodesInGroup(BaseComputeService.java:210) > at > org.apache.stratos.cloud.controller.iaases.JcloudsIaas.startInstance(JcloudsIaas.java:133) > at > org.apache.stratos.cloud.controller.services.impl.InstanceCreator.startInstance(InstanceCreator.java:109) > at > org.apache.stratos.cloud.controller.services.impl.InstanceCreator.run(InstanceCreator.java:68) > at > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) > at java.lang.Thread.run(Thread.java:745) > [2015-08-19 23:07:20,416] ERROR > {org.apache.stratos.cloud.controller.services.impl.InstanceCreator} - Could > not start instance: [cartridge-type] php [cluster-id] > 39578a3c-dd8e-2d0b-99ae-a928c97749ab.alias2.php.domain > This occurred after the jclouds 1.9.1 upgrade. Need to investigate the root > cause. -- This message was sent by Atlassian JIRA (v6.3.4#6332)