V8-archive: DateTimeUtil causing Exceptions when configuring Directus via environment variables

Created on 23 Sep 2019  路  6Comments  路  Source: directus/v8-archive

Bug Report

Steps to Reproduce

  1. Configure Directus via environment variables (e.g. with official docker image, but not latest tag because its too old)
  2. Try to upload a file (e.g. via an file input field)

Expected Behavior

Upload working

Actual Behavior

returning json:

{"error":{"code":22,"message":"Current configuration context only supports default project name (_)"}}

Callstack shows:

#0  Directus\get_project_config() called at [/var/www/src/core/Directus/Util/DateTimeUtils.php:112]
#1  Directus\Util\DateTimeUtils::nowInTimezone() called at [/var/www/src/core/Directus/Database/TableGateway/RelationalTableGateway.php:2526]
...

Other Context & Screenshots

The issue seems to be a bad usage of get_project_config at https://github.com/directus/api/blob/1cf64403d53e3bf0b6db7ea98402ddae3a94da80/src/core/Directus/Util/DateTimeUtils.php#L112

I am not sure how to fix this issue correctly, because I do not know of the usage of get_project_config of https://github.com/directus/api/blob/1cf64403d53e3bf0b6db7ea98402ddae3a94da80/src/core/Directus/Util/DateTimeUtils.php#L112 is intended or not. If it is not, the DateTimeUtils have to get its time zone from another source, if it is, we have to fix the check here https://github.com/directus/api/blob/master/src/helpers/app.php#L94 or fall back to the default namespace _ by setting the default name to _ here: https://github.com/directus/api/blob/master/src/helpers/app.php#L70

What do you think? Whats the best solution here?

Technical Details

  • Install Method: Docker, latest apache version
bug docker

Most helpful comment

Thanks, now its working smoothly =]

All 6 comments

First of all the i wanted to say the CMS looks amazing compared to other open source CMS i have used.
Correct me if i am wrong, but it looks like WoLfulus fixed this error 2 weeks ago.
If so why not update the docker repo, cuz currently i am stuck with this error for every action i do

@WoLfulus - 馃敂

@bjgajjar even though this is related to docker, it's a bug on the api, and should be here instead (as the fix is done here, not in the docker repository). Docker issues are for image-related problems.

But yes, this should have been fixed and we did make a release yesterday.

@Blazsoul and @lmm-git, please check if this is reproducible using the latest updates (api 2.6.0 and app 7.11.0), if the bug is still present I'll take a look.

Thanks, now its working smoothly =]

Cool! We can close this one.

Seems to work fine now. Thank you!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vuhrmeister picture vuhrmeister  路  3Comments

24js picture 24js  路  3Comments

ondronix picture ondronix  路  3Comments

maettyhawk picture maettyhawk  路  3Comments

cdwmhcc picture cdwmhcc  路  3Comments