firefly-iii / firefly-iii

Firefly III: a personal finances manager
https://firefly-iii.org/
GNU Affero General Public License v3.0
16.37k stars 1.49k forks source link

Fatal error when importing via spectre #1551

Closed emansih closed 6 years ago

emansih commented 6 years ago

Bug description I am running Firefly III version 4.7.5.1

The following error message is shown when i am importing via spectre for the first time.

The import has suffered from an error it could not recover from. Apologies!

Job could not be started or crashed: The import routine crashed: Guzzle Exception: Client error: `GET https://www.saltedge.com/api/v4/customers/?from_id=0` resulted in a `400 Bad Request` response: {"error_class":"SignatureNotMatch","error_message":"Signature not match.","request":{"from_id":"0"}}

This (possibly very cryptic) error message is complemented by log files, which you can find on your hard drive, or in the Docker container where you run Firefly III from.

ff3-fpm-fcgi-2018-07-14.log

[2018-07-14 20:45:30] local.ERROR: #0 /var/www/firefly/app/Services/Spectre/Request/ListCustomersRequest.php(50): FireflyIII\Services\Spectre\Request\SpectreRequest->sendSignedSpectreGet('/api/v4/custome...', Array)
#1 /var/www/firefly/app/Support/Import/Information/GetSpectreCustomerTrait.php(89): FireflyIII\Services\Spectre\Request\ListCustomersRequest->call()
#2 /var/www/firefly/app/Support/Import/Information/GetSpectreCustomerTrait.php(48): FireflyIII\Support\Import\Routine\Spectre\StageNewHandler->getExistingCustomer(Object(FireflyIII\Models\ImportJob))
#3 /var/www/firefly/app/Support/Import/Routine/Spectre/StageNewHandler.php(70): FireflyIII\Support\Import\Routine\Spectre\StageNewHandler->getCustomer(Object(FireflyIII\Models\ImportJob))
#4 /var/www/firefly/app/Import/Routine/SpectreRoutine.php(66): FireflyIII\Support\Import\Routine\Spectre\StageNewHandler->run()
#5 /var/www/firefly/app/Http/Controllers/Import/JobStatusController.php(155): FireflyIII\Import\Routine\SpectreRoutine->run()
#6 [internal function]: FireflyIII\Http\Controllers\Import\JobStatusController->start(Object(FireflyIII\Models\ImportJob))
#7 /var/www/firefly/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): call_user_func_array(Array, Array)
#8 /var/www/firefly/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(45): Illuminate\Routing\Controller->callAction('start', Array)
#9 /var/www/firefly/vendor/laravel/framework/src/Illuminate/Routing/Route.php(212): Illuminate\Routing\ControllerDispatcher->dispatch(Object(Illuminate\Routing\Route), Object(FireflyIII\Http\Controllers\Import\JobStatusController), 'start')
#10 /var/www/firefly/vendor/laravel/framework/src/Illuminate/Routing/Route.php(169): Illuminate\Routing\Route->runController()
#11 /var/www/firefly/vendor/laravel/framework/src/Illuminate/Routing/Router.php(665): Illuminate\Routing\Route->run()
#12 /var/www/firefly/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(30): Illuminate\Routing\Router->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#13 /var/www/firefly/app/Http/Controllers/Import/JobStatusController.php(56): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#14 /var/www/firefly/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(133): FireflyIII\Http\Controllers\Import\JobStatusController->FireflyIII\Http\Controllers\Import\{closure}(Object(Illuminate\Http\Request), Object(Closure))
#15 /var/www/firefly/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#16 /var/www/firefly/app/Http/Controllers/Controller.php(109): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#17 /var/www/firefly/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(133): FireflyIII\Http\Controllers\Controller->FireflyIII\Http\Controllers\{closure}(Object(Illuminate\Http\Request), Object(Closure))
#18 /var/www/firefly/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#19 /var/www/firefly/app/Http/Middleware/Binder.php(77): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#20 /var/www/firefly/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(151): FireflyIII\Http\Middleware\Binder->handle(Object(Illuminate\Http\Request), Object(Closure))
#21 /var/www/firefly/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#22 /var/www/firefly/app/Http/Middleware/Range.php(63): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#23 /var/www/firefly/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(151): FireflyIII\Http\Middleware\Range->handle(Object(Illuminate\Http\Request), Object(Closure))
#24 /var/www/firefly/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#25 /var/www/firefly/app/Http/Middleware/AuthenticateTwoFactor.php(84): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#26 /var/www/firefly/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(151): FireflyIII\Http\Middleware\AuthenticateTwoFactor->handle(Object(Illuminate\Http\Request), Object(Closure))
#27 /var/www/firefly/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#28 /var/www/firefly/app/Http/Middleware/Authenticate.php(73): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#29 /var/www/firefly/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(151): FireflyIII\Http\Middleware\Authenticate->handle(Object(Illuminate\Http\Request), Object(Closure))
#30 /var/www/firefly/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#31 /var/www/firefly/vendor/laravel/passport/src/Http/Middleware/CreateFreshApiToken.php(50): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#32 /var/www/firefly/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(151): Laravel\Passport\Http\Middleware\CreateFreshApiToken->handle(Object(Illuminate\Http\Request), Object(Closure))
#33 /var/www/firefly/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#34 /var/www/firefly/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(67): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#35 /var/www/firefly/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(151): Illuminate\Foundation\Http\Middleware\VerifyCsrfToken->handle(Object(Illuminate\Http\Request), Object(Closure))
#36 /var/www/firefly/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#37 /var/www/firefly/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#38 /var/www/firefly/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(151): Illuminate\View\Middleware\ShareErrorsFromSession->handle(Object(Illuminate\Http\Request), Object(Closure))
#39 /var/www/firefly/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#40 /var/www/firefly/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(63): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#41 /var/www/firefly/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(151): Illuminate\Session\Middleware\StartSession->handle(Object(Illuminate\Http\Request), Object(Closure))
#42 /var/www/firefly/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#43 /var/www/firefly/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#44 /var/www/firefly/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(151): Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse->handle(Object(Illuminate\Http\Request), Object(Closure))
#45 /var/www/firefly/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#46 /var/www/firefly/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(59): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#47 /var/www/firefly/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(151): Illuminate\Cookie\Middleware\EncryptCookies->handle(Object(Illuminate\Http\Request), Object(Closure))
#48 /var/www/firefly/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#49 /var/www/firefly/app/Http/Middleware/Sandstorm.php(58): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#50 /var/www/firefly/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(151): FireflyIII\Http\Middleware\Sandstorm->handle(Object(Illuminate\Http\Request), Object(Closure))
#51 /var/www/firefly/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#52 /var/www/firefly/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(104): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#53 /var/www/firefly/vendor/laravel/framework/src/Illuminate/Routing/Router.php(667): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#54 /var/www/firefly/vendor/laravel/framework/src/Illuminate/Routing/Router.php(642): Illuminate\Routing\Router->runRouteWithinStack(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request))
#55 /var/www/firefly/vendor/laravel/framework/src/Illuminate/Routing/Router.php(608): Illuminate\Routing\Router->runRoute(Object(Illuminate\Http\Request), Object(Illuminate\Routing\Route))
#56 /var/www/firefly/vendor/laravel/framework/src/Illuminate/Routing/Router.php(597): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request))
#57 /var/www/firefly/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(176): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))
#58 /var/www/firefly/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(30): Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http\{closure}(Object(Illuminate\Http\Request))
#59 /var/www/firefly/vendor/fideloper/proxy/src/TrustProxies.php(57): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#60 /var/www/firefly/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(151): Fideloper\Proxy\TrustProxies->handle(Object(Illuminate\Http\Request), Object(Closure))
#61 /var/www/firefly/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#62 /var/www/firefly/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(31): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#63 /var/www/firefly/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(151): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle(Object(Illuminate\Http\Request), Object(Closure))
#64 /var/www/firefly/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#65 /var/www/firefly/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(31): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#66 /var/www/firefly/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(151): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle(Object(Illuminate\Http\Request), Object(Closure))
#67 /var/www/firefly/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#68 /var/www/firefly/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#69 /var/www/firefly/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(151): Illuminate\Foundation\Http\Middleware\ValidatePostSize->handle(Object(Illuminate\Http\Request), Object(Closure))
#70 /var/www/firefly/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#71 /var/www/firefly/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php(62): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#72 /var/www/firefly/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(151): Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode->handle(Object(Illuminate\Http\Request), Object(Closure))
#73 /var/www/firefly/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#74 /var/www/firefly/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(104): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#75 /var/www/firefly/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(151): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#76 /var/www/firefly/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(116): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))
#77 /var/www/firefly/public/index.php(76): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
#78 {main}

