nextcloud-cookbook-flutter icon indicating copy to clipboard operation
nextcloud-cookbook-flutter copied to clipboard

Import Failed Exception: on some recipe imports

Open krisgesling opened this issue 1 year ago • 6 comments

Hey, first wanted to say thanks for the awesome app, absolutely loving it so far!

Issue description

When importing some recipes using the Android app, I'm seeing the following error displayed as a red bar at the bottom of the screen:

Import Failed Exception: type 'Null' is not a subtype of type 'String' in type cast

Without re-importing - navigating to the list of recipes shows that the initial import was successful.

I do not get this error if using the import function through the NextCloud Cookbook web interface eg https://exampledomain.com/apps/cookbook/#/

Example recipe:

  • https://www.taste.com.au/recipes/slow-roasted-capsicums-filled-mushroom-feta/e413060d-6aee-47f4-adbe-d0e5b8223f60

Error screenshot

Screenshot_20230405-105821

Additional details

  • Google Pixel 7
  • App from Play store - last updated 25 March 2023 (v0.7.9 according to the changelog)
  • Nextcloud v25.0.3
  • Cookbook app v0.10.2

krisgesling avatar Apr 05 '23 01:04 krisgesling

This should already be fixed on the develop branch but unfortunately a few restructures prevent a new release at the moment.

I'll add unit tests to make sure this can't happen again and hope that a new release is ready in one to two weeks.

Leptopoda avatar Apr 05 '23 10:04 Leptopoda

Ok never mind I can't reproduce this behavior on the master branch so far. further information is welcome :)

Leptopoda avatar Apr 05 '23 11:04 Leptopoda

Hmm, no repro = likely something in my setup then...

Some other urls that returned the same error:

  • https://www.easypeasyfoodie.com/mexican-roasted-sweet-potato-cubes/#recipe
  • https://www.thespruceeats.com/mexican-spice-mix-recipe-1809302#
  • https://cookieandkate.com/vegetarian-enchiladas-recipe/

Here's the error and preceding warnings from the NextCloud server logs for the capsicum recipe - IP and user have been redacted. Each of the urls above returned the same error, with slightly different libxml warnings as you'd expect. My assumption is that these warnings are expected and not related to the real issue but I'm including them for completeness.

[PHP] Error: Error: Undefined array key "id" at /var/www/nextcloud/apps/cookbook/lib/Helper/Filter/JSON/RecipeIdTypeFilter.php#15 at <<closure>>

 0. /var/www/nextcloud/apps/cookbook/lib/Helper/Filter/JSON/RecipeIdTypeFilter.php line 15
    OC\Log\ErrorHandler::onError()
 1. /var/www/nextcloud/apps/cookbook/lib/Helper/Filter/JSONFilter.php line 63
    OCA\Cookbook\Helper\Filter\JSON\RecipeIdTypeFilter->apply()
 2. /var/www/nextcloud/apps/cookbook/lib/Service/RecipeService.php line 177
    OCA\Cookbook\Helper\Filter\JSONFilter->apply()
 3. /var/www/nextcloud/apps/cookbook/lib/Service/RecipeService.php line 324
    OCA\Cookbook\Service\RecipeService->checkRecipe()
 4. /var/www/nextcloud/apps/cookbook/lib/Controller/Implementation/RecipeImplementation.php line 222
    OCA\Cookbook\Service\RecipeService->downloadRecipe()
 5. /var/www/nextcloud/apps/cookbook/lib/Controller/RecipeController.php line 85
    OCA\Cookbook\Controller\Implementation\RecipeImplementation->import()
 6. /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 225
    OCA\Cookbook\Controller\RecipeController->import()
 7. /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 133
    OC\AppFramework\Http\Dispatcher->executeController()
 8. /var/www/nextcloud/lib/private/AppFramework/App.php line 172
    OC\AppFramework\Http\Dispatcher->dispatch()
 9. /var/www/nextcloud/lib/private/Route/Router.php line 298
    OC\AppFramework\App::main()
10. /var/www/nextcloud/lib/base.php line 1047
    OC\Route\Router->match()
11. /var/www/nextcloud/index.php line 36
    OC::handleRequest()

POST /apps/cookbook/webapp/import
from REDACTED by REDACTED at 2023-04-05T01:32:05+00:00

This was preceded by the following warnings:

[cookbook] Warning: libxml: Error 76 occurred while parsing https://www.taste.com.au/recipes/slow-roasted-capsicums-filled-mushroom-feta/e413060d-6aee-47f4-adbe-d0e5b8223f60. First time it occurred in line 1453 and column 23: Unexpected end tag : div


POST /apps/cookbook/webapp/import
from REDACTED by REDACTED at 2023-04-05T01:32:05+00:00
[cookbook] Warning: libxml: Error 23 occurred 51 times while parsing https://www.taste.com.au/recipes/slow-roasted-capsicums-filled-mushroom-feta/e413060d-6aee-47f4-adbe-d0e5b8223f60. First time it occurred in line 688 and column 119: htmlParseEntityRef: expecting ';'


POST /apps/cookbook/webapp/import
from REDACTED by REDACTED at 2023-04-05T01:32:05+00:00
[cookbook] Warning: libxml: Error 42 occurred while parsing https://www.taste.com.au/recipes/slow-roasted-capsicums-filled-mushroom-feta/e413060d-6aee-47f4-adbe-d0e5b8223f60. First time it occurred in line 197 and column 203: Attribute cooker redefined


POST /apps/cookbook/webapp/import
from REDACTED by REDACTED at 2023-04-05T01:32:05+00:00
[cookbook] Warning: libxml: Error 801 occurred 34 times while parsing https://www.taste.com.au/recipes/slow-roasted-capsicums-filled-mushroom-feta/e413060d-6aee-47f4-adbe-d0e5b8223f60. First time it occurred in line 122 and column 24: Tag nav invalid


POST /apps/cookbook/webapp/import
from REDACTED by REDACTED at 2023-04-05T01:32:05+00:00
[cookbook] Warning: libxml: Error 68 occurred 29 times while parsing https://www.taste.com.au/recipes/slow-roasted-capsicums-filled-mushroom-feta/e413060d-6aee-47f4-adbe-d0e5b8223f60. First time it occurred in line 8 and column 61: htmlParseEntityRef: no name


POST /apps/cookbook/webapp/import
from REDACTED by REDACTED at 2023-04-05T01:32:05+00:00

krisgesling avatar Apr 05 '23 23:04 krisgesling

Same for me. I've only imported from https://chefkoch.de for now but it's the same for every recipe.

  • Samsung galaxyA52
  • Downloaded from FDroid
  • NC version 26.0.2
  • NC app version 0.10.2
  • Android app version 0.7.9

Syntoxr avatar Jun 17 '23 17:06 Syntoxr

Ok Thanks for the input

I'll have another look

Leptopoda avatar Jun 17 '23 21:06 Leptopoda

Still the same issue..... fresh install of Lineageos14 Screenshot_20240522-180212_Nextcloud Cookbook

Michele64 avatar May 22 '24 16:05 Michele64