Southclaws / sampctl

The Swiss Army Knife of SA:MP - vital tools for any server owner or library maintainer.
GNU General Public License v3.0
242 stars 33 forks source link

Panic: CreatingFile #402

Closed tr1xy closed 3 years ago

tr1xy commented 4 years ago

In ref. to #244 sampctl 1.9.0

panic: CreateFile C:\xx\dependencies\SA-MP-MySQL: Access is denied.

goroutine 1 [running]:
github.com/Southclaws/sampctl/util.Exists(0xc00108cc40, 0x39, 0xc0000278f0)
        /home/michael/repos/sampctl/util/util.go:94 +0xc4
github.com/Southclaws/sampctl/rook.PackageContext.ensureRepoExists(0x1, 0xc0000a6660, 0x20, 0xc0000a6c30, 0x2d, 0xc0000a6746, 0x4, 0x0, 0x0, 0xc000d8ca80, ...)
        /home/michael/repos/sampctl/rook/cache.go:200 +0x67b
github.com/Southclaws/sampctl/rook.PackageContext.ensureRepoExists(0x1, 0xc0000a6660, 0x20, 0xc0000a6c30, 0x2d, 0xc0000a6746, 0x4, 0x0, 0x0, 0xc000d8ca80, ...)
        /home/michael/repos/sampctl/rook/cache.go:252 +0x368
github.com/Southclaws/sampctl/rook.PackageContext.EnsureDependencyFromCache(0x1, 0xc0000a6660, 0x20, 0xc0000a6c30, 0x2d, 0xc0000a6746, 0x4, 0x0, 0x0, 0xc000d8ca80, ...)
        /home/michael/repos/sampctl/rook/cache.go:178 +0x384
github.com/Southclaws/sampctl/rook.(*PackageContext).updateRepoState(0xc00012cb00, 0xc00043ef90, 0xc42088, 0xa, 0xc00059fc00, 0x6, 0xc00059fc07, 0xb, 0xc00059fc00, 0x0, ...)
        /home/michael/repos/sampctl/rook/ensure.go:219 +0x1163
github.com/Southclaws/sampctl/rook.(*PackageContext).EnsurePackage(0xc00012cb00, 0xc42088, 0xa, 0xc00059fc00, 0x6, 0xc00059fc07, 0xb, 0xc00059fc00, 0x0, 0xc00059fc13, ...)
        /home/michael/repos/sampctl/rook/ensure.go:131 +0x3c5
github.com/Southclaws/sampctl/rook.(*PackageContext).EnsureDependencies.func1(0x8, 0xc00041f250)
        /home/michael/repos/sampctl/rook/ensure.go:42 +0x14f
gopkg.in/eapache/go-resiliency.v1/retrier.(*Retrier).Run.func1(0xd5d120, 0xc000090098, 0xbe2c40, 0x1484e201)
        /home/michael/go/pkg/mod/gopkg.in/eapache/go-resiliency.v1@v1.2.0/retrier/retrier.go:41 +0x2d
gopkg.in/eapache/go-resiliency.v1/retrier.(*Retrier).RunCtx(0xc000f18cc0, 0xd5d120, 0xc000090098, 0xc000e37da0, 0xbfc288809484e248, 0xc00043ef00)
        /home/michael/go/pkg/mod/gopkg.in/eapache/go-resiliency.v1@v1.2.0/retrier/retrier.go:53 +0x4c
gopkg.in/eapache/go-resiliency.v1/retrier.(*Retrier).Run(0xc000f18cc0, 0xc000e37e60, 0x1, 0xd4df20)
        /home/michael/go/pkg/mod/gopkg.in/eapache/go-resiliency.v1@v1.2.0/retrier/retrier.go:39 +0x72
github.com/Southclaws/sampctl/rook.(*PackageContext).EnsureDependencies(0xc00012cb00, 0xd5d120, 0xc000090098, 0xc00014d501, 0x0, 0x0)
        /home/michael/repos/sampctl/rook/ensure.go:40 +0x237
github.com/Southclaws/sampctl/rook.(*PackageContext).Install(0xc00012cb00, 0xd5d120, 0xc000090098, 0xc000d4e860, 0x1, 0x1, 0xc40a00, 0x7, 0xc00059f960)
        /home/michael/repos/sampctl/rook/install.go:57 +0x41f
github.com/Southclaws/sampctl/commands.packageInstall(0xc0000fc580, 0x0, 0x0)
        /home/michael/repos/sampctl/commands/package_install.go:61 +0x30d
gopkg.in/urfave/cli%2ev1.HandleAction(0xb217a0, 0xc732c0, 0xc0000fc580, 0xc0006ecc00, 0x0)
        /home/michael/go/pkg/mod/gopkg.in/urfave/cli.v1@v1.20.0/app.go:490 +0xcf
gopkg.in/urfave/cli%2ev1.Command.Run(0xc40864, 0x7, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc5ed92, 0x2c, 0x0, ...)
        /home/michael/go/pkg/mod/gopkg.in/urfave/cli.v1@v1.20.0/command.go:210 +0x9ef
gopkg.in/urfave/cli%2ev1.(*App).RunAsSubcommand(0xc00014c340, 0xc0000fc160, 0x0, 0x0)
        /home/michael/go/pkg/mod/gopkg.in/urfave/cli.v1@v1.20.0/app.go:379 +0x892
gopkg.in/urfave/cli%2ev1.Command.startApp(0xc40928, 0x7, 0x0, 0x0, 0xc000d4e350, 0x1, 0x1, 0xc518f8, 0x1c, 0x0, ...)
        /home/michael/go/pkg/mod/gopkg.in/urfave/cli.v1@v1.20.0/command.go:298 +0x821
gopkg.in/urfave/cli%2ev1.Command.Run(0xc40928, 0x7, 0x0, 0x0, 0xc000d4e350, 0x1, 0x1, 0xc518f8, 0x1c, 0x0, ...)
        /home/michael/go/pkg/mod/gopkg.in/urfave/cli.v1@v1.20.0/command.go:98 +0x1220
gopkg.in/urfave/cli%2ev1.(*App).Run(0xc00014c1a0, 0xc0000c4000, 0x4, 0x4, 0x0, 0x0)
        /home/michael/go/pkg/mod/gopkg.in/urfave/cli.v1@v1.20.0/app.go:255 +0x748
github.com/Southclaws/sampctl/commands.Run(0xc0000c4000, 0x4, 0x4, 0xd353e8, 0x5, 0x0, 0x0)
        /home/michael/repos/sampctl/commands/app.go:298 +0x1702
main.main()
        /home/michael/repos/sampctl/main.go:15 +0x68
ADRFranklin commented 4 years ago

This is a permissions issue and not actually the fault of sampctl, this normally happens when you try to manually modify files in the dependency directory, or another applications does.

This can also happen if the file becomes corrupted due to a internet drop. The solution is to delete the folder and let it do it again.

tr1xy commented 4 years ago

Actually I just need to write the same command again and it'll work

First sampctl p install fails while second doesn't