wallix / awless

A Mighty CLI for AWS
http://awless.io/
Apache License 2.0
4.98k stars 263 forks source link

panic during sync on Windows #119

Closed dkew8 closed 7 years ago

dkew8 commented 7 years ago
$ rm -rf .awless/

$ awless.exe -e sync
Welcome to awless! Resolving environment data...

Found existing AWS region 'us-east-1'. Setting it as your default region.
[verbose] loading AWS session with profile 'default' and region 'us-east-1'
[info]    Syncing new region 'us-east-1'
[verbose] sync: *disabled* for resource storage[s3object]
[extra]   sync: fetched lambda service took 269.0336ms
[extra]   sync: fetched dns service took 276.5326ms
[extra]   sync: fetched cloudformation service took 287.5369ms
[extra]   sync: fetched cdn service took 347.1517ms
[extra]   sync: fetched access service took 366.6602ms
[extra]   sync: fetched messaging service took 385.1643ms
[extra]   sync: fetched storage service took 995.9326ms
[extra]   sync: fetched infra service took 2.8418032s
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x0 pc=0x119d026]

goroutine 1 [running]:
github.com/wallix/awless/vendor/gopkg.in/src-d/go-git%2ev4.(*Worktree).doUpdateFileToIndex(0xc04f2893c0, 0xc0552d4f00, 0xc053dbdc60, 0x1b, 0x389c2dd8ac8e3adb, 0x869777e1faa58760, 0x7dcbda7d, 0x1, 0x0)
        /home/simon/go/src/github.com/wallix/awless/vendor/gopkg.in/src-d/go-git.v4/worktree_status.go:351 +0x156
github.com/wallix/awless/vendor/gopkg.in/src-d/go-git%2ev4.(*Worktree).doAddFileToIndex(0xc04f2893c0, 0xc04f509200, 0xc053dbdc60, 0x1b, 0x389c2dd8ac8e3adb, 0x869777e1faa58760, 0x7dcbda7d7dcbda7d, 0xc045fdb520, 0x0)
        /home/simon/go/src/github.com/wallix/awless/vendor/gopkg.in/src-d/go-git.v4/worktree_status.go:331 +0xe4
github.com/wallix/awless/vendor/gopkg.in/src-d/go-git%2ev4.(*Worktree).addOrUpdateFileToIndex(0xc04f2893c0, 0xc053dbdc60, 0x1b, 0x389c2dd8ac8e3adb, 0x869777e1faa58760, 0x7dcbda7d, 0x0, 0x0)
        /home/simon/go/src/github.com/wallix/awless/vendor/gopkg.in/src-d/go-git.v4/worktree_status.go:315 +0x253
github.com/wallix/awless/vendor/gopkg.in/src-d/go-git%2ev4.(*Worktree).Add(0xc04f2893c0, 0xc053dbdc60, 0x1b, 0x0, 0x0, 0xc000000000, 0x15, 0x1)
        /home/simon/go/src/github.com/wallix/awless/vendor/gopkg.in/src-d/go-git.v4/worktree_status.go:241 +0x1ac
github.com/wallix/awless/sync/repo.(*gitRepo).Commit(0xc0423b5c00, 0xc04d547e00, 0x8, 0x8, 0x15, 0x180)
        /home/simon/go/src/github.com/wallix/awless/sync/repo/repo.go:175 +0xaf
github.com/wallix/awless/sync.(*syncer).Sync(0xc0423b5c20, 0xc0422d5800, 0x9, 0x10, 0xc0423b5c20, 0xc0422d5800, 0x8)
        /home/simon/go/src/github.com/wallix/awless/sync/sync.go:142 +0x1369
github.com/wallix/awless/commands.initCloudServicesHook(0x21e9f00, 0xc0422a0fb0, 0x0, 0x1, 0x0, 0x0)
        /home/simon/go/src/github.com/wallix/awless/commands/hooks.go:84 +0x3e2
github.com/wallix/awless/commands.applyHooks.func1(0x21e9f00, 0xc0422a0fb0, 0x0, 0x1)
        /home/simon/go/src/github.com/wallix/awless/commands/hooks.go:35 +0x79
github.com/wallix/awless/vendor/github.com/spf13/cobra.(*Command).execute(0x21e9f00, 0xc0422a0f90, 0x1, 0x1, 0x21e9f00, 0xc0422a0f90)
        /home/simon/go/src/github.com/wallix/awless/vendor/github.com/spf13/cobra/command.go:633 +0x4dc
github.com/wallix/awless/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0x21e78c0, 0x169ca10, 0x0, 0x0)
        /home/simon/go/src/github.com/wallix/awless/vendor/github.com/spf13/cobra/command.go:737 +0x340
github.com/wallix/awless/vendor/github.com/spf13/cobra.(*Command).Execute(0x21e78c0, 0xc04201a000, 0xc04201a000)
        /home/simon/go/src/github.com/wallix/awless/vendor/github.com/spf13/cobra/command.go:695 +0x32
main.main()
        /home/simon/go/src/github.com/wallix/awless/main.go:22 +0x34

latest awless release

$ awless.exe --version
awless version=v0.1.1, commit=e4981514f29034deaf6466aff60b9909a0e7810a, build-date=2017-07-06T17:30:00+02:00, build-arch=amd64, build-os=windows, build-for=zip
dkew8 commented 7 years ago

I'm not sure if it's the same issue as https://github.com/wallix/awless/issues/116 or not.

simcap commented 7 years ago

It shows we should do more testing on the Windows platform!

This panic is due to the go-git library we use not playing nice in this case on Windows.

We use this library since we want to not only sync cloud data locally (in ~/.awless/aws/rdf/) but keep revisions of them. That is why on each sync we commit to a local repo.

This feature - that we experimented but is not prod ready yet - is intended to navigate and compare your resources through time (and other goodies).

It means the [synchronisation of cloud data + keeping revision] is not working on the Windows platform for awless as for now.

We will look into that to see if we can have a proper fix.

If nothing is workable we might deactivate the commit/revision of cloud data temporarily. On Windows awless would then work fully since we could sync and have data locally (but they would not be under a git repo).

simcap commented 7 years ago

@dkew8 I have disabled the git commit on sync when on Windows.

It will be included in the next release. In the meantime, you can get the master which is always relatively stable.

You can try it and let me know if that works for you.

mcuadros commented 7 years ago

10 days ago, we release a version with some windows fixes, and in the next release we are fixing a lot of more. In the coming weeks solve 100% compatible.

simcap commented 7 years ago

@mcuadros Thanks for the work. We'll synchronize on your latest releases.