-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Barcode scan network error #895
Comments
"No response from server" means that the Open Food Facts website is down. This happens from time to time. There is nothing we can do about it. |
you're probably right. However, I should have mentioned I have checked status.openfoodfacts.org before I made this Issue and everything looked fine a few days ago. Waistline has not been able to reach OFF for several days now. But looking at OFF server status now shows several incidents reported over the last two days... |
Also hitting this. Other tools are working with OFF though e.g. https://git.justquitstudios.de/marco/calorimeter |
I think I have ruled out OFF servers being the problem.
However I found a couple other bugs. Before uninstalling I exported my Waistline database json and diary_export.csv, but
So maybe when I upgraded to 3.9.2 when it came out weeks ago, a database migration triggered something that broke barcode scanning??? 🤕 |
@jncosideout Wow, I'm very sorry you went through all those troubles. Unfortunately, you could have avoided them because there are perfectly fine explanations for what happened:
Probably just a coincidence. When Waistline sends search/barcode queries to OFF, it waits up to 15 seconds for a response. If the OFF server doesn't respond after 15 seconds, the request times out and Waistline displays an error message. So, during a time when OFF servers are having issues, it may very well happen that you try to scan a barcode and it fails, and when you try again one minute later it succeeds. This has nothing to do with the version downgrade to 3.9.1.
Exactly :)
What do you mean by "did nothing"? Not even an error message? Did it at least open the file picker or did nothing happen at all?
First of all, the file diary_export.csv is NOT an export of the database. The database export file is called waistline_export.json. The reason why you couldn't find the file is because most file manager apps on Android can't access the files under /Android/data/. You should be able to access them using the Files app from the Play Store or from APK mirror. Alternatively, you can use the new sharing feature that allows you to directly send the exported file to another app.
The import foods from JSON feature is something different and it expects a slightly different file format (see the user guide). So of course you can't just import the waistline_export.json file like that.
I'm on version 3.9.2 and I just exported my database and successfully imported it afterwards. Everything works as expected. Also, there a almost no differences between version 3.9.1 and 3.9.2. The only difference is in the food editor and unrelated to the database import or barcode scanning.
I think that's unlikely. |
I can confirm. If I clear the app storage and cache the barcode scanner works again. If I clear the storage and cache again and then import my backup then the scanner reports "No response from Server" I've attached my backup to help. |
Okay, I see what is going on now. The reason why you get the "no response from server" error is because there is a problem with the way Waistline handles the configured search country. When you scan a barcode, Waistline normally sends a request to the OFF server asking directly for the product with that barcode: https://world.openfoodfacts.org/api/v0/product/3017620425035.json However, if you have a non-default search country and/or search language configured, Waistline adds some parameters to the request. For example, like this: I think that's actually a bug in Waistline because these additional parameters only make sense when searching for a query string (like "nutella"), but not when directly searching for a barcode. Anyway, the reason you see the error message is because your search country is set to "United Kingdom" which has a space in it, and apparently the OFF server can't handle that and returns a bad request response (hence, Waistline shows "no response from server"): I'm pretty sure this was working in the past, so the most likely explaination is that OFF recently changed something that broke it. @Baggypants @jncosideout For now, please go to Settings > Integration and set the Search Country to "All". This should fix the problem until we have a proper solution. |
Setting country to "All" resolved the error. |
Description
Barcode scan search is not working. "No response from server" error message shown.
Reproduction Steps
Expected
App should search for the scanned barcode on OpenFoodFacts
Screenshots
Environment
App version: 3.9.2
Build: Installed from FDroid
Phone: Moto G7 Power
OS: "LineageOS with MicroG" 21 (LOS 21 is equivalent to stock Android 14)
The text was updated successfully, but these errors were encountered: