Error Deploying Invalid virtual host reference secure.

hsnbilgen
Participant III

I am havin the following error on API Management portal. when i clicked the proxy while its downloading and before it started to download following error occurs. So i need to fix it i dont understand. It's onpremise model on our instance. Thank you.

Error Deploying

Invalid virtual host reference secure. Context Revision:1;APIProxy:wfs-proxy_rev1_2015_06_09;Organization:org;Environment:test

1 9 4,901
9 REPLIES 9

sarthak
Participant V

Hi @Hasan

When you go to your proxy bundle and click on Proxy Endpoint -> default on your left hand panel it will open up an XML view. Go down below and you will see the following snippet there :

<HTTPProxyConnection>
        <BasePath>/v3/abcd</BasePath>
        <VirtualHost>default</VirtualHost>
        <VirtualHost>secure</VirtualHost>
    </HTTPProxyConnection>

I am guessing in your case the virtual host secure is not defined

You can check the configured VH from APIs -> Environment Configurations at the top menu. Most likely you will see no VH by the name of "secure" there.

Learn more about Virtual Hosts here : http://apigee.com/docs/api-services/content/virtual-hosts

Ok i removed the secure tag but now the following error occurs. Unknown target.

<fault><faultstring>Unknown target $IP1:9001</faultstring><detail><errorcode>UNKNOWN_TARGET</errorcode></detail></fault>

Is the error happening when deploying the proxy ?

You have a "default" VH defined in your environment configuration as well as in your proxy definition right ?

@sarthak,

I had a similar problem with default virtual host.

{ "code" : "messaging.config.beans.InvalidVirtualHostReference", 
  "message" : "Invalid virtual host reference default. Context Revision:1;APIProxy:TestProxy;Organization:development-org;Environment:test", 
  "contexts" : [ ], 
  "cause" : { 
    "code" : "messaging.config.beans.VirtualHostDoesNotExist", 
    "message" : "Virtual host default does not exist in environment test", 
    "contexts" : [ ] 
  } 

Your suggestion helped me to fix it.

Thanks.

@AMAR DEVEGOWDA glad I was of help

hsnbilgen
Participant III

first issue is ok. it's not appearing again but the second issue which is unknown target error is still occurs.

I have VH defined test as 9002 and VH prod defined as 9001 in the environment configuration. In the proxy definition i didn't mentioned as any of them specific port so which steps should i follow?

sarthak
Participant V

In your environment configurations you will see that virtual hosts have a name.

587-vh.png

In your proxy definition you should be using that name :

<HTTPProxyConnection>
        <BasePath>/v3/abcd</BasePath>
        <VirtualHost>{use the VH NAME here}</VirtualHost>
    </HTTPProxyConnection>

Hope this helps

Hi @Hasan,

This error

<fault><faultstring>Unknown target $IP1:9001</faultstring><detail><errorcode>UNKNOWN_TARGET</errorcode></detail></fault>

is not an issue with your virtual hosts, it should be an issue with your target. It is probably something wrong with your HTTPTargetConnection in one of your target files. Look at your target files and see if you have IP1 specified -- "$IP1" is not a valid URL, which I think is the error.

The deploying error gets resolved when you remove the <VirtualHost>secure</VirtualHost> tag from <HTTPProxyConnection> parent element .