knuckleswtf / knuckleswtf/scribe

QueryException after endpoint with qued task is hit

Open
#800 2 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
PHP
Stars
2.3k
Forks
357
PR merge metrics
No merged PRs in 30d

Description

### Scribe version

4.29

### PHP version

8.3.2

### Framework

Laravel

### Framework version

10.43.0

### Scribe config

```ruby
title => "API"
base_url => "https://example.com"
static.output_path => "public/docs/scribe/"
auth.enabled => true
auth.placeholder => "{TOKEN}"
strategies.metadata => removed Knuckles\Scribe\Extracting\Strategies\Metadata\GetFromMetadataAttributes
strategies.urlParameters => added Knuckles\Scribe\Extracting\Strategies\UrlParameters\GetFromLumenAPI: removed Knuckles\Scribe\Extracting\Strategies\UrlParameters\GetFromUrlParamAttribute
strategies.queryParameters => removed Knuckles\Scribe\Extracting\Strategies\QueryParameters\GetFromQueryParamAttribute
strategies.headers => added Knuckles\Scribe\Extracting\Strategies\Headers\GetFromRouteRules: removed Knuckles\Scribe\Extracting\Strategies\Headers\GetFromHeaderAttribute, [
'override',
[
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
strategies.bodyParameters => removed Knuckles\Scribe\Extracting\Strategies\BodyParameters\GetFromFormRequest, Knuckles\Scribe\Extracting\Strategies\BodyParameters\GetFromInlineValidator, Knuckles\Scribe\Extracting\Strategies\BodyParameters\GetFromBodyParamAttribute
strategies.responses => added Knuckles\Scribe\Extracting\Strategies\Responses\ResponseCalls: removed Knuckles\Scribe\Extracting\Strategies\Responses\UseResponseAttributes, [
'Knuckles\\Scribe\\Extracting\\Strategies\\Responses\\ResponseCalls',
[
'only' => [
'GET *',
],
],
]
strategies.responseFields => removed Knuckles\Scribe\Extracting\Strategies\ResponseFields\GetFromResponseFieldAttribute
database_connections_to_transact.1 => "db2"
```

### What happened?

I have an endpoint called "search" with a que. It is structured as follows:
```
SearchTermLogger::dispatchAfterResponse(
$params,
$request->ip(),
config('app.url') . urldecode($request->getRequestUri()),
$search
);
```

After hitting this endpoint, I receive the following message repeated for every scanned endpoint:
```
✖ Illuminate\Database\QueryException in /var/www/html/example.com/vendor/laravel/framework/src/Illuminate/Database/Connection.php at line 783: SQLSTATE[HY000]: General error: -7008 [IBM][System i Access ODBC Driver][DB2 for i5/OS]SQL7008 - WPSLOG in XXXX not valid for operation. (SQLExecute[-7008] at ./ext/pdo_odbc/odbc_stmt.c:263) (Connection: db2, SQL: insert into WPSLOG (PSLKEY, PSLWRD, PSLBDF, PSLWID, PSLIP#, PSLURL, PSLV#9, PSLD#L, PSLT#L, PSLUUR, PSLDG#, PSLWK#, PSLMND, PSLJ#L) values (ZOEKEN, johnnie walker, 32, 9300, 127.0.0.1, https://example.com/api/xxxx/search, 322, 20240208, 104017, 10, 5, 06, 02, 2024))
✖ Run this again with the --verbose flag to see the full stack trace.
```

The que just works fine when hitting the endpoint manually; everything works as expected.

Do you have any suggestions for what might be causing this?

### Docs

- [X] I've checked [the docs](https://scribe.knuckles.wtf/laravel), the [troubleshooting guide](https://scribe.knuckles.wtf/laravel/troubleshooting), and [existing issues](https://github.com/knuckleswtf/scribe/issues?q=is%3Aissue+), but I didn't find a solution

Contributor guide

Open the contributing guide

Research direction

Start with the `SearchTermLogger::dispatchAfterResponse` call in the `search` endpoint and reproduce Scribe's scan of the endpoint. Run the scan with `--verbose` and inspect the stack trace around Laravel's `Connection.php` line 783; done means identifying why the queued logging operation fails during scanning and documenting or correcting the behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
laravel, php
Domain
backend, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
18/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.