-
-
Notifications
You must be signed in to change notification settings - Fork 204
Image/File Uploading via Directus App #642
Comments
On what server is this happening? Is there any issue visible in the browser console? If there's an error logged in the /logs folder in the api, what does it say? |
I am hosting this on hosting that I bought online, managing the server through cpanel. Installed directus for a custom domain. This is the error code showing in the console when I try and upload an image. Client side stack tracePOST http://test1.ezmach.net/_/files 500 (Internal Server Error) (anonymous) @ xhr.js:178 e.exports @ xhr.js:12 |
How big was the file you were trying to upload? Did it exceed the php max upload size (although that should throw a 400 error)? Does the php user have write access to the files? |
No it's a pretty small image and yes the php user has write access. |
@wellingguzman I'm getting this error on the demo server:
Full stack trace[2018-12-09 18:03:36] api[_].ERROR: TypeError: Argument 1 passed to Directus\Filesystem\FilesystemFactory::createAdapter() must be of the type array, null given, called in /var/www/api/src/core/Directus/A pplication/CoreServicesProvider.php on line 984 and defined in /var/www/api/src/core/Directus/Filesystem/FilesystemFactory.php:14 Stack trace: #0 /var/www/api/src/core/Directus/Application/CoreServicesProvider.php(984): Directus\Filesystem\FilesystemFactory::createAdapter(NULL, 'root') #1 /var/www/api/vendor/pimple/pimple/src/Pimple/Container.php(118): Directus\Application\CoreServicesProvider->Directus\Application\{closure}(Object(Directus\Application\Container)) #2 /var/www/api/src/core/Directus/Container/Container.php(27): Pimple\Container->offsetGet('filesystem') #3 /var/www/api/src/core/Directus/Application/CoreServicesProvider.php(1113): Directus\Container\Container->get('filesystem') #4 /var/www/api/vendor/pimple/pimple/src/Pimple/Container.php(118): Directus\Application\CoreServicesProvider->Directus\Application\{closure}(Object(Directus\Application\Container)) #5 /var/www/api/src/core/Directus/Container/Container.php(27): Pimple\Container->offsetGet('files') #6 /var/www/api/src/core/Directus/Application/CoreServicesProvider.php(283): Directus\Container\Container->get('files') #7 /var/www/api/src/core/Directus/Application/CoreServicesProvider.php(344): Directus\Application\CoreServicesProvider->Directus\Application\{closure}(Object(Directus\Hook\Payload), false) #8 [internal function]: Directus\Application\CoreServicesProvider->Directus\Application\{closure}(Object(Directus\Hook\Payload)) #9 /var/www/api/src/core/Directus/Hook/Emitter.php(291): call_user_func_array(Object(Closure), Array) #10 /var/www/api/src/core/Directus/Hook/Emitter.php(151): Directus\Hook\Emitter->executeListeners(Array, Array, 1) #11 /var/www/api/src/core/Directus/Database/TableGateway/BaseTableGateway.php(1528): Directus\Hook\Emitter->apply('item.create:bef...', Array, Array) #12 /var/www/api/src/core/Directus/Database/TableGateway/BaseTableGateway.php(778): Directus\Database\TableGateway\BaseTableGateway->applyHook('item.create:bef...', Array, Array) #13 /var/www/api/vendor/zendframework/zend-db/src/TableGateway/AbstractTableGateway.php(264): Directus\Database\TableGateway\BaseTableGateway->executeInsert(Object(Zend\Db\Sql\Insert)) #14 /var/www/api/src/core/Directus/Database/TableGateway/BaseTableGateway.php(389): Zend\Db\TableGateway\AbstractTableGateway->insert(Array) #15 /var/www/api/src/core/Directus/Database/TableGateway/RelationalTableGateway.php(403): Directus\Database\TableGateway\BaseTableGateway->addRecordByArray(Array) #16 /var/www/api/src/core/Directus/Services/FilesServices.php(36): Directus\Database\TableGateway\RelationalTableGateway->createRecord(Array, Array) #17 /var/www/api/src/endpoints/Files.php(86): Directus\Services\FilesServices->create(Array, Array) #18 [internal function]: Directus\Api\Routes\Files->create(Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response), Array) #19 /var/www/api/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponse.php(41): call_user_func(Array, Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response), Array) #20 /var/www/api/vendor/slim/slim/Slim/Route.php(356): Slim\Handlers\Strategies\RequestResponse->__invoke(Array, Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response), Arra y) #21 /var/www/api/src/core/Directus/Application/Http/Middleware/AbstractRateLimitMiddleware.php(34): Slim\Route->__invoke(Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Respons e)) #22 [internal function]: Directus\Application\Http\Middleware\AbstractRateLimitMiddleware->__invoke(Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response), Object(Slim\Route )) #23 /var/www/api/vendor/slim/slim/Slim/DeferredCallable.php(43): call_user_func_array(Object(Directus\Application\Http\Middleware\UserRateLimitMiddleware), Array) #24 [internal function]: Slim\DeferredCallable->__invoke(Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response), Object(Slim\Route)) #25 /var/www/api/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response), Ob ject(Slim\Route)) #26 /var/www/api/src/core/Directus/Application/Http/Middleware/AuthenticationMiddleware.php(80): Slim\Route->Slim\{closure}(Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Resp onse)) #27 [internal function]: Directus\Application\Http\Middleware\AuthenticationMiddleware->__invoke(Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response), Object(Closure)) #28 /var/www/api/vendor/slim/slim/Slim/DeferredCallable.php(43): call_user_func_array(Object(Directus\Application\Http\Middleware\AuthenticationMiddleware), Array) #29 [internal function]: Slim\DeferredCallable->__invoke(Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response), Object(Closure)) #30 /var/www/api/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response), Ob ject(Closure)) #31 /var/www/api/src/core/Directus/Application/Http/Middleware/TableGatewayMiddleware.php(25): Slim\Route->Slim\{closure}(Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Respon se)) #32 [internal function]: Directus\Application\Http\Middleware\TableGatewayMiddleware->__invoke(Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response), Object(Closure)) #33 /var/www/api/vendor/slim/slim/Slim/DeferredCallable.php(43): call_user_func_array(Object(Directus\Application\Http\Middleware\TableGatewayMiddleware), Array) #34 [internal function]: Slim\DeferredCallable->__invoke(Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response), Object(Closure)) #35 /var/www/api/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response), Ob ject(Closure)) #36 /var/www/api/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(117): Slim\Route->Slim\{closure}(Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response)) #37 /var/www/api/vendor/slim/slim/Slim/Route.php(334): Slim\Route->callMiddlewareStack(Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response)) #38 /var/www/api/vendor/slim/slim/Slim/App.php(515): Slim\Route->run(Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response)) #39 /var/www/api/src/core/Directus/Application/Http/Middleware/AbstractRateLimitMiddleware.php(34): Slim\App->__invoke(Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response) ) #40 [internal function]: Directus\Application\Http\Middleware\AbstractRateLimitMiddleware->__invoke(Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response), Object(Directus\A pplication\Application)) #41 /var/www/api/vendor/slim/slim/Slim/DeferredCallable.php(43): call_user_func_array(Object(Directus\Application\Http\Middleware\IpRateLimitMiddleware), Array) #42 [internal function]: Slim\DeferredCallable->__invoke(Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response), Object(Directus\Application\Application)) #43 /var/www/api/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response), Ob ject(Directus\Application\Application)) #44 /var/www/api/vendor/akrabat/rka-ip-address-middleware/src/IpAddress.php(93): Slim\App->Slim\{closure}(Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response)) #45 [internal function]: RKA\Middleware\IpAddress->__invoke(Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response), Object(Closure)) #46 /var/www/api/vendor/slim/slim/Slim/DeferredCallable.php(43): call_user_func_array(Object(RKA\Middleware\IpAddress), Array) #47 [internal function]: Slim\DeferredCallable->__invoke(Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response), Object(Closure)) #48 /var/www/api/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response), Ob ject(Closure)) #49 /var/www/api/src/core/Directus/Application/Http/Middleware/CorsMiddleware.php(66): Slim\App->Slim\{closure}(Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response)) #50 [internal function]: Directus\Application\Http\Middleware\CorsMiddleware->__invoke(Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response), Object(Closure)) #51 /var/www/api/vendor/slim/slim/Slim/DeferredCallable.php(43): call_user_func_array(Object(Directus\Application\Http\Middleware\CorsMiddleware), Array) #52 [internal function]: Slim\DeferredCallable->__invoke(Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response), Object(Closure)) #53 /var/www/api/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response), Ob ject(Closure)) #54 /var/www/api/src/core/Directus/Application/Http/Middleware/ResponseCacheMiddleware.php(47): Slim\App->Slim\{closure}(Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Respons e)) #55 [internal function]: Directus\Application\Http\Middleware\ResponseCacheMiddleware->__invoke(Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response), Object(Closure)) #56 /var/www/api/vendor/slim/slim/Slim/DeferredCallable.php(43): call_user_func_array(Object(Directus\Application\Http\Middleware\ResponseCacheMiddleware), Array) #57 [internal function]: Slim\DeferredCallable->__invoke(Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response), Object(Closure)) #58 /var/www/api/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response), Ob ject(Closure)) #59 /var/www/api/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(117): Slim\App->Slim\{closure}(Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response)) #60 /var/www/api/vendor/slim/slim/Slim/App.php(406): Slim\App->callMiddlewareStack(Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response)) #61 /var/www/api/vendor/slim/slim/Slim/App.php(314): Slim\App->process(Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response)) #62 /var/www/api/src/core/Directus/Application/Application.php(161): Slim\App->run(false) #63 /var/www/api/public/index.php(5): Directus\Application\Application->run() #64 {main} [] [] |
It seems you are using an old version because the logs still have the arguments written down in the log files. (This has nothing to do). I think the configuration file is missing the How the instance configuration file looks like? Is there a |
The API throws a friendly error message that tells you when the storage configuration is missing. Ref: b24a722, https://github.com/directus/docs/commit/84f1a1b925931c59f81d6e54ab290fa8d803305a |
Due to inactivity I will close this ticket assuming there's nothing else to add to the issue. |
Bug Report
The uploading files and images feature in the Directus app is not working.
Steps to Reproduce
Expected Behavior
To be able to upload an image
Actual Behavior
Error, unable to upload any file or image
Other Context & Screenshots
The progress bar completes and just as it reaches 100% this error shows up. I am unable to upload any files or images to my back-end.
Technical Details
The text was updated successfully, but these errors were encountered: