V8-archive: Upload a file receive 500 Internal Server Error

Created on 19 Feb 2019  Â·  8Comments  Â·  Source: directus/v8-archive

Bug Report

Steps to Reproduce

  1. Login to Directus
  2. Navigate to File Library Page
  3. Click new
  4. Drag a image to the Upload Files window
  5. Error happens.
    Response error:
{"error":{"code":9,"message":"Failed generating the SQL query.","query":"INSERT INTO `directus_files` (`type`, `filename`, `title`, `tags`, `description`, `location`, `charset`, `filesize`, `width`, `height`, `storage`, `checksum`, `uploaded_by`, `uploaded_on`) VALUES ('image\/png', 'test-1.png', 'Test 1', '', '', '', 'binary', '12454', '110', '80', 's3', '06c266c3d6783715c857b94ada48dfb5', '1', '2019-02-19 09:32:04')"}}

Expected Behavior

File can be saved.

Actual Behavior

Upload file doesn't work.

Other Context & Screenshots

Technical Details

APP 7.0.18 and API 2.0.18

bug

All 8 comments

Did you upgrade the database schema? There's a new field in directus_files named checksum.

Run the command below to add the missing field, it should be working after the upgrade.

bin/directus db:upgrade

@WellingGuzman You're right. The upload now works. Thanks.

Ran the command above and also checked the database for the checksum field but every time I want to save the image I uploaded it says 500 - Internal Server Error in the right corner.
Anything I can do? Logs?

I run into the exact same issue as @creazy231
I cloned the directus repo today.

This is my log:
`user@server:~/directus.example.com/logs$ cat error.2019-06-12.log
[2019-06-12 20:47:25] api[_].ERROR: TypeError: Argument 3 passed to Directus\Database\TableGateway\RelationalTableGateway::recordActivity() must be of the type array, null given, called in /home/user/directus.example.com/src/core/Directus/Database/TableGateway/RelationalTableGateway.php on line 547 in /home/user/directus.example.com/src/core/Directus/Database/TableGateway/RelationalTableGateway.php:2300
Stack trace:

0 /home/user/directus.example.com/src/core/Directus/Database/TableGateway/RelationalTableGateway.php(547): Directus\Database\TableGateway\RelationalTableGateway->recordActivity

1 /home/user/directus.example.com/src/core/Directus/Services/ItemsService.php(161): Directus\Database\TableGateway\RelationalTableGateway->updateRecord`

I am using PHP 7.3.6-1+ubuntu18.04.1+deb.sury.org+1

Any help to fix or ignore this issue would be much appreciated.

I have also the same issue and see the same error in log file. Any suggestion?

@bjgajjar @hemratna — any ideas?

@obruehl If possible kindly provide the DB dump, log, your PHP version, API and APP version.
You can send me DB dump, log via slack.
You can find me as hem on http://directus.chat

@hemratna My problem was that I installed the newest version on the production server and copied the db of a prior version from my docker development version. My solution was to delete all and install it again and configure the CMS manually again. In this case was a small project.
Now it works fine.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rijkvanzanten picture rijkvanzanten  Â·  55Comments

futjikato picture futjikato  Â·  58Comments

sebj54 picture sebj54  Â·  25Comments

wellingguzman picture wellingguzman  Â·  25Comments

DeMuu picture DeMuu  Â·  33Comments