I'm having some trouble where Pulumi states are be...
# general
w
I'm having some trouble where Pulumi states are being created using the legacy style. In particular, this is happening when using a local file backend in my test environments.
pulumi stack select dev --create
is creating a legacy stack, though my pulumi version is
v3.69.0
and I am deleting my
~/.pulumi
folder between runs. Is there a way to force always using the multi-project backend and never use the legacy style?
e
oh this might be an issue where ~/.pulumi doesn't auto-upgrade because there's other things put in there by the install scripts so it doesn't think it's an empty folder. You probably need to run an explicit
pulumi state upgrade
command.
w
In my case, there is no
~/.pulumi
folder yet, so it's using the legacy style on initial creation of that directory when I run
pulumi stack init dev --create
. Also, when I run this in a fresh CI/CD environment, it seems to successfully instantiate with the new state style when I run
pulumi login --local
but if I run
pulumi login <file://some-other-path>
it creates
some-other-path/.pulumi/stacks
in the legacy style.
I think that you were actually correct now, but the strangeness is because I'm using
PULUMI_HOME
which had an additional configuration file in it, and I think that's what was causing the old style state. The confusion was that though I had
PULUMI_HOME
set,
pulumi login --local
stores things in
~/.pulumi
.
e
Yeh PULUMI_HOME changes where to look up plugins but not the default location for the state store. It probably should but not a change we can safely make now. I've pinged our team internally to see if we can make the upgrade logic a bit smarter and check if there's any old stack files, rather than if there's any files/folders at all. Should make it auto-upgrade in a few more places.
w
That sounds great! It's a bit of a challenging thing to debug, I have it working on my local but not yet in the CI environment, though things appear to be mostly identical. Anyways, will likely figure it out soon. Thanks for the help.
It turns out that
yarn install
adds plugins to the
.pulumi
folder, which is enough to trigger the old state style. I'm able to work around this in my CI environment.