If as in the output above, your call indicates that localnet is active, it means that your request was sent to your locally running network (which will fail if it is not actually running). To switch to devnet, use:
One thing I noticed from your call to sui client new-env is that you are setting up your local network to use HTTPS which should not be necessary (and probably will not work), the local environment should be set-up like this:
sui client new-env --alias local --rpc http://127.0.0.1:9000
(no HTTPS)
If that doesn’t fix your issue I’ll need some more details to figure out what’s going on, such as a full list of repro instructions (to confirm that you are running a local network that can be connected to).
The issue is that the CLI will try and check that the RPC is reachable before adding it, so you will need to be running the local network before you add the environment. Can you confirm that you are running a local instance of the network while running these commands? It would be started using something like sui start (running in another terminal).
This happens if you have previously run sui genesis and created a configuration for a local network. It sounds like you are running something like the following to start your network:
$ sui genesis
$ sui start
Is that right? If so, it’s the sui genesis command that is complaining, because it will overwrite your previous configuration. You can run the following to force regenerating the configuration:
$ sui genesis -f
(This is similar to deleting the sui_config directory)
Or you can run sui start resuming the configuration you had created previously with:
$ sui start
If you had already run a local network before, this will pick back up where it left off (all the objects and package you previously created will still be there).