Extra info Debug information generated at 2018-07-14 20:53:03 Asia/Singapore for Firefly III version 4.7.5.1.

Variable Content
FF version 4.7.5.1
FF API version 0.5
App environment local
App debug mode false
App cache driver file
App logging notice, daily
PHP version 7.2.7-0ubuntu0.18.04.2
Display errors Off
Session start 2018-07-01 00:00:00
Session end 2018-07-31 23:59:59
Session first 2018-01-01 00:00:00
Error reporting ALL errors
Host Linux
Interface fpm-fcgi
UserID 1
Attempt at "en" false
Attempt at "English" false
Attempt at "en_US" false
Attempt at "en_US.utf8" 'en_US.utf8'
Attempt at "en_US.UTF-8" 'en_US.UTF-8'
DB drivers mysql
Current driver mysql
Using Sandstorm? no
Is Sandstorm (.env) false
Is Docker (.env) false
bunq uses sandbox false
Trusted proxies (.env) **
User agent Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36
Loaded extensions Core, date, libxml, openssl, pcre, zlib, filter, hash, Reflection, SPL, sodium, session, standard, cgi-fcgi, mysqlnd, PDO, xml, bcmath, bz2, calendar, ctype, curl, dom, mbstring, fileinfo, ftp, gd, gettext, iconv, intl, json, exif, mysqli, pdo_mysql, Phar, posix, readline, shmop, SimpleXML, sockets, sysvmsg, sysvsem, sysvshm, tokenizer, wddx, xmlreader, xmlwriter, xsl, zip, Zend OPcache
Installed packages bacon/bacon-qr-code@1.0.3, bunq/sdk_php@dev-master, davejamesmiller/laravel-breadcrumbs@5.1.0, defuse/php-encryption@v2.2.0, doctrine/cache@v1.7.1, doctrine/dbal@v2.8.0, doctrine/event-manager@v1.0.0, doctrine/inflector@v1.3.0, doctrine/lexer@v1.0.1, dragonmantank/cron-expression@v2.2.0, egulias/email-validator@2.1.4, erusev/parsedown@1.7.1, fideloper/proxy@4.0.0, firebase/php-jwt@v5.0.0, guzzlehttp/guzzle@6.3.3, guzzlehttp/promises@v1.3.1, guzzlehttp/psr7@1.4.2, laravel/framework@v5.6.27, laravel/passport@v5.0.3, laravelcollective/html@v5.6.10, lcobucci/jwt@3.2.2, league/commonmark@0.17.5, league/csv@9.1.4, league/event@2.1.2, league/flysystem@1.0.45, league/fractal@0.17.0, league/oauth2-server@6.1.1, monolog/monolog@1.23.0, nesbot/carbon@1.25.0, paragonie/constant_time_encoding@v2.2.2, paragonie/random_compat@v2.0.17, phpseclib/phpseclib@2.0.11, pragmarx/google2fa@v3.0.1, pragmarx/google2fa-laravel@v0.2.0, psr/container@1.0.0, psr/http-message@1.0.1, psr/log@1.0.2, psr/simple-cache@1.0.1, ramsey/uuid@3.7.3, rcrowe/twigbridge@v0.9.6, swiftmailer/swiftmailer@v6.1.2, symfony/console@v4.1.1, symfony/css-selector@v4.1.1, symfony/debug@v4.1.1, symfony/event-dispatcher@v4.1.1, symfony/finder@v4.1.1, symfony/http-foundation@v4.1.1, symfony/http-kernel@v4.1.1, symfony/polyfill-ctype@v1.8.0, symfony/polyfill-mbstring@v1.8.0, symfony/polyfill-php56@v1.8.0, symfony/polyfill-php72@v1.8.0, symfony/polyfill-util@v1.8.0, symfony/process@v4.1.1, symfony/psr-http-message-bridge@v1.0.2, symfony/routing@v4.1.1, symfony/translation@v4.1.1, symfony/var-dumper@v4.1.1, tijsverkoyen/css-to-inline-styles@2.2.1, twig/twig@v1.35.4, vlucas/phpdotenv@v2.5.0, zendframework/zend-diactoros@1.8.1,

Thanks for any help!

JC5 commented 6 years ago

Mmm, that is strange.

Did you upload the public key to Spectre, when you entered the API details?

emansih commented 6 years ago

Are you talking about this page? If so, yes i did

JC5 commented 6 years ago

I just had the exact same thing, despite having the same data in my Spectre (like you).

Could you submit this page again and then try again from Firefly III?

For some reason this worked for me.

emansih commented 6 years ago

Thanks, it works for me. but i am unable to import my account. bank (i am only given a do not import option)

JC5 commented 6 years ago

In that case, the currency for the Spectre account (eEveryday) does not have the same currency as the account in Firefly III.

If you are sure these are the same, I must do some debugging to see what Spectre is reporting.

emansih commented 6 years ago

I have tried to import from 2 different bank accounts and it says the same thing

JC5 commented 6 years ago

Yes and are Firefly III and your Spectre accounts the same currency?

emansih commented 6 years ago

ah, it's because i didn't went through the initial setup after logging in to firefly for the first time.