App token problem with cookbook

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 20.0.5): 23.0.2
Operating system and version (eg, Ubuntu 20.04): Debian Bullseye
Apache or nginx version (eg, Apache 2.4.25): dont know
PHP version (eg, 7.4): 7.4

The issue you are facing:

Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

The output of your Nextcloud log in Admin > Logging:

[index] Fehler: Argument 1 passed to OCA\Cookbook\Helper\UserConfigHelper::__construct() must be of the type string, null given

GET /index.php/apps/cookbook/categories
from 192.168.2.188 at 2022-04-13T06:39:55+00:00

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'passwordsalt' => 'removed',
  'secret' => 'removed',
  'trusted_domains' => 
  array (
    0 => 'localhost',
    7 => 'here was the local dns address',
    5 => 'nextcloudpi.local',
    8 => 'nextcloudpi.lan',
    3 => 'here was the local dns address',
    11 => 'removed',
    1 => 'here was the local ip address',
    14 => 'here was the local dns address',
    20 => 'here was the web domain name',
  ),
  'datadirectory' => '/srv/nextcloud/ncdata/data',
  'dbtype' => 'mysql',
  'version' => '23.0.2.1',
  'overwrite.cli.url' => 'https://removed/',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'ncadmin',
  'dbpassword' => 'removed',
  'installed' => true,
  'instanceid' => 'removed',
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => '/var/run/redis/redis.sock',
    'port' => 0,
    'timeout' => 0.0,
    'password' => 'removed',
  ),
  'tempdirectory' => '/srv/nextcloud/ncdata/data/tmp',
  'mail_smtpmode' => 'sendmail',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_from_address' => 'admin',
  'mail_domain' => 'ownyourbits.com',
  'default_phone_region' => 'DE',
  'preview_max_x' => '2048',
  'preview_max_y' => '2048',
  'jpeg_quality' => '60',
  'overwriteprotocol' => 'https',
  'trusted_proxies' => 
  array (
    11 => '127.0.0.1',
    12 => '::1',
    13 => 'here was the local dns name,
    14 => '',
  ),
  'loglevel' => '2',
  'log_type' => 'file',
  'twofactor_enforced' => 'true',
  'twofactor_enforced_groups' => 
  array (
    0 => 'user',
    1 => 'admin',
  ),
  'twofactor_enforced_excluded_groups' => 
  array (
  ),
  'has_rebuilt_cache' => true,
  'maintenance' => false,
  'logfile' => '/srv/nextcloud/ncdata/data/nextcloud.log',
);

The output of your Apache/nginx/system log in /var/log/____:

nc-access.log:
93.210.201.98 - - [13/Apr/2022:08:41:17 +0200] "GET /ocs/v2.php/core/getapppassword HTTP/1.1" 403 6766 "-" "Cookbook App"
93.210.201.98 - - [13/Apr/2022:08:41:29 +0200] "GET /ocs/v2.php/core/getapppassword HTTP/1.1" 403 6770 "-" "Cookbook App"
93.210.201.98 - - [13/Apr/2022:08:42:20 +0200] "GET /index.php/apps/theming/icon?v=27 HTTP/2.0" 200 87403 "-" "Mozilla/5.0 (Android 11; Mobile; rv:99.0) Gecko/99.0 Firefox/99.0"
93.210.201.98 - - [13/Apr/2022:08:44:51 +0200] "GET /ocs/v2.php/core/getapppassword HTTP/1.1" 403 6774 "-" "Cookbook App"
93.210.201.98 - - [13/Apr/2022:08:44:58 +0200] "GET /ocs/v2.php/core/getapppassword HTTP/1.1" 403 6768 "-" "Cookbook App"
93.210.201.98 - - [13/Apr/2022:11:26:59 +0200] "GET /ocs/v2.php/core/getapppassword HTTP/1.1" 403 6768 "-" "Cookbook App"
93.210.201.98 - - [13/Apr/2022:11:27:54 +0200] "GET /ocs/v2.php/core/getapppassword HTTP/1.1" 403 6782 "-" "Cookbook App"
93.210.201.98 - - [13/Apr/2022:11:53:33 +0200] "GET /ocs/v2.php/apps/spreed/api/v4/room HTTP/2.0" 403 769 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:99.0) Gecko/20100101 Firefox/99.0"

PASTE HERE


Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.

{"reqId":"REMOVED","level":3,"time":"2022-04-13T06:39:55+00:00","remoteAddr":"192.168.2.188","user":"--","app":"index","method":"GET","url":"/index.php/apps/cookbook/categories","message":"Argument 1 passed to OCA\\Cookbook\\Helper\\UserConfigHelper::__construct() must be of the type string, null given","userAgent":"Dart/2.14 (dart:io)","version":"23.0.2.1","exception":{"Exception":"TypeError","Message":"Argument 1 passed to OCA\\Cookbook\\Helper\\UserConfigHelper::__construct() must be of the type string, null given","Code":0,"Trace":[{"function":"__construct","class":"OCA\\Cookbook\\Helper\\UserConfigHelper","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":106,"function":"newInstanceArgs","class":"ReflectionClass","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":114,"function":"buildClass","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":131,"function":"resolve","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":463,"function":"query","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":435,"function":"queryNoFallback","class":"OC\\AppFramework\\DependencyInjection\\DIContainer","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":87,"function":"query","class":"OC\\AppFramework\\DependencyInjection\\DIContainer","type":"->"},{"function":"OC\\AppFramework\\Utility\\{closure}","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":106,"function":"array_map"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":114,"function":"buildClass","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":131,"function":"resolve","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":463,"function":"query","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":435,"function":"queryNoFallback","class":"OC\\AppFramework\\DependencyInjection\\DIContainer","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":87,"function":"query","class":"OC\\AppFramework\\DependencyInjection\\DIContainer","type":"->"},{"function":"OC\\AppFramework\\Utility\\{closure}","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":106,"function":"array_map"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":114,"function":"buildClass","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":131,"function":"resolve","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":463,"function":"query","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":435,"function":"queryNoFallback","class":"OC\\AppFramework\\DependencyInjection\\DIContainer","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":144,"function":"query","class":"OC\\AppFramework\\DependencyInjection\\DIContainer","type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":302,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/nextcloud/lib/base.php","line":1006,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud/index.php","line":36,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/apps/cookbook/lib/Helper/UserConfigHelper.php","Line":28,"CustomMessage":"--"}}

Hi folks,

I setup an Nextcloudpi instance to my Raspberry Pi. Everythink works good.
I use TOTP auth for better security and assigned some app token’s for my mobile.
Now I saw, non of them works. I get an error “403 Forbidden”, when I try to use a token.
The log’s above are for the Cookbook app.

Did I configure anything wrong, or what cloud be the problem?
Sorry, I’m not a webserver specialist, so don´t be so hard with missconfigurations! :wink:

Many thanks

Cheers
Buzzzz

Is this correct and should I aktivate this?

sudo -u www-data php /var/www/nextcloud/occ circles:check

Checking loopback address.

. The loopback setting is mandatory and can be checked locally.
. The address you need to define here must be a reachable url of your Nextcloud from the hosting server itself.
. By default, the App will use the entry ‘overwrite.cli.url’ from ‘config/config.php’.

  • Loopback address looks good

Testing internal address.

. The internal setting is mandatory only if you are willing to use Circles in a GlobalScale setup on a local network.
. The address you need to define here is the local address of your Nextcloud, reachable by all other instances of our GlobalScale.

  • Do you want to enable this feature ? (y/N)

I don´t know what it means and need your help.

:smile:
The solution was very easy!
I didn´t saw the very litte login option setting for token in the App!
I think I need a bigger phone! :laughing:

Not a good entrypoint at the support forum :blush:

Hey, @buzzzz, where was an icon missing?

I am interested in this as I am developing for the cookbook app and I’d like to hear any problems that might be easily fixed by resizing an icon :laughing:.

Thanks
Christian

I mean that drop down menu.
I didn’t think of another setting. :blush:
Screenshot_20220413-202717_Nextcloud_Cookbook

1 Like

OK, that is not the cookbook app itself but a 3rd party mobile app (I suspect the one by Taifun but I am not 100% sure). In that case, I cannot do much.

If you want, you can provide feedback to the developer directly about this user’s misunderstanding. Maybe he can do something about it.