Closed philliphoff closed 3 years ago
You can use --debug --debug-plugins
to see more information on what is being read out of storage.
Here's some more info on the schema and how we detect if we need to migrate:
Porter never migrates your data implicitly. In this case, you would run the requested migration comment, e.g. porter storage migrate
and Porter migrates existing data and updates the schema.json to match.
FWIW, we haven't done anything that would trigger a migration since ~July 2020. Based on that and the error you are seeing when you try to run porter storage migrate
, I would guess that porter is having trouble communicating with the storage backend or the data being returned from the plugin isn't in the expected structure. Hopefully the plugin debug logs will help isolate where the problem is.
@carolynvs Thanks, I'll poke around some more. This is a brand new VM with the latest Porter client tools. There is no schema.json
in ~/.porter
, nor is there a PORTER_HOME
environment variable defined.
node ➜ /workspaces/webapi-nodejs-template-3/src/bundle (main ✗) $ porter install --debug --cred ./creds.json --parameter-set ./params.json
DEBUG name: arm
DEBUG pkgDir: /home/node/.porter/mixins/arm
DEBUG file:
DEBUG stdin:
/workspaces/webapi-nodejs-template-3/src/bundle/home/node/.porter/mixins/arm/arm version --output json --debug
DEBUG name: aws
DEBUG pkgDir: /home/node/.porter/mixins/aws
DEBUG file:
DEBUG stdin:
/workspaces/webapi-nodejs-template-3/src/bundle/home/node/.porter/mixins/aws/aws version --output json --debug
DEBUG name: az
DEBUG pkgDir: /home/node/.porter/mixins/az
DEBUG file:
DEBUG stdin:
/workspaces/webapi-nodejs-template-3/src/bundle/home/node/.porter/mixins/az/az version --output json --debug
DEBUG name: exec
DEBUG pkgDir: /home/node/.porter/mixins/exec
DEBUG file:
DEBUG stdin:
/workspaces/webapi-nodejs-template-3/src/bundle/home/node/.porter/mixins/exec/exec version --output json --debug
DEBUG name: gcloud
DEBUG pkgDir: /home/node/.porter/mixins/gcloud
DEBUG file:
DEBUG stdin:
/workspaces/webapi-nodejs-template-3/src/bundle/home/node/.porter/mixins/gcloud/gcloud version --output json --debug
DEBUG name: helm
DEBUG pkgDir: /home/node/.porter/mixins/helm
DEBUG file:
DEBUG stdin:
/workspaces/webapi-nodejs-template-3/src/bundle/home/node/.porter/mixins/helm/helm version --output json --debug
DEBUG name: kubernetes
DEBUG pkgDir: /home/node/.porter/mixins/kubernetes
DEBUG file:
DEBUG stdin:
/workspaces/webapi-nodejs-template-3/src/bundle/home/node/.porter/mixins/kubernetes/kubernetes version --output json --debug
DEBUG name: terraform
DEBUG pkgDir: /home/node/.porter/mixins/terraform
DEBUG file:
DEBUG stdin:
/workspaces/webapi-nodejs-template-3/src/bundle/home/node/.porter/mixins/terraform/terraform version --output json --debug
installing webapi-nodejs-3...
Error: could not save the pending action's status, the bundle was not executed: The schema of Porter's data is in an older format than supported by this version of Porter.
Refer to https://porter.sh/storage-migrate for more information and instructions to back up your data.
Once your data has been backed up, run the following command to perform the migration:
porter storage migrate
node ➜ /workspaces/webapi-nodejs-template-3/src/bundle (main ✗) $ porter storage migrate --debug
Saved migration logs to
Error: Migration failed!
node ➜ /workspaces/webapi-nodejs-template-3/src/bundle (main ✗) $
Okay okay so it's using the filesystem plugin. I noticed that your command didn't include --debug-plugins
which is the other flag needed to see communications with the storage plugin.
@carolynvs I noticed that your command didn't include --debug-plugins which is the other flag needed to see communications with the storage plugin.
Ah, sorry about that, let me try again.
node ➜ /workspaces/webapi-nodejs-template-3/src/bundle (main ✗) $ porter install --debug --debug-plugins --cred ./creds.json --parameter-set ./params.json
DEBUG name: arm
DEBUG pkgDir: /home/node/.porter/mixins/arm
DEBUG file:
DEBUG stdin:
/workspaces/webapi-nodejs-template-3/src/bundle/home/node/.porter/mixins/arm/arm version --output json --debug
DEBUG name: aws
DEBUG pkgDir: /home/node/.porter/mixins/aws
DEBUG file:
DEBUG stdin:
/workspaces/webapi-nodejs-template-3/src/bundle/home/node/.porter/mixins/aws/aws version --output json --debug
DEBUG name: az
DEBUG pkgDir: /home/node/.porter/mixins/az
DEBUG file:
DEBUG stdin:
/workspaces/webapi-nodejs-template-3/src/bundle/home/node/.porter/mixins/az/az version --output json --debug
DEBUG name: exec
DEBUG pkgDir: /home/node/.porter/mixins/exec
DEBUG file:
DEBUG stdin:
/workspaces/webapi-nodejs-template-3/src/bundle/home/node/.porter/mixins/exec/exec version --output json --debug
DEBUG name: gcloud
DEBUG pkgDir: /home/node/.porter/mixins/gcloud
DEBUG file:
DEBUG stdin:
/workspaces/webapi-nodejs-template-3/src/bundle/home/node/.porter/mixins/gcloud/gcloud version --output json --debug
DEBUG name: helm
DEBUG pkgDir: /home/node/.porter/mixins/helm
DEBUG file:
DEBUG stdin:
/workspaces/webapi-nodejs-template-3/src/bundle/home/node/.porter/mixins/helm/helm version --output json --debug
DEBUG name: kubernetes
DEBUG pkgDir: /home/node/.porter/mixins/kubernetes
DEBUG file:
DEBUG stdin:
/workspaces/webapi-nodejs-template-3/src/bundle/home/node/.porter/mixins/kubernetes/kubernetes version --output json --debug
DEBUG name: terraform
DEBUG pkgDir: /home/node/.porter/mixins/terraform
DEBUG file:
DEBUG stdin:
/workspaces/webapi-nodejs-template-3/src/bundle/home/node/.porter/mixins/terraform/terraform version --output json --debug
Resolved secrets plugin to secrets.porter.host
/home/node/.porter/porter plugin run secrets.porter.host
Resolved secrets plugin to secrets.porter.host
/home/node/.porter/porter plugin run secrets.porter.host
Resolved secrets plugin to secrets.porter.host
/home/node/.porter/porter plugin run secrets.porter.host
Resolved secrets plugin to secrets.porter.host
/home/node/.porter/porter plugin run secrets.porter.host
error closing client during Kill
plugin failed to exit gracefully
Resolved secrets plugin to secrets.porter.host
/home/node/.porter/porter plugin run secrets.porter.host
Resolved secrets plugin to secrets.porter.host
/home/node/.porter/porter plugin run secrets.porter.host
Resolved secrets plugin to secrets.porter.host
/home/node/.porter/porter plugin run secrets.porter.host
Resolved secrets plugin to secrets.porter.host
/home/node/.porter/porter plugin run secrets.porter.host
installing webapi-nodejs-3...
Resolved storage plugin to storage.porter.filesystem
/home/node/.porter/porter plugin run storage.porter.filesystem
PORTER HOME: /home/node/.porter
Resolved secrets plugin to secrets.porter.host
/home/node/.porter/porter plugin run secrets.porter.host
Resolved secrets plugin to secrets.porter.host
/home/node/.porter/porter plugin run secrets.porter.host
Resolved secrets plugin to secrets.porter.host
/home/node/.porter/porter plugin run secrets.porter.host
Resolved secrets plugin to secrets.porter.host
/home/node/.porter/porter plugin run secrets.porter.host
Resolved storage plugin to storage.porter.filesystem
/home/node/.porter/porter plugin run storage.porter.filesystem
PORTER HOME: /home/node/.porter
Error: could not save the pending action's status, the bundle was not executed: The schema of Porter's data is in an older format than supported by this version of Porter.
Refer to https://porter.sh/storage-migrate for more information and instructions to back up your data.
Once your data has been backed up, run the following command to perform the migration:
porter storage migrate
Weird! A couple thoughts:
porter list --debug --debug-plugins
. It will fail faster and with less extraneous output I think.tree -la /home/node/.porter
(if you don't have tree, I think ls -laR /home/node/.porter
)@carolynvs
- Do you have write access to /home/node/.porter?
- Can you run tree -la /home/node/.porter (if you don't have tree, I think ls -laR /home/node/.porter)
node ➜ /workspaces/webapi-nodejs-template-3/src/bundle (main ✗) $ ls -laR /home/node/.porter
/home/node/.porter:
total 56836
drwxr-xr-x 5 root root 4096 Mar 16 18:15 .
drwxr-xr-x 1 node node 4096 Mar 16 20:39 ..
drwxr-xr-x 10 root root 4096 Mar 16 18:15 mixins
drwxr-xr-x 3 root root 4096 Mar 16 18:15 plugins
-rwxr-xr-x 1 root root 58113123 Mar 16 18:15 porter
drwxr-xr-x 2 root root 4096 Mar 16 18:15 runtimes
Ah, that looks a bit suspicious. Even moreso when I go back to the Dockerfile
:
## Porter
RUN curl https://cdn.porter.sh/latest/install-linux.sh | bash
RUN sudo mv /root/.porter /home/node/.porter
ENV PATH "$PATH:/home/node/.porter"
I'll have to look into why Porter is installed that way.
Thanks for the pointers!
Oh, yeah looks like the file permissions aren't for the correct user anymore? Not sure where the dockerfile came from, let me know if this was something we put out!
The Dockerfile
came from our team. I think the mv
was added because the installation happens as root
during the build but the ultimate user is node
. One question: is Porter intended to be installed on a machine for all users or for individual users?
Right now it's designed to be installed for each user. Then if a team wants to manage installations of bundles together, they would use a storage plugin so that Porter isn't writing to ~/.porter.
Ok, I've updated our Dockerfile
to explicitly install Porter as the user being used within the container, and things work more smoothly now. Thanks for the help!
In a VS Codespace (a Linux VM), I get the below failure. Any idea how to go about diagnosing failures in the storage migration or understanding which schema, in particular, Porter is have trouble with? (I haven't come across much documentation of the schemas themselves.)