# Rack V2 does not proxy the correct port

**URL:** <https://community.convox.com/t/rack-v2-does-not-proxy-the-correct-port/926>\
**Category:** Rack (Version 2)\
**Created:** [June 22, 2023, 9:35am UTC](https://community.convox.com/t/rack-v2-does-not-proxy-the-correct-port/926 "2023-06-22T09:35:59Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![eravelo](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.convox.com/eravelo/32/22_2.png) [@eravelo](https://community.convox.com/u/eravelo)\
**Post date:** [June 22, 2023, 9:35am UTC](https://community.convox.com/t/rack-v2-does-not-proxy-the-correct-port/926/1 "2023-06-22T09:35:59Z")

</div>

Hello all,

After updating to latest version (20230619214423) of the CLI and the Rack, the `rack resources proxy` command does not seem to work anymore. It proxies to port 80, which is strange for a MySQL resource:

```auto
$ convox rack resources proxy my_db -p 13306                                              
proxying localhost:13306 to mysql:80

```

Looks like a breaking change.

---

<div class="post-metadata">

**Author:** ![eravelo](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.convox.com/eravelo/32/22_2.png) [@eravelo](https://community.convox.com/u/eravelo)\
**Post date:** [June 22, 2023, 9:42am UTC](https://community.convox.com/t/rack-v2-does-not-proxy-the-correct-port/926/2 "2023-06-22T09:42:00Z")

</div>

Maybe related to this PR: [Append scheme to the URL to parse correctly by Twsouza · Pull Request #3620 · convox/rack · GitHub](https://github.com/convox/rack/pull/3620)

---

<div class="post-metadata">

**Author:** ![Nick-Convox](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.convox.com/nick-convox/32/250_2.png) [@Nick-Convox](https://community.convox.com/u/Nick-Convox)\
**Post date:** [June 27, 2023, 12:18am UTC](https://community.convox.com/t/rack-v2-does-not-proxy-the-correct-port/926/3 "2023-06-27T00:18:46Z")

</div>

Hey there eravelo,

Try to use the command `convox resources proxy resourceName -p port` when you use `convox rack resources` you will address rack level resources. You may additionally need to add the `-a appName` option if you are not in the local directory referencing the application who’s convox.yml is responsible for the resource’s creation.

I tested this a few different ways and each time `convox resources proxy` used 3306 for mysql

Regards,  
Nick  
Convox Engineer

---

<div class="post-metadata">

**Author:** ![eravelo](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.convox.com/eravelo/32/22_2.png) [@eravelo](https://community.convox.com/u/eravelo)\
**Post date:** [September 13, 2023, 9:26am UTC](https://community.convox.com/t/rack-v2-does-not-proxy-the-correct-port/926/4 "2023-09-13T09:26:36Z")

</div>

Thank you @Nick-Convox but that does not work.

```auto
convox resources proxy my_db -p 13306 
ERROR: ValidationError: Resource ResourceMyDb does not exist for stack my-app
	status code: 400, request id: 6f1064cc-8d71-4998-99b1-2fe0ca4bc0fe

```

How to find to which app a resource is attached?

---

<div class="post-metadata">

**Author:** ![Nick-Convox](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.convox.com/nick-convox/32/250_2.png) [@Nick-Convox](https://community.convox.com/u/Nick-Convox)\
**Post date:** [September 13, 2023, 1:20pm UTC](https://community.convox.com/t/rack-v2-does-not-proxy-the-correct-port/926/5 "2023-09-13T13:20:17Z")

</div>

Hey @eravelo,

This is configured within the application’s `convox.yml` file. You can see our [resources docs](https://docsv2.convox.com/application/resources) for a full usage explanation, but here is a brief example:

```auto
resources:
  maindb:
    type: mysql
  gisdb:
    type: postgres
    options:
      version: 12
  queue:
    type: redis
  cache:
    type: redis
services:
  web:
    resources:
      - maindb
      - gisdb
      - queue
      - cache

```

In this configuration the resources `maindb`, `gisdb`, `queue`, and `cache` are linked to the `web` service.

If this all looks to be the way you have things setup, I would double check that your CLI is on the latest version by running `convox update` and verifying with `convox version`

Additionally, from your error it seems to not be targeting the correct application name. If you’re app which contains the db resource is not called `my-app`. Convox will use your local directory name as the default app identifier when executing app level commands. You may have luck sending this with the `-a appName` option with your current command.

Regards,  
Nick

---

<div class="post-metadata">

**Author:** ![eravelo](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.convox.com/eravelo/32/22_2.png) [@eravelo](https://community.convox.com/u/eravelo)\
**Post date:** [September 13, 2023, 2:55pm UTC](https://community.convox.com/t/rack-v2-does-not-proxy-the-correct-port/926/6 "2023-09-13T14:55:30Z")

</div>

Thanks again @Nick-Convox.

This resource was created the old way (back in 2019) with the command

```auto
convox rack resources create mysql --name my_db

```

but not on behalf of any app (no resources were references in any of the app’s `convox.yml`)  
This must be the cause of the confusion.

Currently both client and server versions are aligned:

```auto
client: 20230619214423
server: 20230619214423

```

Best regards,  
Eric
