Skip to content
This repository has been archived by the owner on Nov 26, 2023. It is now read-only.

Broke when clientKey suddenly came with "jira:" prefix #18

Closed
jessiechia opened this issue Nov 5, 2020 · 1 comment
Closed

Broke when clientKey suddenly came with "jira:" prefix #18

jessiechia opened this issue Nov 5, 2020 · 1 comment

Comments

@jessiechia
Copy link

Hi, everything seem to be working well until today when these messages were logged:

[2020-11-05 01:45:08] production.ERROR: SQLSTATE[HY000]: General error: 1835 Malformed communication packet (SQL: select * from tenant where client_key = jira:client-key-here and tenant.deleted_at is null limit 1) {"exception":"[object] (Illuminate\Database\QueryException(code: HY000): SQLSTATE[HY000]: General error: 1835 Malformed communication packet (SQL: select * from tenant where client_key = jira:client-key-here and tenant.deleted_at is null limit 1) at /.../vendor/laravel/framework/src/Illuminate/Database/Connection.php:669)
[stacktrace]
#0 /.../vendor/laravel/framework/src/Illuminate/Database/Connection.php(629): Illuminate\Database\Connection->runQueryCallback('select * from ...', Array, Object(Closure)) #1 /.../vendor/laravel/framework/src/Illuminate/Database/Connection.php(338): Illuminate\\Database\\Connection->run('select * from ...', Array, Object(Closure))
#2 /.../vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2149): Illuminate\Database\Connection->select('select * from `...', Array, true)
#3 /.../vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2137): Illuminate\Database\Query\Builder->runSelect()
#4 /.../vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2609): Illuminate\Database\Query\Builder->Illuminate\Database\Query\{closure}()
#5 /.../vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2138): Illuminate\Database\Query\Builder->onceWithColumns(Array, Object(Closure))
#6 /.../vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(545): Illuminate\Database\Query\Builder->get(Array)
#7 /.../vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(529): Illuminate\Database\Eloquent\Builder->getModels(Array)
#8 /.../vendor/laravel/framework/src/Illuminate/Database/Concerns/BuildsQueries.php(143): Illuminate\Database\Eloquent\Builder->get(Array)
#9 /.../vendor/laravel/framework/src/Illuminate/Auth/EloquentUserProvider.php(131): Illuminate\Database\Eloquent\Builder->first()
#10 /.../vendor/brezzhnev/atlassian-connect-core/src/JWTGuard.php(92): Illuminate\Auth\EloquentUserProvider->retrieveByCredentials(Array)
#11 /.../vendor/laravel/framework/src/Illuminate/Auth/AuthManager.php(307): AtlassianConnectCore\JWTGuard->user()
#12 /.../vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(261): Illuminate\Auth\AuthManager->__call('user', Array)
#13 /.../app/Http/Controllers/DashboardController.php(16): Illuminate\Support\Facades\Facade::__callStatic('user', Array)
#14 [internal function]: App\Http\Controllers\DashboardController->__construct()

Looks like the call needs to be handled as a string i.e. clientKey value to be wrapped around quotes before sending to the database.

@jessiechia
Copy link
Author

Looks like all I had to do was to ensure that my database config had this option:
PDO::ATTR_EMULATE_PREPARES => true

:)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant