Hi again Tekchand,

Thanks for your answer. It looks like you are still looking into the SSH
connection side. My advice was to look into the file permission problem, cf
for instance
https://stackoverflow.com/questions/20276895/could-not-create-work-tree-dir-example-com-permission-denied
which
details what I was mentioning.

You also said:

> As per my knowledge, when we clone git as deploy user then the ownership
> of the file (directory) should be deploy by default if it able to fetch the
> repository.


You are correct about the permission issue (i.e. the ownership of the
file/directory should be that of the 'deploy' user). My feeling is that you
get the error because the directory you are cloning into does not have
proper write permissions for the 'deploy' user. This is the reason I was
asking where you were cloning in. Unless you manually cd into a directory
of your choice, you can't know where you will end up (maybe this is '/' you
are cloning in ...).

In short, to me, if it were a connection issue w/ SSH you would not get a
'permission denied' problem when creating the directory, rather sth like
'connection refused' or something similar.

Let us know how it goes,

Vincent

On Wed, Jan 2, 2019 at 9:20 PM Tekchand Dagar <[email protected]>
wrote:

> Hello Vincent,
>
> Thank you for your response.
>
> *fatal: could not create work tree dir 'test-packr-clone': Permission
> denied"*
>
> *'test-packr-clone'* is the repository which i need to clone in my image.
> Please refer the attached file for permission details which is created by
> ansible playbook.
>
> As per my knowledge, when we clone git as deploy user then the ownership
> of the file (directory) should be deploy by default if it able to fetch the
> repository.
>
> The issue i am facing is how I can fetch my code from Gitlab during image
> creation still i am out of ideas.
>
> On Wednesday, January 2, 2019 at 11:02:52 PM UTC+5:30, Vincent Rubiolo
> wrote:
>>
>> Hi  Tekchand,
>>
>> Rickard already provided a lot of useful information about the SSH
>> connection. On my end, I wanted to ask: could this be a file permission
>> issue?
>> I see
>>
>>> *fatal: could not create work tree dir 'test-packr-clone': Permission
>>> denied"*
>>
>> which hints to me at a file permission problem when creating the clone
>> (i.e during sth like 'mkdir').
>>
>> Which directory are you calling the 'git clone' command from (this is not
>> obvious from your Playbook)? I'd check you have write rights to that
>> directory with your user or switch to one where you do.
>>
>> HTH,
>>
>> Vincent
>>
> --
> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/1c520210-7c8d-4bdf-ab72-8259bcf53f7c%40googlegroups.com
> <https://groups.google.com/d/msgid/packer-tool/1c520210-7c8d-4bdf-ab72-8259bcf53f7c%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 

--------
*Vincent Rubiolo*
Senior Platform Engineer
www.datameer.com
Slack: Vincent





Datameer, Inc.
577 2nd Street, Suite 200, San Francisco, CA 94107

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CADZPgZfhQYm5A8iz08fXVSAXwCDHx4rX50MraaaXQMu28%3Di90Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to