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

Illuminate\Database\QueryException on composer require #60

Closed
denniseilander opened this issue Jan 17, 2020 · 4 comments
Closed

Illuminate\Database\QueryException on composer require #60

denniseilander opened this issue Jan 17, 2020 · 4 comments

Comments

@denniseilander
Copy link

When running composer require aschmelyun/larametrics on a fresh Laravel (v6.11.0) installation, the application crashes on Generating optimized autoload files:

Also tested this on laravel 5.8.35, but the same error

composer require aschmelyun/larametrics      
                                                                                                                                                                                                                                                                         6.11.0   16:59:44  
Using version ^1.2 for aschmelyun/larametrics
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 6 installs, 0 updates, 0 removals
  - Installing ralouphie/getallheaders (3.0.3): Loading from cache
  - Installing psr/http-message (1.0.1): Loading from cache
  - Installing guzzlehttp/psr7 (1.6.1): Loading from cache
  - Installing guzzlehttp/promises (v1.3.1): Loading from cache
  - Installing guzzlehttp/guzzle (6.5.2): Loading from cache
  - Installing aschmelyun/larametrics (v1.2): Loading from cache
guzzlehttp/psr7 suggests installing zendframework/zend-httphandlerrunner (Emit PSR-7 responses)
Writing lock file
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi

   Illuminate\Database\QueryException  : SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'offset 0' at line 1 (SQL: select `id` from `larametrics_logs` order by `created_at` desc offset 0)

  at /Users/eilander/code/larametrics/vendor/laravel/framework/src/Illuminate/Database/Connection.php:669
    665|         // If an exception occurs when attempting to run a query, we'll format the error
    666|         // message to include the bindings with SQL, which will make this exception a
    667|         // lot more helpful to the developer instead of just the database's errors.
    668|         catch (Exception $e) {
  > 669|             throw new QueryException(
    670|                 $query, $this->prepareBindings($bindings), $e
    671|             );
    672|         }
    673|

  Exception trace:

  1   Illuminate\Foundation\Bootstrap\HandleExceptions::handleException(Object(Illuminate\Database\QueryException))
      [internal]:0

  2   PDOException::("SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'offset 0' at line 1")
      /Users/eilander/code/larametrics/vendor/laravel/framework/src/Illuminate/Database/Connection.php:331

  Please use the argument -v to see more details.
@Jubaz
Copy link

Jubaz commented Jan 20, 2020

Same error on laravel 5.5

@Jubaz
Copy link

Jubaz commented Jan 22, 2020 via email

@aschmelyun
Copy link
Owner

Hey everyone!

Check out the new release https://github.com/aschmelyun/larametrics/releases/tag/v1.2.1, I fixed both of these issues. The original one from @denniseilander was due to artisan firing off a log listener, which looks for expired logs before deleting them, but uses values from the config file. Since that file wasn't published yet, it caused a whole slew of weird issues that couldn't get resolved. I've wrapped those functions in a conditional to check for the config file first.

Additionally, @abdomf's issue has been addressed, the terminating() method is now using a proper closure, which prevents that error from popping up.

@mo3auya91
Copy link

Same error Laravel 8.11.2

Problem 1
    - Can only install one of: guzzlehttp/guzzle[7.2.0, 6.5.x-dev].
    - Can only install one of: guzzlehttp/guzzle[6.5.x-dev, 7.2.0].
    - aschmelyun/larametrics v1.2.1 requires guzzlehttp/guzzle ^6.5 -> satisfiable by guzzlehttp/guzzle[6.5.x-dev].
    - Installation request for aschmelyun/larametrics ^v1.2.1 -> satisfiable by aschmelyun/larametrics[v1.2.1].
    - Installation request for guzzlehttp/guzzle ^7.2 -> satisfiable by guzzlehttp/guzzle[7.2.0].

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

4 participants