Rack V2 does not proxy the correct port

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:

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

Looks like a breaking change.

Maybe related to this PR: Append scheme to the URL to parse correctly by Twsouza · Pull Request #3620 · convox/rack · GitHub

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

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

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?

Hey @eravelo,

This is configured within the application’s convox.yml file. You can see our resources docs for a full usage explanation, but here is a brief example:

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

Thanks again @Nick-Convox.

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

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:

client: 20230619214423
server: 20230619214423

Best regards,
Eric