You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apisix.apache.org by YuanSheng Wang <me...@apache.org> on 2020/03/11 12:16:24 UTC

Apache APISIX users use a different versions of `conf/config.yaml`

Hi:

Apache APISIX users use a different version of `conf/config.yaml`,
this caused the service to fail to start.

The update of Apache APISIX may cause the file `conf / config.yaml` to
be incompatible.

There are two ways to resolve this bug:
1 Uses a version field in the file `conf/config.yaml`, the Apache
APISIX can only work with the specified version config file.
2 Uses `jsonschema`[1] to check the configuration and identify such
errors early.

[1] https://github.com/api7/jsonschema

-- 
MembPhis
My github: https://github.com/membphis
Apache APISIX: https://github.com/apache/incubator-apisix

Re: Apache APISIX users use a different versions of `conf/config.yaml`

Posted by Ming Wen <we...@apache.org>.
To solve this problem fundamentally, it is necessary to adopt a tiled
structure instead of the current hierarchical structure.

YuanSheng Wang <me...@apache.org>于2020年3月12日 周四下午8:25写道:

> >  I think you should consider the full upgrade plan for
> > `conf/config.yaml` between differeent APISIX version,
> > not just add the version number.
>
> This file should be managed by the user. This file is the foundation of
> Apache APISIX.
>
> I don't think we can help users upgrade the configuration file `conf /
> config.yaml`,
> sometimes we don't even know how to fix it.
>
> It is wrong, it may be because the user wrote it wrong, or it may be
> because the version
> is too old.
>
> It is enough to make the error message friendly.
>
> On Thu, Mar 12, 2020 at 2:56 PM Ming Wen <we...@apache.org> wrote:
>
> > > If we use the latest configuration file + APISIX 1.0 to work together,
> it
> > will fail to start.
> > yes, start fail is expected in this case.
> >
> > your option 1 and option 2 are aim to make error msg friendly? Or you
> want
> > to check valid before start APISIX?
> > For the former, I don't think it's necessary;
> > for the latter, I think you should consider the full upgrade plan for
> > `conf/config.yaml` between differeent APISIX version,
> > not just add the version number.
> >
> > Thanks,
> > Ming Wen, Apache APISIX & Apache SkyWalking
> > Twitter: _WenMing
> >
> >
> > YuanSheng Wang <me...@apache.org> 于2020年3月12日周四 下午12:13写道:
> >
> > > On Wed, Mar 11, 2020 at 8:37 PM Ming Wen <we...@apache.org> wrote:
> > > >
> > > > can you give some examples to explain the start fail?
> > >
> > > If we use the latest configuration file + APISIX 1.0 to work together,
> it
> > > will fail to start.
> > >
> > > Version 1.0 configuration file:
> > >
> > >     apisix:
> > >     ... ...
> > >         real_ip_header: "X-Real-IP"
> > >
> > >
> > > *real_ip_from:                               - 127.0.0.1            -
> > > 'unix:'*
> > >
> > > Current latest configuration file:
> > >
> > >     apisix:
> > >         ... ...
> > >     nginx_config:
> > >         http:
> > >             real_ip_header: "X-Real-IP"
> > >
> > >
> > > * real_ip_from:                              - 127.0.0.1            -
> > > 'unix:'*
> > > >
> > > > YuanSheng Wang <me...@apache.org>于2020年3月11日 周三下午8:16写道:
> > > >
> > > > > Hi:
> > > > >
> > > > > Apache APISIX users use a different version of `conf/config.yaml`,
> > > > > this caused the service to fail to start.
> > > > >
> > > > > The update of Apache APISIX may cause the file `conf / config.yaml`
> > to
> > > > > be incompatible.
> > > > >
> > > > > There are two ways to resolve this bug:
> > > > > 1 Uses a version field in the file `conf/config.yaml`, the Apache
> > > > > APISIX can only work with the specified version config file.
> > > > > 2 Uses `jsonschema`[1] to check the configuration and identify such
> > > > > errors early.
> > > > >
> > > > > [1] https://github.com/api7/jsonschema
> > > > >
> > > > > --
> > > > > MembPhis
> > > > > My github: https://github.com/membphis
> > > > > Apache APISIX: https://github.com/apache/incubator-apisix
> > > > >
> > > > --
> > > > Thanks,
> > > > Ming Wen, Apache APISIX & Apache SkyWalking
> > > > Twitter: _WenMing
> > >
> > >
> > >
> > > --
> > > MembPhis
> > > My github: https://github.com/membphis
> > > Apache APISIX: https://github.com/apache/incubator-apisix
> > >
> >
>
>
> --
> *MembPhis*
> My github: https://github.com/membphis
> Apache APISIX: https://github.com/apache/incubator-apisix
>
-- 
Thanks,
Ming Wen, Apache APISIX & Apache SkyWalking
Twitter: _WenMing

Re: Apache APISIX users use a different versions of `conf/config.yaml`

Posted by YuanSheng Wang <me...@apache.org>.
>  I think you should consider the full upgrade plan for
> `conf/config.yaml` between differeent APISIX version,
> not just add the version number.

This file should be managed by the user. This file is the foundation of
Apache APISIX.

I don't think we can help users upgrade the configuration file `conf /
config.yaml`,
sometimes we don't even know how to fix it.

It is wrong, it may be because the user wrote it wrong, or it may be
because the version
is too old.

It is enough to make the error message friendly.

On Thu, Mar 12, 2020 at 2:56 PM Ming Wen <we...@apache.org> wrote:

> > If we use the latest configuration file + APISIX 1.0 to work together, it
> will fail to start.
> yes, start fail is expected in this case.
>
> your option 1 and option 2 are aim to make error msg friendly? Or you want
> to check valid before start APISIX?
> For the former, I don't think it's necessary;
> for the latter, I think you should consider the full upgrade plan for
> `conf/config.yaml` between differeent APISIX version,
> not just add the version number.
>
> Thanks,
> Ming Wen, Apache APISIX & Apache SkyWalking
> Twitter: _WenMing
>
>
> YuanSheng Wang <me...@apache.org> 于2020年3月12日周四 下午12:13写道:
>
> > On Wed, Mar 11, 2020 at 8:37 PM Ming Wen <we...@apache.org> wrote:
> > >
> > > can you give some examples to explain the start fail?
> >
> > If we use the latest configuration file + APISIX 1.0 to work together, it
> > will fail to start.
> >
> > Version 1.0 configuration file:
> >
> >     apisix:
> >     ... ...
> >         real_ip_header: "X-Real-IP"
> >
> >
> > *real_ip_from:                               - 127.0.0.1            -
> > 'unix:'*
> >
> > Current latest configuration file:
> >
> >     apisix:
> >         ... ...
> >     nginx_config:
> >         http:
> >             real_ip_header: "X-Real-IP"
> >
> >
> > * real_ip_from:                              - 127.0.0.1            -
> > 'unix:'*
> > >
> > > YuanSheng Wang <me...@apache.org>于2020年3月11日 周三下午8:16写道:
> > >
> > > > Hi:
> > > >
> > > > Apache APISIX users use a different version of `conf/config.yaml`,
> > > > this caused the service to fail to start.
> > > >
> > > > The update of Apache APISIX may cause the file `conf / config.yaml`
> to
> > > > be incompatible.
> > > >
> > > > There are two ways to resolve this bug:
> > > > 1 Uses a version field in the file `conf/config.yaml`, the Apache
> > > > APISIX can only work with the specified version config file.
> > > > 2 Uses `jsonschema`[1] to check the configuration and identify such
> > > > errors early.
> > > >
> > > > [1] https://github.com/api7/jsonschema
> > > >
> > > > --
> > > > MembPhis
> > > > My github: https://github.com/membphis
> > > > Apache APISIX: https://github.com/apache/incubator-apisix
> > > >
> > > --
> > > Thanks,
> > > Ming Wen, Apache APISIX & Apache SkyWalking
> > > Twitter: _WenMing
> >
> >
> >
> > --
> > MembPhis
> > My github: https://github.com/membphis
> > Apache APISIX: https://github.com/apache/incubator-apisix
> >
>


-- 
*MembPhis*
My github: https://github.com/membphis
Apache APISIX: https://github.com/apache/incubator-apisix

Re: Apache APISIX users use a different versions of `conf/config.yaml`

Posted by Ming Wen <we...@apache.org>.
> If we use the latest configuration file + APISIX 1.0 to work together, it
will fail to start.
yes, start fail is expected in this case.

your option 1 and option 2 are aim to make error msg friendly? Or you want
to check valid before start APISIX?
For the former, I don't think it's necessary;
for the latter, I think you should consider the full upgrade plan for
`conf/config.yaml` between differeent APISIX version,
not just add the version number.

Thanks,
Ming Wen, Apache APISIX & Apache SkyWalking
Twitter: _WenMing


YuanSheng Wang <me...@apache.org> 于2020年3月12日周四 下午12:13写道:

> On Wed, Mar 11, 2020 at 8:37 PM Ming Wen <we...@apache.org> wrote:
> >
> > can you give some examples to explain the start fail?
>
> If we use the latest configuration file + APISIX 1.0 to work together, it
> will fail to start.
>
> Version 1.0 configuration file:
>
>     apisix:
>     ... ...
>         real_ip_header: "X-Real-IP"
>
>
> *real_ip_from:                               - 127.0.0.1            -
> 'unix:'*
>
> Current latest configuration file:
>
>     apisix:
>         ... ...
>     nginx_config:
>         http:
>             real_ip_header: "X-Real-IP"
>
>
> * real_ip_from:                              - 127.0.0.1            -
> 'unix:'*
> >
> > YuanSheng Wang <me...@apache.org>于2020年3月11日 周三下午8:16写道:
> >
> > > Hi:
> > >
> > > Apache APISIX users use a different version of `conf/config.yaml`,
> > > this caused the service to fail to start.
> > >
> > > The update of Apache APISIX may cause the file `conf / config.yaml` to
> > > be incompatible.
> > >
> > > There are two ways to resolve this bug:
> > > 1 Uses a version field in the file `conf/config.yaml`, the Apache
> > > APISIX can only work with the specified version config file.
> > > 2 Uses `jsonschema`[1] to check the configuration and identify such
> > > errors early.
> > >
> > > [1] https://github.com/api7/jsonschema
> > >
> > > --
> > > MembPhis
> > > My github: https://github.com/membphis
> > > Apache APISIX: https://github.com/apache/incubator-apisix
> > >
> > --
> > Thanks,
> > Ming Wen, Apache APISIX & Apache SkyWalking
> > Twitter: _WenMing
>
>
>
> --
> MembPhis
> My github: https://github.com/membphis
> Apache APISIX: https://github.com/apache/incubator-apisix
>

Re: Apache APISIX users use a different versions of `conf/config.yaml`

Posted by YuanSheng Wang <me...@apache.org>.
On Wed, Mar 11, 2020 at 8:37 PM Ming Wen <we...@apache.org> wrote:
>
> can you give some examples to explain the start fail?

If we use the latest configuration file + APISIX 1.0 to work together, it
will fail to start.

Version 1.0 configuration file:

    apisix:
    ... ...
        real_ip_header: "X-Real-IP"


*real_ip_from:                               - 127.0.0.1            -
'unix:'*

Current latest configuration file:

    apisix:
        ... ...
    nginx_config:
        http:
            real_ip_header: "X-Real-IP"


* real_ip_from:                              - 127.0.0.1            -
'unix:'*
>
> YuanSheng Wang <me...@apache.org>于2020年3月11日 周三下午8:16写道:
>
> > Hi:
> >
> > Apache APISIX users use a different version of `conf/config.yaml`,
> > this caused the service to fail to start.
> >
> > The update of Apache APISIX may cause the file `conf / config.yaml` to
> > be incompatible.
> >
> > There are two ways to resolve this bug:
> > 1 Uses a version field in the file `conf/config.yaml`, the Apache
> > APISIX can only work with the specified version config file.
> > 2 Uses `jsonschema`[1] to check the configuration and identify such
> > errors early.
> >
> > [1] https://github.com/api7/jsonschema
> >
> > --
> > MembPhis
> > My github: https://github.com/membphis
> > Apache APISIX: https://github.com/apache/incubator-apisix
> >
> --
> Thanks,
> Ming Wen, Apache APISIX & Apache SkyWalking
> Twitter: _WenMing



-- 
MembPhis
My github: https://github.com/membphis
Apache APISIX: https://github.com/apache/incubator-apisix

Re: Apache APISIX users use a different versions of `conf/config.yaml`

Posted by junxu chen <ch...@apache.org>.
I prefer option 2.

It looks more reliable than option 1.



On Wed, Mar 11, 2020 at 8:37 PM Ming Wen <we...@apache.org> wrote:

> can you give some examples to explain the start fail?
>
> YuanSheng Wang <me...@apache.org>于2020年3月11日 周三下午8:16写道:
>
> > Hi:
> >
> > Apache APISIX users use a different version of `conf/config.yaml`,
> > this caused the service to fail to start.
> >
> > The update of Apache APISIX may cause the file `conf / config.yaml` to
> > be incompatible.
> >
> > There are two ways to resolve this bug:
> > 1 Uses a version field in the file `conf/config.yaml`, the Apache
> > APISIX can only work with the specified version config file.
> > 2 Uses `jsonschema`[1] to check the configuration and identify such
> > errors early.
> >
> > [1] https://github.com/api7/jsonschema
> >
> > --
> > MembPhis
> > My github: https://github.com/membphis
> > Apache APISIX: https://github.com/apache/incubator-apisix
> >
> --
> Thanks,
> Ming Wen, Apache APISIX & Apache SkyWalking
> Twitter: _WenMing
>

Re: Apache APISIX users use a different versions of `conf/config.yaml`

Posted by Ming Wen <we...@apache.org>.
can you give some examples to explain the start fail?

YuanSheng Wang <me...@apache.org>于2020年3月11日 周三下午8:16写道:

> Hi:
>
> Apache APISIX users use a different version of `conf/config.yaml`,
> this caused the service to fail to start.
>
> The update of Apache APISIX may cause the file `conf / config.yaml` to
> be incompatible.
>
> There are two ways to resolve this bug:
> 1 Uses a version field in the file `conf/config.yaml`, the Apache
> APISIX can only work with the specified version config file.
> 2 Uses `jsonschema`[1] to check the configuration and identify such
> errors early.
>
> [1] https://github.com/api7/jsonschema
>
> --
> MembPhis
> My github: https://github.com/membphis
> Apache APISIX: https://github.com/apache/incubator-apisix
>
-- 
Thanks,
Ming Wen, Apache APISIX & Apache SkyWalking
Twitter: _WenMing

Re: Apache APISIX users use a different versions of `conf/config.yaml`

Posted by Jan Li <ja...@airwallex.com>.
Vote for option 1, and I think we can check the version in *apisix ini**t* and
report error if version is incompatible.

On Wed, Mar 11, 2020 at 8:16 PM YuanSheng Wang <me...@apache.org> wrote:

> Hi:
>
> Apache APISIX users use a different version of `conf/config.yaml`,
> this caused the service to fail to start.
>
> The update of Apache APISIX may cause the file `conf / config.yaml` to
> be incompatible.
>
> There are two ways to resolve this bug:
> 1 Uses a version field in the file `conf/config.yaml`, the Apache
> APISIX can only work with the specified version config file.
> 2 Uses `jsonschema`[1] to check the configuration and identify such
> errors early.
>
> [1] https://github.com/api7/jsonschema
>
> --
> MembPhis
> My github: https://github.com/membphis
> Apache APISIX: https://github.com/apache/incubator-apisix
>