Uploaded image for project: 'ZZZ-WSO2 Private PaaS'
  1. ZZZ-WSO2 Private PaaS
  2. PAAS-166

After changing EC2 user account details in the stratos core, it is giving 401 Unauthorized error

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Normal
    • Resolution: Won't Fix
    • Affects Version/s: 4.0.0
    • Fix Version/s: Future
    • Labels:
      None
    • Severity:
      Blocker
    • Estimated Complexity:
      Moderate
    • Test cases added:
      Yes

      Description

      <iaasProvider type="ec2" name="ec2 specific details">
      <className>org.apache.stratos.cloud.controller.iaases.AWSEC2Iaas</className>
      <provider>aws-ec2</provider>
      <identity svns:secretAlias="elastic.scaler.openstack.identity">XXXXXXXXXXXXXXXX</identity>
      <credential svns:secretAlias="elastic.scaler.openstack.credential">YYYYYYYYYYYYYYYYYY</credential>
      <property name="jclouds.ec2.ami-query" value="owner-id=999900001111;state=available;image-type=machine"/>
      <property name="availabilityZone" value="aaaaa"/>
      <property name="securityGroups" value="bbbbbb"/>
      <property name="autoAssignIp" value="true" />
      <property name="keyPair" value="fffffff"/>
      <property name="securityGroupIds" value="bbbbbb"/>
      <property name="subnetId" value="cccccccccccccc"/>
      <property name="associatePublicIpAddress" value="true"/>
      </iaasProvider>

      When I changed the EC2 identity and credential in the cloud-controller.xml in a running Stratos Core instance and restarted it gave me the error below:

      Mgt Console URL : https://stratos.devenv.com:443/carbon/

      {org.wso2.carbon.ui.internal.CarbonUIServiceComponent}

      TID: [0] [STRATOS] [2014-11-05 21:31:01,153] INFO

      {org.apache.stratos.messaging.message.processor.topology.CompleteTopologyMessageProcessor} - Topology initialized {org.apache.stratos.messaging.message.processor.topology.CompleteTopologyMessageProcessor}

      TID: [0] [STRATOS] [2014-11-05 21:31:01,158] INFO

      {org.apache.stratos.manager.topology.receiver.StratosManagerTopologyEventReceiver} - [CompleteTopologyEventListener] Received: class org.apache.stratos.messaging.event.topology.CompleteTopologyEvent {org.apache.stratos.manager.topology.receiver.StratosManagerTopologyEventReceiver}

      TID: [0] [STRATOS] [2014-11-05 21:31:06,182] INFO

      {org.apache.stratos.autoscaler.util.ConfUtil} - Loading configuration..... {org.apache.stratos.autoscaler.util.ConfUtil}

      TID: [0] [STRATOS] [2014-11-05 21:31:06,267] INFO

      {org.apache.stratos.autoscaler.client.cloud.controller.CloudControllerClient} - Validating partitions of policy via cloud controller: [id] multi-zone-policy1 {org.apache.stratos.autoscaler.client.cloud.controller.CloudControllerClient}

      TID: [0] [STRATOS] [2014-11-05 21:31:09,099] ERROR

      {org.apache.stratos.cloud.controller.util.CloudControllerUtil} - Unable to build the jclouds object for iaas of type: ec2 {org.apache.stratos.cloud.controller.util.CloudControllerUtil}

      org.jclouds.rest.AuthorizationException: POST https://ec2.xxx-west-cccc.amazonaws.com/ HTTP/1.1 -> HTTP/1.1 401 Unauthorized
      at org.jclouds.aws.handlers.ParseAWSErrorFromXmlContent.refineException(ParseAWSErrorFromXmlContent.java:124)
      at org.jclouds.aws.handlers.ParseAWSErrorFromXmlContent.handleError(ParseAWSErrorFromXmlContent.java:91)
      at org.jclouds.http.handlers.DelegatingErrorHandler.handleError(DelegatingErrorHandler.java:67)
      at org.jclouds.http.internal.BaseHttpCommandExecutorService.shouldContinue(BaseHttpCommandExecutorService.java:180)
      at org.jclouds.http.internal.BaseHttpCommandExecutorService.invoke(BaseHttpCommandExecutorService.java:150)
      at org.jclouds.rest.internal.InvokeHttpMethod.invoke(InvokeHttpMethod.java:93)
      at org.jclouds.rest.internal.InvokeHttpMethod.apply(InvokeHttpMethod.java:76)
      at org.jclouds.rest.internal.InvokeHttpMethod.apply(InvokeHttpMethod.java:47)
      at org.jclouds.reflect.FunctionalReflection$FunctionalInvocationHandler.handleInvocation(FunctionalReflection.java:117)
      at com.google.common.reflect.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:79)
      at com.sun.proxy.$Proxy87.describeRegions(Unknown Source)
      at org.jclouds.ec2.suppliers.DescribeRegionsForRegionURIs.get(DescribeRegionsForRegionURIs.java:47)
      at org.jclouds.ec2.suppliers.DescribeRegionsForRegionURIs.get(DescribeRegionsForRegionURIs.java:34)
      at org.jclouds.rest.suppliers.MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier$SetAndThrowAuthorizationExceptionSupplierBackedLoader.load(MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.java:75)
      at org.jclouds.rest.suppliers.MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier$SetAndThrowAuthorizationExceptionSupplierBackedLoader.load(MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.java:59)
      at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3522)
      at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2315)
      at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2278)
      at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2193)
      at com.google.common.cache.LocalCache.get(LocalCache.java:3932)
      at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3936)
      at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4806)
      at org.jclouds.rest.suppliers.MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.get(MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.java:121)
      at org.jclouds.location.suppliers.derived.RegionIdsFromRegionIdToURIKeySet.get(RegionIdsFromRegionIdToURIKeySet.java:49)
      at org.jclouds.location.suppliers.derived.RegionIdsFromRegionIdToURIKeySet.get(RegionIdsFromRegionIdToURIKeySet.java:36)
      at com.google.common.base.Suppliers$SupplierComposition.get(Suppliers.java:67)
      at org.jclouds.rest.suppliers.MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier$SetAndThrowAuthorizationExceptionSupplierBackedLoader.load(MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.java:75)
      at org.jclouds.rest.suppliers.MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier$SetAndThrowAuthorizationExceptionSupplierBackedLoader.load(MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.java:59)
      at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3522)
      at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2315)
      at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2278)
      at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2193)
      at com.google.common.cache.LocalCache.get(LocalCache.java:3932)
      at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3936)
      at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4806)
      at org.jclouds.rest.suppliers.MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.get(MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.java:121)
      at org.jclouds.location.suppliers.all.RegionToProviderOrJustProvider.get(RegionToProviderOrJustProvider.java:60)
      at org.jclouds.location.suppliers.all.ZoneToRegionToProviderOrJustProvider.get(ZoneToRegionToProviderOrJustProvider.java:75)
      at org.jclouds.location.suppliers.all.ZoneToRegionToProviderOrJustProvider.get(ZoneToRegionToProviderOrJustProvider.java:50)
      at org.jclouds.rest.suppliers.MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier$SetAndThrowAuthorizationExceptionSupplierBackedLoader.load(MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.java:75)
      at org.jclouds.rest.suppliers.MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier$SetAndThrowAuthorizationExceptionSupplierBackedLoader.load(MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.java:59)
      at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3522)
      at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2315)
      at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2278)
      at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2193)
      at com.google.common.cache.LocalCache.get(LocalCache.java:3932)
      at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3936)
      at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4806)
      at org.jclouds.rest.suppliers.MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.get(MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.java:121)
      at org.jclouds.compute.internal.BaseComputeService.listAssignableLocations(BaseComputeService.java:390)
      at org.apache.stratos.cloud.controller.iaases.AWSEC2Iaas.buildTemplate(AWSEC2Iaas.java:103)
      at org.apache.stratos.cloud.controller.iaases.AWSEC2Iaas.buildComputeServiceAndTemplate(AWSEC2Iaas.java:79)
      at org.apache.stratos.cloud.controller.util.CloudControllerUtil.setIaas(CloudControllerUtil.java:212)
      at org.apache.stratos.cloud.controller.util.CloudControllerUtil.getIaas(CloudControllerUtil.java:225)
      at org.apache.stratos.cloud.controller.pojo.IaasProvider.getIaas(IaasProvider.java:219)
      at org.apache.stratos.cloud.controller.concurrent.PartitionValidatorCallable.call(PartitionValidatorCallable.java:62)
      at org.apache.stratos.cloud.controller.concurrent.PartitionValidatorCallable.call(PartitionValidatorCallable.java:34)
      at java.util.concurrent.FutureTask.run(FutureTask.java:262)

      Could get rid of the error only by removing the data and topology directories in the /_system/governance/cloud.controller

      This is wrong behavior IMO.

      Also the data and topology resouces are serialized objects which we cannot see the content easily.
      Better if we can fix the media type of these resources as well.

        Attachments

          Activity

            People

            • Assignee:
              lakmal@wso2.com Lakmal Warusawithana
              Reporter:
              manisha@wso2.com Manisha Eleperuma
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: