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

pretixSCAN on Android gives us troubles #5

Open
bennigraf opened this issue Aug 23, 2019 · 6 comments
Open

pretixSCAN on Android gives us troubles #5

bennigraf opened this issue Aug 23, 2019 · 6 comments

Comments

@bennigraf
Copy link

Hey Pretix-Team,

thanks for your great software! We're using the Community edition it to sell tickets for our music festival and generally it's a great experience :-).

But recently we updated to the latest version and I tried to use pretixSCAN instead of pretixdroid. The iOS version works without problems, but on Android the app cannot seem to load all data from the backend. Registering the device works, but during sync when trying to "Download orders" the process breaks and shows the message "Unknown server response". (There's a really quick message like "Processed 50 orders…" which is barely noticable in between.) The app then states "noch nie synchronisiert" and repeating the process leads to the same result. The backend shows the following log entry twice: WARNING 2019-08-23 12:50:30,755 django.request log Unauthorized: /api/v1/organizers/[event]/events/2019/orders/ – but I cannot seem to find any more detailed error explanation.

(pretixdroid still works nicely, so we can fallback to this for now.)

We're running the latest pretix and pretixSCAN on Android.

Is this a bug? Do you have any suggestion of how I could further debug this issue?

Best and thanks,
Benjamin.

@raphaelm
Copy link
Member

Hmm, this is not a known bug, weird. Is there anything else in the look that looks suspicious at that time?

@bennigraf
Copy link
Author

No, nothing that I can find. But I only checked the gunicorn stderr output (which is logged by supervisord) and the pretix.log file in the data/ directory, which seems to contain the same information.

Pretix runs with loglevel=info btw. - are there maybe other logging locations that I'm not aware of that I could check?

@raphaelm
Copy link
Member

What version of pretix are you running? Can you maybe post nginx access logs to see the full pattern of the synchronization?

@bennigraf
Copy link
Author

bennigraf commented Aug 27, 2019

pretix is at 3.0.1

nginx access logs:

[ip] - - [27/Aug/2019:20:20:13 +0200] "GET /api/v1/organizers/[organizer]/events/[event]/ HTTP/2.0" 200 655 "-" "okhttp/3.12.1"
[ip] - - [27/Aug/2019:20:20:13 +0200] "GET /api/v1/organizers/[organizer]/events/[event]/categories/ HTTP/2.0" 304 0 "-" "okhttp/3.12.1"
[ip] - - [27/Aug/2019:20:20:13 +0200] "GET /api/v1/organizers/[organizer]/events/[event]/items/ HTTP/2.0" 304 0 "-" "okhttp/3.12.1"
[ip] - - [27/Aug/2019:20:20:13 +0200] "GET /api/v1/organizers/[organizer]/events/[event]/questions/ HTTP/2.0" 304 0 "-" "okhttp/3.12.1"
[ip] - - [27/Aug/2019:20:20:13 +0200] "GET /api/v1/organizers/[organizer]/events/[event]/badgelayouts/ HTTP/2.0" 200 52 "-" "okhttp/3.12.1"
[ip] - - [27/Aug/2019:20:20:13 +0200] "GET /api/v1/organizers/[organizer]/events/[event]/checkinlists/ HTTP/2.0" 200 713 "-" "okhttp/3.12.1"
[ip] - - [27/Aug/2019:20:20:14 +0200] "GET /api/v1/organizers/[organizer]/events/[event]/orders/?pdf_data=true&testmode=false&ordering=datetime&created_since=2019-08-07T19%3A45%3A27.830351Z HTTP/2.0" 200 21527 "-" "okhttp/3.12.1"
[ip] - - [27/Aug/2019:20:20:14 +0200] "GET /api/v1/organizers/[organizer]/events/[event]/orders/?created_since=2019-08-07T19%3A45%3A27.830351Z&ordering=datetime&page=2&pdf_data=true&testmode=false HTTP/2.0" 401 58 "-" "okhttp/3.12.1"

So it only fails on page=2 of /orders

@bennigraf
Copy link
Author

Making that request with a manually created authentication token (as in https://docs.pretix.eu/en/latest/api/tokenauth.html) works and returns meaningful data.

I just also tried doing the "Device Authentication" as in https://docs.pretix.eu/en/latest/api/deviceauth.html, but making the requests manually (with Insomnia)… There it works as expected as well (so no 401 error…).

I was able to reproduce the error with another android device, though (a Lenovo Tablet, same behaviour as described above).

@raphaelm
Copy link
Member

So it only fails on page=2 of /orders…

It's getting even weirder… The only thing I can imagine is that the Authorization header is missing for that request for some weird reason. However, I can't see why, all of them should go through https://github.com/pretix/libpretixsync/blob/master/libpretixsync/src/main/java/eu/pretix/libpretixsync/api/PretixApi.java#L186

@raphaelm raphaelm transferred this issue from pretix/pretix Sep 10, 2019
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

2 participants