Uploaded image for project: 'CloudStack'
  1. CloudStack
  2. CLOUDSTACK-370

SSVM fails to download ISO when URL redirects to FTP

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: pre-4.0.0
    • Fix Version/s: None
    • Component/s: ISO
    • Security Level: Public (Anyone can view this level - this is the default.)
    • Labels:
      None
    • Environment:
      Running CloudStack-oss-3.0.2-1-rhel6.2 on CentOS 6.3

      Description

      I am trying to add the following ISO to my Cloud Stack ISOs:
      http://ftp.linux.ncsu.edu/pub/CentOS/5.8/isos/x86_64/CentOS-5.8-x86_64-netinstall.iso
      (Note it is using the HTTP protocol but the hostname starts with ftp.)
      It works happily from http://mirror.nexcess.net/CentOS/5.8/isos/x86_64/CentOS-5.8-x86_64-netinstall.iso

      I see the following on the UI under my attempted ISO add:
      Status Failed to install: unsupported protocol: 'ftp'

      I see the following error in my SSVM /var/log/cloud/cloud.log:

      java.lang.IllegalStateException: unsupported protocol: 'ftp'
      at org.apache.commons.httpclient.protocol.Protocol.lazyRegisterProtocol(Protocol.java:149)
      at org.apache.commons.httpclient.protocol.Protocol.getProtocol(Protocol.java:117)
      at org.apache.commons.httpclient.HttpHost.<init>(HttpHost.java:107)
      at org.apache.commons.httpclient.HttpMethodBase.setURI(HttpMethodBase.java:280)
      at org.apache.commons.httpclient.HttpMethodDirector.processRedirectResponse(HttpMethodDirector.java:616)
      at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:179)
      at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
      at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323)
      at com.cloud.storage.template.HttpTemplateDownloader.download(HttpTemplateDownloader.java:225)
      at com.cloud.storage.template.HttpTemplateDownloader.run(HttpTemplateDownloader.java:377)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      at java.lang.Thread.run(Thread.java:662)

        Activity

        Hide
        edison edison su added a comment -
        Show
        edison edison su added a comment - It's a "bug" in apache httpclient, which can't handle http redirect: http://mail-archives.apache.org/mod_mbox/hc-dev/200711.mbox/%3C32419602.1196098183970.JavaMail.jira@brutus%3E
        Show
        ke4qqq David Nalley added a comment - For the record that is HTTPCLIENT-706 https://issues.apache.org/jira/browse/HTTPCLIENT-706
        Hide
        clayb Clay B. added a comment - - edited

        This looks to be a bug in HTTPClient:

        (Using Jython)
        >>> import org.apache.commons.httpclient.methods.GetMethod as GetMethod
        >>> import org.apache.commons.httpclient.params.HttpMethodParams as HttpMethodParams
        >>> import org.apache.commons.httpclient.HttpClient as HttpClient
        >>> import java.net.URI as URI
        >>> import java.lang.String as JString
        >>> request=GetMethod(JString("http://ftp.linux.ncsu.edu/pub/CentOS/5.8/isos/x86_64/CentOS-5.8-x86_64-netinstall.iso"))
        >>> request.getParams().setParameter(HttpMethodParams.RETRY_HANDLER,None)
        >>> client = HttpClient()
        >>> responseCode = client.executeMethod(request)
        Traceback (most recent call last):
        File "<stdin>", line 1, in <module>
        at org.apache.commons.httpclient.protocol.Protocol.lazyRegisterProtocol(Protocol.java:149)
        at org.apache.commons.httpclient.protocol.Protocol.getProtocol(Protocol.java:117)
        at org.apache.commons.httpclient.HttpHost.<init>(HttpHost.java:107)
        at org.apache.commons.httpclient.HttpMethodBase.setURI(HttpMethodBase.java:280)
        at org.apache.commons.httpclient.HttpMethodDirector.processRedirectResponse(HttpMethodDirector.java:616)
        at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:179)
        at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
        at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:616)

        java.lang.IllegalStateException: java.lang.IllegalStateException: unsupported protocol: 'ftp'

        Thank you both for replying before I could even test the issue Edison and David!

        Show
        clayb Clay B. added a comment - - edited This looks to be a bug in HTTPClient: (Using Jython) >>> import org.apache.commons.httpclient.methods.GetMethod as GetMethod >>> import org.apache.commons.httpclient.params.HttpMethodParams as HttpMethodParams >>> import org.apache.commons.httpclient.HttpClient as HttpClient >>> import java.net.URI as URI >>> import java.lang.String as JString >>> request=GetMethod(JString("http://ftp.linux.ncsu.edu/pub/CentOS/5.8/isos/x86_64/CentOS-5.8-x86_64-netinstall.iso")) >>> request.getParams().setParameter(HttpMethodParams.RETRY_HANDLER,None) >>> client = HttpClient() >>> responseCode = client.executeMethod(request) Traceback (most recent call last): File "<stdin>", line 1, in <module> at org.apache.commons.httpclient.protocol.Protocol.lazyRegisterProtocol(Protocol.java:149) at org.apache.commons.httpclient.protocol.Protocol.getProtocol(Protocol.java:117) at org.apache.commons.httpclient.HttpHost.<init>(HttpHost.java:107) at org.apache.commons.httpclient.HttpMethodBase.setURI(HttpMethodBase.java:280) at org.apache.commons.httpclient.HttpMethodDirector.processRedirectResponse(HttpMethodDirector.java:616) at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:179) at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397) at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) java.lang.IllegalStateException: java.lang.IllegalStateException: unsupported protocol: 'ftp' Thank you both for replying before I could even test the issue Edison and David!

          People

          • Assignee:
            Unassigned
            Reporter:
            clayb Clay B.
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development