Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SALT] provision after change in issue #7833 breaks #8244

Closed
dsaard opened this issue Oct 18, 2019 · 6 comments
Closed

[SALT] provision after change in issue #7833 breaks #8244

dsaard opened this issue Oct 18, 2019 · 6 comments
Labels
bug community-supported-plugin denotes requests for plugins that are supported by the community, not by HashiCorp engineers remote-plugin/salt

Comments

@dsaard
Copy link

dsaard commented Oct 18, 2019

Overview of the Issue

After the change in issue #7833 i could not upload the state tree

Build 'virtualbox-iso' errored: Error uploading local state tree to remote: Process exited with status 1
1.4.2 works as expected at GNU/Linux hosts

at macos with 1.4.2 1.4.3 and 1.4.3

Build 'virtualbox-iso' errored: Error uploading local state tree to remote: lstat /media: no such file or directory
😳

This error occurred with builder

virtualbox-iso
vagrant with virtualbox
vagrant with parallels

Reproduction Steps

create centos7.json with salt-masterless provisioner

{
    "provisioners": [
        {
            "type": "salt-masterless",
            "local_state_tree": "/Users/dsaard/source/git/infra/salt/states",
            "local_pillar_roots": "/Users/dsaars/source/git/infra/salt/pillar",
            "skip_bootstrap": false,
            "log_level": "debug",
            "minion_config": "config/minion"
        }
    ],
    "builders": [
        {
            "communicator": "ssh",
            "type": "vagrant",
            "source_path": "generic/centos7",
            "skip_add": true,
            "provider": "virtualbox"
        }
    ]
}

Packer version

1.4.3
1.4.4

Operating system and Environment details

Debian 10
MacOs 10.15

Log Fragments and crash.log files

    vagrant: Uploading local state tree: /Users/dsaar/source/git/infra/salt/states
2019/10/18 10:24:14 packer: 2019/10/18 10:24:14 [DEBUG] Upload dir '/Users/dsaar/source/mgr/git/infra/salt/states' to 'states'
2019/10/18 10:24:14 packer: 2019/10/18 10:24:14 [DEBUG] Opening new ssh session
2019/10/18 10:24:14 packer: 2019/10/18 10:24:14 [DEBUG] Starting remote scp process:  scp -rvt states
2019/10/18 10:24:14 packer: 2019/10/18 10:24:14 [DEBUG] Started SCP session, beginning transfers...
2019/10/18 10:24:14 packer: 2019/10/18 10:24:14 [DEBUG] No trailing slash, creating the source directory name
2019/10/18 10:24:14 packer: 2019/10/18 10:24:14 [DEBUG] SCP: starting directory upload: states
2019/10/18 10:24:14 [INFO] (telemetry) ending salt-masterless
==> vagrant: Provisioning step had errors: Running the cleanup provisioner, if present...
==> vagrant: destroying Vagrant box...
2019/10/18 10:24:14 packer: 2019/10/18 10:24:14 Calling Vagrant CLI: []string{"destroy", "-f", "source"}
2019/10/18 10:24:21 packer: 2019/10/18 10:24:21 [vagrant driver] stdout: ==> source: Forcing shutdown of VM...
2019/10/18 10:24:21 packer: ==> source: Destroying VM and associated drives...
2019/10/18 10:24:21 packer: 2019/10/18 10:24:21 [vagrant driver] stderr:
==> vagrant: Deleting output directory...
2019/10/18 10:24:21 [INFO] (telemetry) ending vagrant
Build 'vagrant' errored: Error uploading local state tree to remote: lstat /media: no such file or directory

2019/10/18 10:24:21 machine readable: error-count []string{"1"}
==> Some builds didn't complete successfully and had errors:
2019/10/18 10:24:21 machine readable: vagrant,error []string{"Error uploading local state tree to remote: lstat /media: no such file or directory"}
==> Some builds didn't complete successfully and had errors:
==> Builds finished but no artifacts were created.
--> vagrant: Error uploading local state tree to remote: lstat /media: no such file or directory
@SwampDragons
Copy link
Contributor

Yeah we should probably revert #7833 for now since it's a less common use case than the one it breaks.

@gaetanquentin
Copy link

the same with lxd+salt serverless+ Packer v1.4.4

@ephur
Copy link

ephur commented Jan 16, 2020

Packer 1.5.1, using Azure provider, Salt masterless provisioner, with Ubuntu 18.04 LTS base image is also unable to build with this same error. Stuck at using packer 1.4.2 or older.

@rrrmatt
Copy link

rrrmatt commented Jun 11, 2020

I ran in to this same issue but have a quick workaround that is usable with Packer 1.5.6:
In the salt-masterless provisioner config, add these options (or whatever directories you'd like):
"temp_config_dir": "/tmp/packer_upload",
"remote_pillar_roots": "/tmp/pillar",
"remote_state_tree": "/tmp/salt",

The upload and the mv work correctly, and the salt-call gets the proper "--file-root=/tmp/salt --pillar-root=/tmp/pillar" options added.

@nywilken nywilken added the community-supported-plugin denotes requests for plugins that are supported by the community, not by HashiCorp engineers label Nov 18, 2020
@nywilken
Copy link
Contributor

Hello folks, thanks for opening up this issue. Apologies that we've not had the chance to dive further into this issue. If you've managed to resolve your problem we encourage you to leave comment for others who may experience this issue in the future.

With that said, this is one of our community maintained plugins, which we have recently flagged as unmaintained. If you are interested in contributing or taking ownership of this plugin, please reach out to us at packer@hashicorp.com.

@github-actions
Copy link

github-actions bot commented Nov 9, 2021

This issue has been migrated to hashicorp/packer-plugin-salt#23 due to the Packer Plugin split.

Please follow the new issue for updates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug community-supported-plugin denotes requests for plugins that are supported by the community, not by HashiCorp engineers remote-plugin/salt
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants