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

Server error when setting up Gmail account: port sent to backend as string instead of integer #1054

Closed
kevgathuku opened this issue Aug 23, 2018 · 1 comment
Assignees
Milestone

Comments

@kevgathuku
Copy link
Contributor

kevgathuku commented Aug 23, 2018

Expected behavior

Setting up a Gmail account for the first time should work

Actual behavior

When setting up a new Gmail account, I get this error:

Type: TypeError
Code: 0
Message: Argument 5 passed to OCA\Mail\Service\AutoConfig\ImapConnector::connect() must be of the type integer, string given, called in /server/apps/mail/lib/Service/AutoConfig/IspDbConfigurationDetector.php on line 166
File: /server/apps/mail/lib/Service/AutoConfig/ImapConnector.php
Line: 63

The server expects the $port argument to be sent as an int but the client sends it as a string.
If you change the type of the $port variable to take a string instead of an int, the app is set up successfully.

Mail app

Mail app version: 0.10.0

Mailserver or service: Gmail,

Number of accounts: 1

Server configuration

Operating system: MacOS

Web server: (e.g. Apache, Nginx,...)

Database: (e.g. MariaDB, SQLite, PostgreSQL,...)

PHP version: 7.2.8

Nextcloud Version: (see admin page, e.g. 13.0.2)

Updated from an older version or fresh install:

List of activated apps:

Enabled:
  - accessibility: 1.0.1
  - cloud_federation_api: 0.0.1
  - comments: 1.4.0
  - dav: 1.6.0
  - federatedfilesharing: 1.4.0
  - federation: 1.4.0
  - files: 1.9.0
  - files_sharing: 1.6.2
  - files_trashbin: 1.4.1
  - files_versions: 1.7.1
  - lookup_server_connector: 1.2.0
  - mail: 0.10.0
  - oauth2: 1.2.1
  - provisioning_api: 1.4.0
  - sharebymail: 1.4.0
  - systemtags: 1.4.0
  - theming: 1.5.0
  - twofactor_backupcodes: 1.3.0
  - updatenotification: 1.4.1
  - workflowengine: 1.4.0

The content of config/config.php:

If you have access to your command line run e.g.:
sudo -u www-data php occ config:list system
from within your Nextcloud installation folder

or

Insert your config.php content here
Make sure to remove all sensitive content such as passwords. (e.g. database password, passwordsalt, secret, smtp password, …)

Client configuration

Browser: Chrome 68.0.3440.106

Operating system: MacOs

Logs

Web server error log
Type: TypeError
Code: 0
Message: Argument 5 passed to OCA\Mail\Service\AutoConfig\ImapConnector::connect() must be of the type integer, string given, called in /server/apps/mail/lib/Service/AutoConfig/IspDbConfigurationDetector.php on line 166
File: /server/apps/mail/lib/Service/AutoConfig/ImapConnector.php
Line: 63

Trace:

#0 /Users/kevin/code/nextcloud/server/apps/mail/lib/Service/AutoConfig/IspDbConfigurationDetector.php(166): OCA\Mail\Service\AutoConfig\ImapConnector->connect('kevgathuku@gmai...', 'xsxxyyyyxxyy...', 'Kevin Gathuku', 'imap.gmail.com', '993', 'ssl', 'kevgathuku@gmai...')
#1 /Users/kevin/code/nextcloud/server/apps/mail/lib/Service/AutoConfig/IspDbConfigurationDetector.php(130): OCA\Mail\Service\AutoConfig\IspDbConfigurationDetector->testImapConfiguration(Array, 'kevgathuku@gmai...', 'xsxxyyyyxxyy...', 'Kevin Gathuku')
#2 /Users/kevin/code/nextcloud/server/apps/mail/lib/Service/AutoConfig/IspDbConfigurationDetector.php(101): OCA\Mail\Service\AutoConfig\IspDbConfigurationDetector->detectImap(Array, 'kevgathuku@gmai...', 'xsxxyyyyxxyy...', 'Kevin Gathuku')
#3 /Users/kevin/code/nextcloud/server/apps/mail/lib/Service/AutoConfig/AutoConfig.php(53): OCA\Mail\Service\AutoConfig\IspDbConfigurationDetector->detectImapAndSmtp('kevgathuku@gmai...', 'xsxxyyyyxxyy...', 'Kevin Gathuku')
#4 /Users/kevin/code/nextcloud/server/apps/mail/lib/Service/SetupService.php(72): OCA\Mail\Service\AutoConfig\AutoConfig->createAutoDetected('kevgathuku@gmai...', 'xsxxyyyyxxyy...', 'Kevin Gathuku')
#5 /Users/kevin/code/nextcloud/server/apps/mail/lib/Controller/AccountsController.php(223): OCA\Mail\Service\SetupService->createNewAutoConfiguredAccount('Kevin Gathuku', 'kevgathuku@gmai...', 'xsxxyyyyxxyy...')
#6 /Users/kevin/code/nextcloud/server/lib/private/AppFramework/Http/Dispatcher.php(166): OCA\Mail\Controller\AccountsController->create('Kevin Gathuku', 'kevgathuku@gmai...', 'xsxxyyyyxxyy...', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, true)
#7 /Users/kevin/code/nextcloud/server/lib/private/AppFramework/Http/Dispatcher.php(99): OC\AppFramework\Http\Dispatcher->executeController(Object(OCA\Mail\Controller\AccountsController), 'create')
#8 /Users/kevin/code/nextcloud/server/lib/private/AppFramework/App.php(118): OC\AppFramework\Http\Dispatcher->dispatch(Object(OCA\Mail\Controller\AccountsController), 'create')
#9 /Users/kevin/code/nextcloud/server/lib/private/AppFramework/Routing/RouteActionHandler.php(47): OC\AppFramework\App::main('OCA\\Mail\\Contro...', 'create', Object(OC\AppFramework\DependencyInjection\DIContainer), Array)
#10 [internal function]: OC\AppFramework\Routing\RouteActionHandler->__invoke(Array)
#11 /Users/kevin/code/nextcloud/server/lib/private/Route/Router.php(297): call_user_func(Object(OC\AppFramework\Routing\RouteActionHandler), Array)
#12 /Users/kevin/code/nextcloud/server/lib/base.php(989): OC\Route\Router->match('/apps/mail/api/...')
#13 /Users/kevin/code/nextcloud/server/index.php(42): OC::handleRequest()
#14 {main}
@kevgathuku kevgathuku self-assigned this Aug 23, 2018
@ChristophWurst ChristophWurst added this to the 0.11.0 milestone Aug 23, 2018
kevgathuku added a commit that referenced this issue Aug 23, 2018
Fixes #1054

Signed-off-by: Kevin Ndung'u <kevgathuku@gmail.com>
@lock
Copy link

lock bot commented Nov 20, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and questions.

@lock lock bot locked and limited conversation to collaborators Nov 20, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants