Skip to content

Text search API v1 returns HTTP 500 when requesting nutriments #13107

@Drexel2k

Description

@Drexel2k

What

When requesting nutriments field on text search API v1, the resposne is HTTP 500 with this body:
Software error:
Not a reference at /opt/product-opener/lib/ProductOpener/API.pm line 1023.
For help, please send mail to the webmaster (contact@openfoodfacts.net), giving this error message and the time and date of the error.

Steps to reproduce the behavior

  1. Go to

https://world.openfoodfacts.net/cgi/search.pl?json=1&search_simple=1&search_terms=cola&fields=code,product_name,product_name_en,product_name_de,abbreviated_product_name,abbreviated_product_name_en,abbreviated_product_name_de,generic_name,generic_name_en,generic_name_de,brands_tags,quantity,product_quantity,product_quantity_unit,serving_size,serving_quantity,serving_quantity_unit,nutrition_data_per,lang,nutriments.energy,nutriments.energy_100g,nutriments.carbohydrates,nutriments.carbohydrates_100g,nutriments.sugars,nutriments.sugars_100g,nutriments.fat,nutriments.fat_100g,nutriments.saturated-fat,nutriments.saturated-fat_100g,nutriments.proteins,nutriments.proteins_100g,nutriments.salt,nutriments.salt_100g&page=1&page_size=100

A few days ago this worked.

This request still works:

https://world.openfoodfacts.net/cgi/search.pl?json=1&search_simple=1&search_terms=cola&fields=code,product_name,product_name_en,product_name_de,abbreviated_product_name,abbreviated_product_name_en,abbreviated_product_name_de,generic_name,generic_name_en,generic_name_de,brands_tags,quantity,product_quantity,product_quantity_unit,serving_size,serving_quantity,serving_quantity_unit,nutrition_data_per,lang&page=1&page_size=100

Expected behavior

The result of request 1 should be similar to request 2 and not result in an error.

Type of device

I am using this API in a Flutter app with Flutter 3.38.9 and Android 16 on the emulator and on my real device, a Pixel 7 Pro.
Also by accessing the API via Chrome Browser Version 145.0.7632.76 the problem exists.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status

    To discuss and validate

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions