プロジェクト

全般

プロフィール

Vote #71032

完了

Error about configuration.yml validness should mention file path

Admin Redmine さんがほぼ4年前に追加. ほぼ4年前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
-
対象バージョン:
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
0
version_id:
36
issue_org_id:
9748
author_id:
936
assigned_to_id:
1
comments:
8
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

We've been using Redmine since the .7.x days, and done several upgrades to stay current, and this is the first time I have had any issues. When I upgraded from 1.0.1 to 1.2.2 in my non-production instance, I get the following when I ran rake --trace db:migrate RAILS_ENV=development:

syntax error on line 150, col 0: `production:'

After grepping around a bit, we found that line in the configuration.yml file. Just a stab in the dark, we commented that out, and tried again. Then we got this one:

syntax error on line 154, col 0: `development:'

Which points to the development entry on line 154 of the configuration.yml file. So, I commented that out too, and ran the rake again with no issues. My non-production instance is now up and running fine.

My question is related to the purpose of those lines as they come shipped in the configuration.yml file. I have to assume they are non commented for a reason. My having to comment them out makes me think something else is incorrect.

The files comments say this:

# specific configuration options for production environment
# that overrides the default ones

Both the production and development lines are enabled, leading me to believe that the file wants to override default values, but where are those default values coming from, and what are they? If I comment both prod and dev out, then are the configuration.yml file settings being used or not? I want to make sure that if I leave them commented out, then I won't be plagued with some continual issues in the future.

Thank you in advance for your help, and as always, nice job on the Redmine project.


journals

Mark P wrote:
> Both the production and development lines are enabled, leading me to believe that the file wants to override default values, but where are those default values coming from, and what are they?

Up in the file, right after:
<pre>
# default configuration options for all environments
default:
</pre>

> If I comment both prod and dev out, then are the configuration.yml file settings being used or not?

Yes.
The global idea is that to put in @default:@ section parameters that are common to all of your environments and put your environment-specific exceptions after @development:@ and @production:@ lines.

--------------------------------------------------------------------------------
I wonder then why the rake task caused a syntax error that could only be fixed by commenting those lines out.
--------------------------------------------------------------------------------
The rake task should not raise an error even if these lines are present. This error means that your configuration.yml is not a valid YAML file. The one provided with Redmine (configuration.yml.example) is a valid one. Did you make any change to this file (like inserting tabs)?
--------------------------------------------------------------------------------
Btw, I agree that YAML is not the best suited format for a configuration file. Maybe we should switch or support an alternative format easier to use.
--------------------------------------------------------------------------------
As far as I know, I never modified that example, simply copied and renamed it to configuration.yml. Regardless, I removed the suspect configuration.yml file, and copied and renamed the example one again. Ran the rake tasks again successfully. The new one based on the example, as you know, has the prod and dev lines enabled. No syntax error.

Also, when I got the syntax error the first time, it did not tell me what file contained the error. I knew it was line 150 in some file, but not the file name. Knowing that would have also helped me troubleshoot.

Regarding the YAML format and the file itself, I did not understand the comments correctly as I assumed the specific config options overriding default ones applied only to the email config due to where that comment resides in the file (toward the top with the other mail config). That was my mis-reading of it. I know very little about YAML file limitations or pros/cons. Given that, I agree that dumbing it down a little more for us kindergartners would be great.

Thank you for your prompt assistance in helping me resolve this.
--------------------------------------------------------------------------------
I've added a specific error message with the path to the yml file in r8112.
--------------------------------------------------------------------------------
Merged in 1.3-stable.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------


related_issues

relates,Closed,35421,Unhandled exception when a YAML syntax error is detected in configuration.yml

Admin Redmine さんがほぼ4年前に更新

  • 対象バージョン1.3.0_36 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0