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

Error to fetch transactions #26

Closed
nathanmarcos opened this issue Dec 5, 2019 · 3 comments
Closed

Error to fetch transactions #26

nathanmarcos opened this issue Dec 5, 2019 · 3 comments

Comments

@nathanmarcos
Copy link

Fetching balance is working like a charm, but when I tried to fetch the transactions I got this error:

➜ docker run -ti guitmz/n26 transactions
N26 username: my@username.com
N26 password: ********
panic: time: missing Location in call to Time.In

goroutine 1 [running]:
time.Time.In(...)
	/usr/local/go/src/time/time.go:1126
github.com/guitmz/n26.(*TimeStamp).UnmarshalJSON(0xc00038c878, 0xc00051212d, 0xd, 0x3cd3, 0x7f94571a6908, 0xc00038c878)
	/go/src/github.com/guitmz/n26/timestamp.go:27 +0x305
encoding/json.(*decodeState).literalStore(0xc0001ee370, 0xc00051212d, 0xd, 0x3cd3, 0x8378e0, 0xc00038c878, 0x199, 0x100, 0x2480, 0xc0001ee398)
	/usr/local/go/src/encoding/json/decode.go:918 +0x2b7b
encoding/json.(*decodeState).value(0xc0001ee370, 0x8378e0, 0xc00038c878, 0x199, 0x8378e0, 0xc00038c878)
	/usr/local/go/src/encoding/json/decode.go:443 +0x1de
encoding/json.(*decodeState).object(0xc0001ee370, 0x83af40, 0xc00038c800, 0x199, 0x846615, 0xb)
	/usr/local/go/src/encoding/json/decode.go:823 +0x1392
encoding/json.(*decodeState).value(0xc0001ee370, 0x83af40, 0xc00038c800, 0x199, 0x83af40, 0xc00038c800)
	/usr/local/go/src/encoding/json/decode.go:429 +0x6d
encoding/json.(*decodeState).array(0xc0001ee370, 0x79a240, 0xc0000920f8, 0x16, 0xc0001ee398, 0x5b)
	/usr/local/go/src/encoding/json/decode.go:616 +0x1ac
encoding/json.(*decodeState).value(0xc0001ee370, 0x79a240, 0xc0000920f8, 0x16, 0xc0000e5428, 0x501549)
	/usr/local/go/src/encoding/json/decode.go:419 +0xfd
encoding/json.(*decodeState).unmarshal(0xc0001ee370, 0x79a240, 0xc0000920f8, 0xc0001ee398, 0x0)
	/usr/local/go/src/encoding/json/decode.go:179 +0x1fb
encoding/json.Unmarshal(0xc000512000, 0x2480, 0x3e00, 0x79a240, 0xc0000920f8, 0xc0000e5538, 0xc000512000)
	/usr/local/go/src/encoding/json/decode.go:106 +0x112
github.com/guitmz/n26.(*Client).GetTransactions(0xc00026f110, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x841160, 0x2, 0x7f945739d178, ...)
	/go/src/github.com/guitmz/n26/api.go:377 +0x44b
github.com/guitmz/n26.(*Client).GetLastTransactions(...)
	/go/src/github.com/guitmz/n26/api.go:360
main.main.func8(0xc0000b89a0, 0x0, 0xc0000947b0)
	/go/src/github.com/guitmz/n26/cmd/n26/n26.go:273 +0x4da
github.com/urfave/cli.HandleAction(0x7bdb40, 0x8610c0, 0xc0000b89a0, 0xc0000b89a0, 0x0)
	/go/src/github.com/urfave/cli/app.go:523 +0xbe
github.com/urfave/cli.Command.Run(0x846e02, 0xc, 0x0, 0x0, 0x0, 0x0, 0x0, 0x85645d, 0x31, 0x0, ...)
	/go/src/github.com/urfave/cli/command.go:174 +0x51c
github.com/urfave/cli.(*App).Run(0xc000118000, 0xc000088020, 0x2, 0x2, 0x0, 0x0)
	/go/src/github.com/urfave/cli/app.go:276 +0x725
main.main()
	/go/src/github.com/guitmz/n26/cmd/n26/n26.go:365 +0x58c
@hosackm
Copy link
Contributor

hosackm commented Nov 25, 2021

This is because the Alpine image is missing tzdata. You have to install it in order to access the Europe/Berlin timezone they are using.

To fix it:

  1. Add tzdata to the end of RUN apk add no-cache ca-certificates in the Dockerfile
  2. Build the image again with: docker build . -t guitmz/n26
  3. Run it as usual

hosackm added a commit to hosackm/n26 that referenced this issue Nov 26, 2021
When performing a `transaction` request n26 does some timestamp modification to make the timestamp relevant to the user's timezone. This operation requires certain files to be in place to resolve the "Europe/Berlin" timezone.  If they are absent [this issue](guitmz#26) arises.

On Alpine Image these files are provided by the `tzdata` package.  Adding this package in the n26 `Dockerfile` fixes the issue.
@guitmz
Copy link
Owner

guitmz commented Nov 29, 2021

closed via #34

@guitmz guitmz closed this as completed Nov 29, 2021
@garylewisnz
Copy link

Its weird, I have exactly this same problem as described above, but I'm running the file with its current release aka. this fix is included. Are you facing the same issue? I have exactly the same error code as above. Running on an M1 Mac.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants