Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.

wrangler route list knows nothing about --env #1216

Closed
thochra opened this issue Apr 20, 2020 · 8 comments · Fixed by #1448
Closed

wrangler route list knows nothing about --env #1216

thochra opened this issue Apr 20, 2020 · 8 comments · Fixed by #1448
Assignees
Milestone

Comments

@thochra
Copy link

thochra commented Apr 20, 2020

🐛 Bug Report

Looks like the route command is unable to load config according to a specified environement:

$ wrangler route list --env production
Error: You must specify a zone_id in `wrangler.toml` to use `wrangler route` commands.

Environment

  • operating system: linux/ubuntu
  • output of rustc -V: N/A
  • output of node -v: v12.16.1
  • output of wrangler -V: wrangler 1.8.2

Steps to reproduce

Put configuration of zones/accounts/routes in an env section and try to list the routes.

What did you expect to see?

Routes associated to an env.

What did you see instead?

missing configuration message or default config routes instead of the env's ones.

@EverlastingBugstopper
Copy link
Contributor

The error message here indicates that you need to set a zone_id in the [env.production] section of your wrangler.toml in order for that command to work.

@thochra
Copy link
Author

thochra commented Apr 20, 2020

Of course the zone_id and account_id have been filled for these envs because I can publish the worker.

here is a sample to reproduce it:

cd /tmp
wrangler generate -t webpack test-route
cd test-route

wrangler.toml

name = "test-route"
type = "javascript"
account_id = ""
workers_dev = true
route = ""
zone_id = ""

[env.production]
account_id = "1516XXXX"
zone_id = "9c08XXXXX"

terminal output:

/tmp/test-route $ wrangler route list
Error: You must specify a zone_id in `wrangler.toml` to use `wrangler route` commands.
/tmp/test-route $ wrangler route list --env production
Error: You must specify a zone_id in `wrangler.toml` to use `wrangler route` commands.

@ashleymichal ashleymichal added this to the Multi-Route Improvements milestone Apr 28, 2020
@tagspace
Copy link

tagspace commented May 1, 2020

I can also confirm that this is an issue.

If I create an environment, then I can no longer use
wrangler route list

@EverlastingBugstopper
Copy link
Contributor

I'm still unable to reproduce this error - @ashleymichal maybe you can try?

@thochra
Copy link
Author

thochra commented May 1, 2020

@EverlastingBugstopper In the example I gave I voluntarily let empty the account and zone id to demonstrate it doesn't take into consideration the values in the prod env.

If you have an account and zone id in the default section, then if you try to switch to another zone in the prod env you'll see you'll query the default zone, not the prod one.

Hopping it will help to reproduce...

@ashleymichal
Copy link
Contributor

we've repro'd this and i've started on a solution. should be able to work on it more later this week.

@Berndinox
Copy link

Same Problem here, is there a fix?

@jspspike
Copy link
Contributor

I'll take a look at this issue

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants