shell-local post-provisioner strange behaviour

42 views
Skip to first unread message

fab73

unread,
Aug 30, 2016, 8:58:46 AM8/30/16
to Packer
Hi,

I need to upload my boxes to GDrive, and as first step I'm doing it with a shell-local post-provisioner, so I've written this simple bash script [1], that uses the gdrive [2] utility to do the real work, now it runs fine when invoked directly form the CLI, instead when invoked by packer it starts the upload but it is not able to complete it, I've tried many times to exclude temporary errors, but the results are consistent.

gdrive gave a could of return error, that seems related to a broken connection:
- unexpected EOF
- remote error: bad record MAC

Is there any particular difference running a shell script via shell-local, that could affect the upload? or do you have any other hint?

Thanks,
 Fabio



Rickard von Essen

unread,
Aug 30, 2016, 9:08:17 AM8/30/16
to packe...@googlegroups.com
Can you run:
gdrive <same args> | less
in a terminal?

Some interactive command line tools won't run properly without a pty. If that is the case you can try
unbuffer gdrive <same args> | less
in a terminal. (unbuffer is part of the `expect` package)

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/813cddc9-e4b7-42c8-93bc-7d07c72c40e1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

fab73

unread,
Aug 30, 2016, 9:35:36 AM8/30/16
to Packer
The script is not interactive, it only produces some text output.

Here [1] there is the packer debug log, and here [2] the same command executed by packer directly on the shell.

I'll try you "unbuffer" suggestion.

thanks




On Tuesday, August 30, 2016 at 3:08:17 PM UTC+2, Rickard von Essen wrote:
Can you run:
gdrive <same args> | less
in a terminal?

Some interactive command line tools won't run properly without a pty. If that is the case you can try
unbuffer gdrive <same args> | less
in a terminal. (unbuffer is part of the `expect` package)
On 30 August 2016 at 14:58, fab73 <po...@fab.io> wrote:
Hi,

I need to upload my boxes to GDrive, and as first step I'm doing it with a shell-local post-provisioner, so I've written this simple bash script [1], that uses the gdrive [2] utility to do the real work, now it runs fine when invoked directly form the CLI, instead when invoked by packer it starts the upload but it is not able to complete it, I've tried many times to exclude temporary errors, but the results are consistent.

gdrive gave a could of return error, that seems related to a broken connection:
- unexpected EOF
- remote error: bad record MAC

Is there any particular difference running a shell script via shell-local, that could affect the upload? or do you have any other hint?

Thanks,
 Fabio



--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool...@googlegroups.com.

fab73

unread,
Aug 30, 2016, 11:39:05 AM8/30/16
to Packer
Also with unbuffer I got the same error.

Rickard von Essen

unread,
Aug 30, 2016, 1:25:12 PM8/30/16
to packe...@googlegroups.com
This works for me:

{
  "builders": [
    {
      "type": "file",
      "content": "Noting to see here! Move along!",
      "target": "dummy_artifact"
    }
  ],
  "post-processors": [
    {
      "type": "shell-local",
      "inline": "gdrive upload dummy_artifact"
    }
  ]
}

Could you run with debug logging:
PACKER_LOG=1 packer build template.json

and gist the log and your template.json?

To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/5754c8c2-d846-470c-a71d-79595f44f390%40googlegroups.com.
Message has been deleted
Message has been deleted

fab73

unread,
Aug 31, 2016, 11:40:10 AM8/31/16
to Packer
I was able to isolate the problem, that is in the Polipo[1] proxy cache server that I am using to speedup packer development.
Disabling the proxy only for the upload solved my problem, now the analysis is on the interaction between polipo and gdrive.

Thanks for the support.

Reply all
Reply to author
Forward
0 new messages