text:
Dock : Line number is truncated ("131" becomes "13")

Hi !
I've just installed the project and stumbled upon an issue : it seems that, in long files, the line number is shown incorrectly.
In-engine screenshot :

Manually running gdlint in terminal :

As we can see, gdlint reports the correct line number (131), while the plugin truncates it to the first 2 characters (13).

Godot : v4.2.2.stable.official [15073afe3]
GDLint Plugin : 2.0.2, installed in-engine through AssetLib
gdlint : 4.2.2, installed with pip3
Thanks for the plugin ! :tada:

I'm doing some digging :
In Dock.gd, at create_item(), the line number is still correct :
func create_item(line: int, name: String) -> void:
        #>> Start ninja debugging <<#
	print("GDLint : got error at line :")
	print(line)
        #>> End ninja debugging <<#

	var regex = RegEx.new()
	regex.compile("(?<=\\()[^\\)]+")
	var result := regex.search_all(name)
	var error_type := result[-1].strings[0]
	if _ignore.get(str_dash_to_underscore(error_type)):
		num_ignored_problems += 1
		return

	var item := tree.create_item()
	item.set_text(0, str(line))
	item.set_text(1, name)
	item.set_metadata(0, line)

	if error_descriptions.error.has(error_type):
		item.set_tooltip_text(1, error_descriptions.error[error_type])
	num_problems += 1

Outputs :
GDLint : got error at line :
131

Thank you for the bug report, that's interesting that Godot doesn't respect the minimum size I set the column to.

repo: el-falso/gdlinter


text:
Cost lore new line

Hello,
I would like to set two lines of text in "cost_lore" on items sold in magic shops. Something like :
&5&oLeft click to buy 1 unit
&f&lCost : 1000$
So I tried : cost_lore: "&5&oLeft click to buy 1 unit\n&f&lCost : 1000$" but \n doesn't work. How can I do that ?

Well one option is I change cost lore to support newlines, but I think a better approach would be to add a secondary message that would go in front of costs, where you would put just "&5&oLeft click to buy 1 unit".
Otherwise items that have multiple different costs (possible in the Selector at least, not actually sure bout ItemShop though) would look weird.
Would that work for you?

Yes, you can add an option to do that, it's better.
Thanks !

Added to latest dev build as shops.cost_headingin messsages.yml
Can also be customized per-shop.

Added in latest release!

source: gharchive/issue

repo: elBukkit/MagicPlugin

license: MIT

license_type: permissive

license_source: github-api


text:
Create Posts “web-components-by-dave-rupert”

Automatically generated by Netlify CMS

👷 Deploy Preview for benevolent-muffin-215770 processing.

Name
Link

🔨 Latest commit
5a7ea43aa3ab3e2cf6dccb8f46c0d362ec0b532a

🔍 Latest deploy log
https://app.netlify.com/sites/benevolent-muffin-215770/deploys/6286e33a6d38d7000879c6df

source: gharchive/pull-request

repo: elFani/hylia-starter


text:
before_action instead of after_action for :verify_authorized?

Hey! I was looking for an alternative to cancan and stumbled on pundit and I'd say it looks very nice. I saw this in the README, though:

Ensuring policies are used

Pundit adds a method called verify_authorized to your controllers. This
method will raise an exception if authorize has not yet been called. You
should run this method in an after_action to ensure that you haven't
forgotten to authorize the action. For example:

class ApplicationController < ActionController::Base
after_action :verify_authorized, :except => :index
end

This seems to suggest that authorization checks should only be run after the action. As far as I know (I might be wrong, though), this means that the action would run entirely before the exception is raised, which in turn would mean the changes the user is trying to make would take place, even though they just wouldn't see the results in the server's response.

Wouldn't this give a false sense of security and potentially constitute a security issue?

Wouldn't it be correct to use `before_action` instead?

Hi @jnicklas, I agree with @gabrielecirulli that this method definitely can give a false sense of security. The use of this after_action is a bit confusing/mis-leading. Is the original use case for developers to use this during development only to flag methods that don't call authorize? Is this to catch instances in production that don't call authorize? If the latter is the case, then the vulnerability will still exist for any state-changing controller action. If the former is the case, then does a developer just leave this in their code even though it shouldn't ever have any implications in production code? I went through the same thought process as @gabrielecirulli after reading that section.
I think at the very least, there should be an explicit warning in that section of the README for developers not to rely on this method in production and that state changing actions will persist even after the exception is raised.

Is the original use case for developers to use this during development only to flag methods that don't call authorize?

Yes.

If the former is the case, then does a developer just leave this in their code even though it shouldn't ever have any implications in production code?

Yes. Because the whole point is that code changes, and someone else might do something which causes authorization not to be performed. It's a safety net. Removing it removes the safety net.

This method will raise an exception if authorize has not yet been called.

I'm not really sure how we can make this much clearer. If you actually read this section, I think it's pretty clear what this is for. I'd be open to a PR improving the documentation here if you feel strongly about it.

authors: gabrielecirulli jnicklas tomekr

repo: elabs/pundit

license: mit

license_source: bigquery


text:
Elasticsearch 8 support

What does this pull request do?
Add support and testing for elasticsearch-py 8.x
Related issues
Closes #1617

:broken_heart: Tests Failed

the below badges are clickable and redirect to their specific view in the CI or DOCS

Expand to view the summary

Build stats

Start Time: 2022-09-20T13:21:55.578+0000

Duration: 20 min 39 sec

Test stats :test_tube:

Test
Results

Failed
31

Passed
4911

Skipped
2934

Total
7876

Test errors
Expand to view the tests failures
    > Show only the first 10 test failures
Initializing / Test / Python-python-3.10-0 / test_ping – tests.instrumentation.elasticsearch_tests

Expand to view the error details
 AssertionError: assert {'address': '..., 'type': ''}} == {'address': '..., 'type': ''}}
  Omitting 1 identical items, use -vv to show
  Differing items:
  {'address': 'elasticsearch8'} != {'address': 'http://elasticsearch8:9200'}
  Full diff:
    {
  -  'address': 'http://elasticsearch8:9200',
  ?              -------              -----...

  ...Full output truncated (4 lines hidden), use '-vv' to show

Expand to view the stacktrace
 instrument = None
elasticapm_client = <tests.fixtures.TempStoreClient object at 0x7f80b1d70280>
elasticsearch = <Elasticsearch(['http://elasticsearch8:9200'])>

    @pytest.mark.integrationtest
    def test_ping(instrument, elasticapm_client, elasticsearch):
        elasticapm_client.begin_transaction("test")
        result = elasticsearch.ping()
        elasticapm_client.end_transaction("test", "OK")

        transaction = elasticapm_client.events[TRANSACTION][0]
        spans = elasticapm_client.spans_for_transaction(transaction)
        assert len(spans) == 1
        span = spans[0]
        assert span["name"] == "ES HEAD /"
        assert span["type"] == "db"
        assert span["subtype"] == "elasticsearch"
        assert span["action"] == "query"
>       assert span["context"]["destination"] == {
            "address": os.environ["ES_URL"],
            "service": {"name": "", "resource": "elasticsearch", "type": ""},
        }
E       AssertionError: assert {'address': '..., 'type': ''}} == {'address': '..., 'type': ''}}
E         Omitting 1 identical items, use -vv to show
E         Differing items:
E         {'address': 'elasticsearch8'} != {'address': 'http://elasticsearch8:9200'}
E         Full diff:
E           {
E         -  'address': 'http://elasticsearch8:9200',
E         ?              -------              -----...
E
E         ...Full output truncated (4 lines hidden), use '-vv' to show

elasticapm_client = <tests.fixtures.TempStoreClient object at 0x7f80b1d70280>
elasticsearch = <Elasticsearch(['http://elasticsearch8:9200'])>
instrument = None
result     = True
span       = {'action': 'query', 'context': {'db': {'type': 'elasticsearch'}, 'destination': {'address': 'elasticsearch8', 'service...tatus_code': 200}, 'service': {'target': {'type': 'elasticsearch'}}}, 'duration': 7.364, 'id': '7627bf300e3df57b', ...}
spans      = [{'action': 'query', 'context': {'db': {'type': 'elasticsearch'}, 'destination': {'address': 'elasticsearch8', 'servic...atus_code': 200}, 'service': {'target': {'type': 'elasticsearch'}}}, 'duration': 7.364, 'id': '7627bf300e3df57b', ...}]
transaction = {'context': {'tags': {}}, 'duration': 21.666, 'id': 'b8df43bf3e6568ba', 'name': 'test', ...}

tests/instrumentation/elasticsearch_tests.py:117: AssertionError

Initializing / Test / Python-python-3.10-0 / test_create – tests.instrumentation.asyncio_tests.async_elasticsearch_client_tests

Expand to view the error details
 TypeError: Positional arguments can't be used with Elasticsearch API methods. Instead only use keyword arguments.

Expand to view the stacktrace
 instrument = None
elasticapm_client = <tests.fixtures.TempStoreClient object at 0x7f80b1cce710>
async_elasticsearch = <AsyncElasticsearch(['http://elasticsearch8:9200'])>

    async def test_create(instrument, elasticapm_client, async_elasticsearch):
        elasticapm_client.begin_transaction("test")
        if ES_VERSION[0] < 5:
            r1 = await async_elasticsearch.create("tweets", document_type, {"user": "kimchy", "text": "hola"}, 1)
        elif ES_VERSION[0] < 7:
            r1 = await async_elasticsearch.create("tweets", document_type, 1, body={"user": "kimchy", "text": "hola"})
        else:
>           r1 = await async_elasticsearch.create("tweets", 1, body={"user": "kimchy", "text": "hola"})

async_elasticsearch = <AsyncElasticsearch(['http://elasticsearch8:9200'])>
elasticapm_client = <tests.fixtures.TempStoreClient object at 0x7f80b1cce710>
instrument = None

tests/instrumentation/asyncio_tests/async_elasticsearch_client_tests.py:104:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

args = (<AsyncElasticsearch(['http://elasticsearch8:9200'])>, 'tweets', 1)
kwargs = {'body': {'text': 'hola', 'user': 'kimchy'}}

    @wraps(api)
    def wrapped(*args: Any, **kwargs: Any) -> Any:
        nonlocal api, body_name, body_fields

        # Let's give a nicer error message when users pass positional arguments.
        if len(args) >= 2:
>           raise TypeError(
                "Positional arguments can't be used with Elasticsearch API methods. "
                "Instead only use keyword arguments."
            )
E           TypeError: Positional arguments can't be used with Elasticsearch API methods. Instead only use keyword arguments.

api        = <function AsyncElasticsearch.create at 0x7f80b2009630>
args       = (<AsyncElasticsearch(['http://elasticsearch8:9200'])>, 'tweets', 1)
body_fields = False
body_name  = 'document'
ignore_deprecated_options = None
kwargs     = {'body': {'text': 'hola', 'user': 'kimchy'}}
parameter_aliases = None

/home/user/.local/lib/python3.10/site-packages/elasticsearch/_sync/client/utils.py:307: TypeError

Initializing / Test / Python-python-3.10-0 / test_search_body – tests.instrumentation.asyncio_tests.async_elasticsearch_client_tests

Expand to view the error details
 TypeError: AsyncElasticsearch.create() got an unexpected keyword argument 'doc_type'

Expand to view the stacktrace
 instrument = None
elasticapm_client = <tests.fixtures.TempStoreClient object at 0x7f80b2ae7d00>
async_elasticsearch = <AsyncElasticsearch(['http://elasticsearch8:9200'])>

    async def test_search_body(instrument, elasticapm_client, async_elasticsearch):
>       await async_elasticsearch.create(
            index="tweets", doc_type=document_type, id=1, body={"user": "kimchy", "text": "hola", "userid": 1}, refresh=True
        )

async_elasticsearch = <AsyncElasticsearch(['http://elasticsearch8:9200'])>
elasticapm_client = <tests.fixtures.TempStoreClient object at 0x7f80b2ae7d00>
instrument = None

tests/instrumentation/asyncio_tests/async_elasticsearch_client_tests.py:132:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

args = (<AsyncElasticsearch(['http://elasticsearch8:9200'])>,)
kwargs = {'doc_type': '_doc', 'document': {'text': 'hola', 'user': 'kimchy', 'userid': 1}, 'id': 1, 'index': 'tweets', ...}
maybe_transport_options = set()
body = {'text': 'hola', 'user': 'kimchy', 'userid': 1}

    @wraps(api)
    def wrapped(*args: Any, **kwargs: Any) -> Any:
        nonlocal api, body_name, body_fields

        # Let's give a nicer error message when users pass positional arguments.
        if len(args) >= 2:
            raise TypeError(
                "Positional arguments can't be used with Elasticsearch API methods. "
                "Instead only use keyword arguments."
            )

        # We merge 'params' first as transport options can be specified using params.
        if "params" in kwargs and (
            not ignore_deprecated_options
            or "params" not in ignore_deprecated_options
        ):
            params = kwargs.pop("params")
            if params:
                if not hasattr(params, "items"):
                    raise ValueError(
                        "Couldn't merge 'params' with other parameters as it wasn't a mapping. "
                        "Instead of using 'params' use individual API parameters"
                    )
                warnings.warn(
                    "The 'params' parameter is deprecated and will be removed "
                    "in a future version. Instead use individual parameters.",
                    category=DeprecationWarning,
                    stacklevel=warn_stacklevel(),
                )
                _merge_kwargs_no_duplicates(kwargs, params)

        maybe_transport_options = _TRANSPORT_OPTIONS.intersection(kwargs)
        if maybe_transport_options:
            transport_options = {}
            for option in maybe_transport_options:
                if (
                    ignore_deprecated_options
                    and option in ignore_deprecated_options
                ):
                    continue
                try:
                    option_rename = option
                    if option == "ignore":
                        option_rename = "ignore_status"
                    transport_options[option_rename] = kwargs.pop(option)
                except KeyError:
                    pass
            if transport_options:
                warnings.warn(
                    "Passing transport options in the API method is deprecated. Use 'Elasticsearch.options()' instead.",
                    category=DeprecationWarning,
                    stacklevel=warn_stacklevel(),
                )
                client = args[0]

                # Namespaced clients need to unwrapped.
                namespaced_client: Optional[Type["NamespacedClient"]] = None
                if hasattr(client, "_client"):
                    namespaced_client = type(client)
                    client = client._client

                client = client.options(**transport_options)

                # Re-wrap the client if we unwrapped due to being namespaced.
                if namespaced_client is not None:
                    client = namespaced_client(client)
                args = (client,) + args[1:]

        if "body" in kwargs and (
            not ignore_deprecated_options or "body" not in ignore_deprecated_options
        ):
            body = kwargs.pop("body")
            if body is not None:
                if body_name:
                    if body_name in kwargs:
                        raise TypeError(
                            f"Can't use '{body_name}' and 'body' parameters together because '{body_name}' "
                            "is an alias for 'body'. Instead you should only use the "
                            f"'{body_name}' parameter. See https://github.com/elastic/elasticsearch-py/"
                            "issues/1698 for more information"
                        )

                    warnings.warn(
                        "The 'body' parameter is deprecated and will be removed "
                        f"in a future version. Instead use the '{body_name}' parameter. "
                        "See https://github.com/elastic/elasticsearch-py/issues/1698 "
                        "for more information",
                        category=DeprecationWarning,
                        stacklevel=warn_stacklevel(),
                    )
                    kwargs[body_name] = body

                elif body_fields:
                    if not hasattr(body, "items"):
                        raise ValueError(
                            "Couldn't merge 'body' with other parameters as it wasn't a mapping. "
                            "Instead of using 'body' use individual API parameters"
                        )
                    warnings.warn(
                        "The 'body' parameter is deprecated and will be removed "
                        "in a future version. Instead use individual parameters.",
                        category=DeprecationWarning,
                        stacklevel=warn_stacklevel(),
                    )
                    _merge_kwargs_no_duplicates(kwargs, body)

        if parameter_aliases:
            for alias, rename_to in parameter_aliases.items():
                try:
                    kwargs[rename_to] = kwargs.pop(alias)
                except KeyError:
                    pass

>       return api(*args, **kwargs)
E       TypeError: AsyncElasticsearch.create() got an unexpected keyword argument 'doc_type'

api        = <function AsyncElasticsearch.create at 0x7f80b2009630>
args       = (<AsyncElasticsearch(['http://elasticsearch8:9200'])>,)
body       = {'text': 'hola', 'user': 'kimchy', 'userid': 1}
body_fields = False
body_name  = 'document'
ignore_deprecated_options = None
kwargs     = {'doc_type': '_doc', 'document': {'text': 'hola', 'user': 'kimchy', 'userid': 1}, 'id': 1, 'index': 'tweets', ...}
maybe_transport_options = set()
parameter_aliases = None

/home/user/.local/lib/python3.10/site-packages/elasticsearch/_sync/client/utils.py:414: TypeError

Initializing / Test / Python-python-3.10-0 / test_count_body – tests.instrumentation.asyncio_tests.async_elasticsearch_client_tests

Expand to view the error details
 TypeError: AsyncElasticsearch.create() got an unexpected keyword argument 'doc_type'

Expand to view the stacktrace
 instrument = None
elasticapm_client = <tests.fixtures.TempStoreClient object at 0x7f80b26b8a00>
async_elasticsearch = <AsyncElasticsearch(['http://elasticsearch8:9200'])>

    async def test_count_body(instrument, elasticapm_client, async_elasticsearch):
>       await async_elasticsearch.create(
            index="tweets", doc_type=document_type, id=1, body={"user": "kimchy", "text": "hola"}, refresh=True
        )

async_elasticsearch = <AsyncElasticsearch(['http://elasticsearch8:9200'])>
elasticapm_client = <tests.fixtures.TempStoreClient object at 0x7f80b26b8a00>
instrument = None

tests/instrumentation/asyncio_tests/async_elasticsearch_client_tests.py:163:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

args = (<AsyncElasticsearch(['http://elasticsearch8:9200'])>,)
kwargs = {'doc_type': '_doc', 'document': {'text': 'hola', 'user': 'kimchy'}, 'id': 1, 'index': 'tweets', ...}
maybe_transport_options = set(), body = {'text': 'hola', 'user': 'kimchy'}

    @wraps(api)
    def wrapped(*args: Any, **kwargs: Any) -> Any:
        nonlocal api, body_name, body_fields

        # Let's give a nicer error message when users pass positional arguments.
        if len(args) >= 2:
            raise TypeError(
                "Positional arguments can't be used with Elasticsearch API methods. "
                "Instead only use keyword arguments."
            )

        # We merge 'params' first as transport options can be specified using params.
        if "params" in kwargs and (
            not ignore_deprecated_options
            or "params" not in ignore_deprecated_options
        ):
            params = kwargs.pop("params")
            if params:
                if not hasattr(params, "items"):
                    raise ValueError(
                        "Couldn't merge 'params' with other parameters as it wasn't a mapping. "
                        "Instead of using 'params' use individual API parameters"
                    )
                warnings.warn(
                    "The 'params' parameter is deprecated and will be removed "
                    "in a future version. Instead use individual parameters.",
                    category=DeprecationWarning,
                    stacklevel=warn_stacklevel(),
                )
                _merge_kwargs_no_duplicates(kwargs, params)

        maybe_transport_options = _TRANSPORT_OPTIONS.intersection(kwargs)
        if maybe_transport_options:
            transport_options = {}
            for option in maybe_transport_options:
                if (
                    ignore_deprecated_options
                    and option in ignore_deprecated_options
                ):
                    continue
                try:
                    option_rename = option
                    if option == "ignore":
                        option_rename = "ignore_status"
                    transport_options[option_rename] = kwargs.pop(option)
                except KeyError:
                    pass
            if transport_options:
                warnings.warn(
                    "Passing transport options in the API method is deprecated. Use 'Elasticsearch.options()' instead.",
                    category=DeprecationWarning,
                    stacklevel=warn_stacklevel(),
                )
                client = args[0]

                # Namespaced clients need to unwrapped.
                namespaced_client: Optional[Type["NamespacedClient"]] = None
                if hasattr(client, "_client"):
                    namespaced_client = type(client)
                    client = client._client

                client = client.options(**transport_options)

                # Re-wrap the client if we unwrapped due to being namespaced.
                if namespaced_client is not None:
                    client = namespaced_client(client)
                args = (client,) + args[1:]

        if "body" in kwargs and (
            not ignore_deprecated_options or "body" not in ignore_deprecated_options
        ):
            body = kwargs.pop("body")
            if body is not None:
                if body_name:
                    if body_name in kwargs:
                        raise TypeError(
                            f"Can't use '{body_name}' and 'body' parameters together because '{body_name}' "
                            "is an alias for 'body'. Instead you should only use the "
                            f"'{body_name}' parameter. See https://github.com/elastic/elasticsearch-py/"
                            "issues/1698 for more information"
                        )

                    warnings.warn(
                        "The 'body' parameter is deprecated and will be removed "
                        f"in a future version. Instead use the '{body_name}' parameter. "
                        "See https://github.com/elastic/elasticsearch-py/issues/1698 "
                        "for more information",
                        category=DeprecationWarning,
                        stacklevel=warn_stacklevel(),
                    )
                    kwargs[body_name] = body

                elif body_fields:
                    if not hasattr(body, "items"):
                        raise ValueError(
                            "Couldn't merge 'body' with other parameters as it wasn't a mapping. "
                            "Instead of using 'body' use individual API parameters"
                        )
                    warnings.warn(
                        "The 'body' parameter is deprecated and will be removed "
                        "in a future version. Instead use individual parameters.",
                        category=DeprecationWarning,
                        stacklevel=warn_stacklevel(),
                    )
                    _merge_kwargs_no_duplicates(kwargs, body)

        if parameter_aliases:
            for alias, rename_to in parameter_aliases.items():
                try:
                    kwargs[rename_to] = kwargs.pop(alias)
                except KeyError:
                    pass

>       return api(*args, **kwargs)
E       TypeError: AsyncElasticsearch.create() got an unexpected keyword argument 'doc_type'

api        = <function AsyncElasticsearch.create at 0x7f80b2009630>
args       = (<AsyncElasticsearch(['http://elasticsearch8:9200'])>,)
body       = {'text': 'hola', 'user': 'kimchy'}
body_fields = False
body_name  = 'document'
ignore_deprecated_options = None
kwargs     = {'doc_type': '_doc', 'document': {'text': 'hola', 'user': 'kimchy'}, 'id': 1, 'index': 'tweets', ...}
maybe_transport_options = set()
parameter_aliases = None

/home/user/.local/lib/python3.10/site-packages/elasticsearch/_sync/client/utils.py:414: TypeError

Initializing / Test / Python-python-3.6-4 / test_create – tests.instrumentation.elasticsearch_tests

Expand to view the error details
 elasticsearch.exceptions.RequestError: TransportError(400, 'invalid_type_name_exception', "Document mapping type name can't start with '_'")

Expand to view the stacktrace
 instrument = None
elasticapm_client = <tests.fixtures.TempStoreClient object at 0x7f0caa759cc0>
elasticsearch = <Elasticsearch([{'host': 'elasticsearch2', 'port': 9200, 'scheme': 'http'}])>

    @pytest.mark.integrationtest
    def test_create(instrument, elasticapm_client, elasticsearch):
        elasticapm_client.begin_transaction("test")
>       elasticsearch.create(index="tweets", id="1", **get_kwargs({"user": "kimchy", "text": "hola"}))

elasticapm_client = <tests.fixtures.TempStoreClient object at 0x7f0caa759cc0>
elasticsearch = <Elasticsearch([{'host': 'elasticsearch2', 'port': 9200, 'scheme': 'http'}])>
instrument = None

tests/instrumentation/elasticsearch_tests.py:145:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/home/user/.local/lib/python3.6/site-packages/elasticsearch/client/utils.py:69: in _wrapped
    return func(*args, params=params, **kwargs)
        args       = (<Elasticsearch([{'host': 'elasticsearch2', 'port': 9200, 'scheme': 'http'}])>,)
        es_query_params = ('consistency', 'parent', 'refresh', 'routing', 'timeout', 'timestamp', ...)
        func       = <function Elasticsearch.create at 0x7f0caa6976a8>
        kwargs     = {'body': {'text': 'hola', 'user': 'kimchy'}, 'doc_type': '_doc', 'id': '1', 'index': 'tweets'}
        p          = 'request_timeout'
        params     = {'op_type': b'create'}
/home/user/.local/lib/python3.6/site-packages/elasticsearch/client/__init__.py:248: in create
    return self.index(index, doc_type, body, id=id, params=params, op_type='create')
        body       = {'text': 'hola', 'user': 'kimchy'}
        doc_type   = '_doc'
        id         = '1'
        index      = 'tweets'
        params     = {'op_type': b'create'}
        self       = <Elasticsearch([{'host': 'elasticsearch2', 'port': 9200, 'scheme': 'http'}])>
/home/user/.local/lib/python3.6/site-packages/elasticsearch/client/utils.py:69: in _wrapped
    return func(*args, params=params, **kwargs)
        args       = (<Elasticsearch([{'host': 'elasticsearch2', 'port': 9200, 'scheme': 'http'}])>, 'tweets', '_doc', {'text': 'hola', 'user': 'kimchy'})
        es_query_params = ('consistency', 'op_type', 'parent', 'refresh', 'routing', 'timeout', ...)
        func       = <function Elasticsearch.index at 0x7f0caa6977b8>
        kwargs     = {'id': '1'}
        p          = 'request_timeout'
        params     = {'op_type': b'create'}
/home/user/.local/lib/python3.6/site-packages/elasticsearch/client/__init__.py:279: in index
    _make_path(index, doc_type, id), params=params, body=body)
        body       = {'text': 'hola', 'user': 'kimchy'}
        doc_type   = '_doc'
        id         = '1'
        index      = 'tweets'
        param      = {'text': 'hola', 'user': 'kimchy'}
        params     = {'op_type': b'create'}
        self       = <Elasticsearch([{'host': 'elasticsearch2', 'port': 9200, 'scheme': 'http'}])>
elasticapm/utils/wrapt/wrappers.py:562: in __call__
    args, kwargs)
        args       = ('PUT', '/tweets/_doc/1')
        kwargs     = {'body': {'text': 'hola', 'user': 'kimchy'}, 'params': {'op_type': b'create'}}
        self       = <BoundFunctionWrapper at 0x7f0caa33e5f8 for method at 0x7f0caaae8308>
elasticapm/instrumentation/packages/base.py:210: in call_if_sampling
    return self.call(module, method, wrapped, instance, args, kwargs)
        args       = ('PUT', '/tweets/_doc/1')
        instance   = <elasticsearch.transport.Transport object at 0x7f0caa313588>
        kwargs     = {'body': {'text': 'hola', 'user': 'kimchy'}, 'params': {'op_type': b'create'}}
        method     = 'Transport.perform_request'
        module     = 'elasticsearch.transport'
        self       = <elasticapm.instrumentation.packages.elasticsearch.ElasticsearchTransportInstrumentation object at 0x7f0caa52b080>
        transaction = <elasticapm.traces.Transaction object at 0x7f0caa531ba8>
        wrapped    = <bound method Transport.perform_request of <elasticsearch.transport.Transport object at 0x7f0caa313588>>
elasticapm/instrumentation/packages/elasticsearch.py:142: in call
    result_data = wrapped(*args, **kwargs)
        args       = ('PUT', '/tweets/_doc/1')
        instance   = <elasticsearch.transport.Transport object at 0x7f0caa313588>
        kwargs     = {'body': {'text': 'hola', 'user': 'kimchy'}, 'params': {'op_type': b'create'}}
        method     = 'Transport.perform_request'
        module     = 'elasticsearch.transport'
        self       = <elasticapm.instrumentation.packages.elasticsearch.ElasticsearchTransportInstrumentation object at 0x7f0caa52b080>
        span       = <elasticapm.traces.Span object at 0x7f0cac580e48>
        wrapped    = <bound method Transport.perform_request of <elasticsearch.transport.Transport object at 0x7f0caa313588>>
/home/user/.local/lib/python3.6/site-packages/elasticsearch/transport.py:327: in perform_request
    status, headers, data = connection.perform_request(method, url, params, body, ignore=ignore, timeout=timeout)
        attempt    = 0
        body       = b'{"user": "kimchy", "text": "hola"}'
        connection = <Urllib3HttpConnection: http://elasticsearch2:9200>
        ignore     = ()
        method     = 'PUT'
        params     = {'op_type': b'create'}
        retry      = False
        self       = <elasticsearch.transport.Transport object at 0x7f0caa313588>
        timeout    = None
        url        = '/tweets/_doc/1'
elasticapm/utils/wrapt/wrappers.py:562: in __call__
    args, kwargs)
        args       = ('PUT', '/tweets/_doc/1', {'op_type': b'create'}, b'{"user": "kimchy", "text": "hola"}')
        kwargs     = {'ignore': (), 'timeout': None}
        self       = <BoundFunctionWrapper at 0x7f0caa2f2868 for method at 0x7f0caa435408>
elasticapm/instrumentation/packages/base.py:210: in call_if_sampling
    return self.call(module, method, wrapped, instance, args, kwargs)
        args       = ('PUT', '/tweets/_doc/1', {'op_type': b'create'}, b'{"user": "kimchy", "text": "hola"}')
        instance   = <Urllib3HttpConnection: http://elasticsearch2:9200>
        kwargs     = {'ignore': (), 'timeout': None}
        method     = 'Urllib3HttpConnection.perform_request'
        module     = 'elasticsearch.connection.http_urllib3'
        self       = <elasticapm.instrumentation.packages.elasticsearch.ElasticsearchConnectionInstrumentation object at 0x7f0caa54b6a0>
        transaction = <elasticapm.traces.Transaction object at 0x7f0caa531ba8>
        wrapped    = <bound method Urllib3HttpConnection.perform_request of <Urllib3HttpConnection: http://elasticsearch2:9200>>
elasticapm/instrumentation/packages/elasticsearch.py:70: in call
    result = wrapped(*args, **kwargs)
        args       = ('PUT', '/tweets/_doc/1', {'op_type': b'create'}, b'{"user": "kimchy", "text": "hola"}')
        instance   = <Urllib3HttpConnection: http://elasticsearch2:9200>
        kwargs     = {'ignore': (), 'timeout': None}
        method     = 'Urllib3HttpConnection.perform_request'
        module     = 'elasticsearch.connection.http_urllib3'
        self       = <elasticapm.instrumentation.packages.elasticsearch.ElasticsearchConnectionInstrumentation object at 0x7f0caa54b6a0>
        span       = <elasticapm.traces.Span object at 0x7f0cac580e48>
        wrapped    = <bound method Urllib3HttpConnection.perform_request of <Urllib3HttpConnection: http://elasticsearch2:9200>>
/home/user/.local/lib/python3.6/site-packages/elasticsearch/connection/http_urllib3.py:110: in perform_request
    self._raise_error(response.status, raw_data)
        body       = b'{"user": "kimchy", "text": "hola"}'
        duration   = 0.5050826072692871
        full_url   = 'http://elasticsearch2:9200/tweets/_doc/1?op_type=create'
        ignore     = ()
        kw         = {}
        method     = 'PUT'
        params     = {'op_type': b'create'}
        raw_data   = '{"error":{"root_cause":[{"type":"invalid_type_name_exception","reason":"Document mapping type name can\'t start with ...'"}],"type":"invalid_type_name_exception","reason":"Document mapping type name can\'t start with \'_\'"},"status":400}'
        response   = <urllib3.response.HTTPResponse object at 0x7f0caa313a20>
        self       = <Urllib3HttpConnection: http://elasticsearch2:9200>
        start      = 1663681003.8736103
        timeout    = None
        url        = '/tweets/_doc/1?op_type=create'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <Urllib3HttpConnection: http://elasticsearch2:9200>, status_code = 400
raw_data = '{"error":{"root_cause":[{"type":"invalid_type_name_exception","reason":"Document mapping type name can\'t start with ...'"}],"type":"invalid_type_name_exception","reason":"Document mapping type name can\'t start with \'_\'"},"status":400}'

    def _raise_error(self, status_code, raw_data):
        """ Locate appropriate exception and raise it. """
        error_message = raw_data
        additional_info = None
        try:
            if raw_data:
                additional_info = json.loads(raw_data)
                error_message = additional_info.get('error', error_message)
                if isinstance(error_message, dict) and 'type' in error_message:
                    error_message = error_message['type']
        except (ValueError, TypeError) as err:
            logger.warning('Undecodable raw error response from server: %s', err)

>       raise HTTP_EXCEPTIONS.get(status_code, TransportError)(status_code, error_message, additional_info)
E       elasticsearch.exceptions.RequestError: TransportError(400, 'invalid_type_name_exception', "Document mapping type name can't start with '_'")

additional_info = {'error': {'reason': "Document mapping type name can't start with '_'", 'root_cause': [{'reason': "Document mapping ty... can't start with '_'", 'type': 'invalid_type_name_exception'}], 'type': 'invalid_type_name_exception'}, 'status': 400}
error_message = 'invalid_type_name_exception'
raw_data   = '{"error":{"root_cause":[{"type":"invalid_type_name_exception","reason":"Document mapping type name can\'t start with ...'"}],"type":"invalid_type_name_exception","reason":"Document mapping type name can\'t start with \'_\'"},"status":400}'
self       = <Urllib3HttpConnection: http://elasticsearch2:9200>
status_code = 400

/home/user/.local/lib/python3.6/site-packages/elasticsearch/connection/base.py:114: RequestError

Initializing / Test / Python-python-3.6-4 / test_index – tests.instrumentation.elasticsearch_tests

Expand to view the error details
 elasticsearch.exceptions.RequestError: TransportError(400, 'invalid_type_name_exception', "Document mapping type name can't start with '_'")

Expand to view the stacktrace
 instrument = None
elasticapm_client = <tests.fixtures.TempStoreClient object at 0x7f0caa00fa58>
elasticsearch = <Elasticsearch([{'host': 'elasticsearch2', 'port': 9200, 'scheme': 'http'}])>

    @pytest.mark.integrationtest
    def test_index(instrument, elasticapm_client, elasticsearch):
        elasticapm_client.begin_transaction("test")
>       r1 = elasticsearch.index(index="tweets", **get_kwargs({"user": "kimchy", "text": "hola"}))

elasticapm_client = <tests.fixtures.TempStoreClient object at 0x7f0caa00fa58>
elasticsearch = <Elasticsearch([{'host': 'elasticsearch2', 'port': 9200, 'scheme': 'http'}])>
instrument = None

tests/instrumentation/elasticsearch_tests.py:179:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/home/user/.local/lib/python3.6/site-packages/elasticsearch/client/utils.py:69: in _wrapped
    return func(*args, params=params, **kwargs)
        args       = (<Elasticsearch([{'host': 'elasticsearch2', 'port': 9200, 'scheme': 'http'}])>,)
        es_query_params = ('consistency', 'op_type', 'parent', 'refresh', 'routing', 'timeout', ...)
        func       = <function Elasticsearch.index at 0x7f0caa6977b8>
        kwargs     = {'body': {'text': 'hola', 'user': 'kimchy'}, 'doc_type': '_doc', 'index': 'tweets'}
        p          = 'request_timeout'
        params     = {}
/home/user/.local/lib/python3.6/site-packages/elasticsearch/client/__init__.py:279: in index
    _make_path(index, doc_type, id), params=params, body=body)
        body       = {'text': 'hola', 'user': 'kimchy'}
        doc_type   = '_doc'
        id         = None
        index      = 'tweets'
        param      = {'text': 'hola', 'user': 'kimchy'}
        params     = {}
        self       = <Elasticsearch([{'host': 'elasticsearch2', 'port': 9200, 'scheme': 'http'}])>
elasticapm/utils/wrapt/wrappers.py:562: in __call__
    args, kwargs)
        args       = ('POST', '/tweets/_doc')
        kwargs     = {'body': {'text': 'hola', 'user': 'kimchy'}, 'params': {}}
        self       = <BoundFunctionWrapper at 0x7f0caa3475f8 for method at 0x7f0caa831288>
elasticapm/instrumentation/packages/base.py:210: in call_if_sampling
    return self.call(module, method, wrapped, instance, args, kwargs)
        args       = ('POST', '/tweets/_doc')
        instance   = <elasticsearch.transport.Transport object at 0x7f0caa00f278>
        kwargs     = {'body': {'text': 'hola', 'user': 'kimchy'}, 'params': {}}
        method     = 'Transport.perform_request'
        module     = 'elasticsearch.transport'
        self       = <elasticapm.instrumentation.packages.elasticsearch.ElasticsearchTransportInstrumentation object at 0x7f0caa52b080>
        transaction = <elasticapm.traces.Transaction object at 0x7f0caa00fe10>
        wrapped    = <bound method Transport.perform_request of <elasticsearch.transport.Transport object at 0x7f0caa00f278>>
elasticapm/instrumentation/packages/elasticsearch.py:142: in call
    result_data = wrapped(*args, **kwargs)
        args       = ('POST', '/tweets/_doc')
        instance   = <elasticsearch.transport.Transport object at 0x7f0caa00f278>
        kwargs     = {'body': {'text': 'hola', 'user': 'kimchy'}, 'params': {}}
        method     = 'Transport.perform_request'
        module     = 'elasticsearch.transport'
        self       = <elasticapm.instrumentation.packages.elasticsearch.ElasticsearchTransportInstrumentation object at 0x7f0caa52b080>
        span       = <elasticapm.traces.Span object at 0x7f0caa2482e8>
        wrapped    = <bound method Transport.perform_request of <elasticsearch.transport.Transport object at 0x7f0caa00f278>>
/home/user/.local/lib/python3.6/site-packages/elasticsearch/transport.py:327: in perform_request
    status, headers, data = connection.perform_request(method, url, params, body, ignore=ignore, timeout=timeout)
        attempt    = 0
        body       = b'{"user": "kimchy", "text": "hola"}'
        connection = <Urllib3HttpConnection: http://elasticsearch2:9200>
        ignore     = ()
        method     = 'POST'
        params     = {}
        retry      = False
        self       = <elasticsearch.transport.Transport object at 0x7f0caa00f278>
        timeout    = None
        url        = '/tweets/_doc'
elasticapm/utils/wrapt/wrappers.py:562: in __call__
    args, kwargs)
        args       = ('POST', '/tweets/_doc', {}, b'{"user": "kimchy", "text": "hola"}')
        kwargs     = {'ignore': (), 'timeout': None}
        self       = <BoundFunctionWrapper at 0x7f0caa1d7b40 for method at 0x7f0caaa5e888>
elasticapm/instrumentation/packages/base.py:210: in call_if_sampling
    return self.call(module, method, wrapped, instance, args, kwargs)
        args       = ('POST', '/tweets/_doc', {}, b'{"user": "kimchy", "text": "hola"}')
        instance   = <Urllib3HttpConnection: http://elasticsearch2:9200>
        kwargs     = {'ignore': (), 'timeout': None}
        method     = 'Urllib3HttpConnection.perform_request'
        module     = 'elasticsearch.connection.http_urllib3'
        self       = <elasticapm.instrumentation.packages.elasticsearch.ElasticsearchConnectionInstrumentation object at 0x7f0caa54b6a0>
        transaction = <elasticapm.traces.Transaction object at 0x7f0caa00fe10>
        wrapped    = <bound method Urllib3HttpConnection.perform_request of <Urllib3HttpConnection: http://elasticsearch2:9200>>
elasticapm/instrumentation/packages/elasticsearch.py:70: in call
    result = wrapped(*args, **kwargs)
        args       = ('POST', '/tweets/_doc', {}, b'{"user": "kimchy", "text": "hola"}')
        instance   = <Urllib3HttpConnection: http://elasticsearch2:9200>
        kwargs     = {'ignore': (), 'timeout': None}
        method     = 'Urllib3HttpConnection.perform_request'
        module     = 'elasticsearch.connection.http_urllib3'
        self       = <elasticapm.instrumentation.packages.elasticsearch.ElasticsearchConnectionInstrumentation object at 0x7f0caa54b6a0>
        span       = <elasticapm.traces.Span object at 0x7f0caa2482e8>
        wrapped    = <bound method Urllib3HttpConnection.perform_request of <Urllib3HttpConnection: http://elasticsearch2:9200>>
/home/user/.local/lib/python3.6/site-packages/elasticsearch/connection/http_urllib3.py:110: in perform_request
    self._raise_error(response.status, raw_data)
        body       = b'{"user": "kimchy", "text": "hola"}'
        duration   = 0.11513614654541016
        full_url   = 'http://elasticsearch2:9200/tweets/_doc'
        ignore     = ()
        kw         = {}
        method     = 'POST'
        params     = {}
        raw_data   = '{"error":{"root_cause":[{"type":"invalid_type_name_exception","reason":"Document mapping type name can\'t start with ...'"}],"type":"invalid_type_name_exception","reason":"Document mapping type name can\'t start with \'_\'"},"status":400}'
        response   = <urllib3.response.HTTPResponse object at 0x7f0ca9ff88d0>
        self       = <Urllib3HttpConnection: http://elasticsearch2:9200>
        start      = 1663681004.8383694
        timeout    = None
        url        = '/tweets/_doc'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <Urllib3HttpConnection: http://elasticsearch2:9200>, status_code = 400
raw_data = '{"error":{"root_cause":[{"type":"invalid_type_name_exception","reason":"Document mapping type name can\'t start with ...'"}],"type":"invalid_type_name_exception","reason":"Document mapping type name can\'t start with \'_\'"},"status":400}'

    def _raise_error(self, status_code, raw_data):
        """ Locate appropriate exception and raise it. """
        error_message = raw_data
        additional_info = None
        try:
            if raw_data:
                additional_info = json.loads(raw_data)
                error_message = additional_info.get('error', error_message)
                if isinstance(error_message, dict) and 'type' in error_message:
                    error_message = error_message['type']
        except (ValueError, TypeError) as err:
            logger.warning('Undecodable raw error response from server: %s', err)

>       raise HTTP_EXCEPTIONS.get(status_code, TransportError)(status_code, error_message, additional_info)
E       elasticsearch.exceptions.RequestError: TransportError(400, 'invalid_type_name_exception', "Document mapping type name can't start with '_'")

additional_info = {'error': {'reason': "Document mapping type name can't start with '_'", 'root_cause': [{'reason': "Document mapping ty... can't start with '_'", 'type': 'invalid_type_name_exception'}], 'type': 'invalid_type_name_exception'}, 'status': 400}
error_message = 'invalid_type_name_exception'
raw_data   = '{"error":{"root_cause":[{"type":"invalid_type_name_exception","reason":"Document mapping type name can\'t start with ...'"}],"type":"invalid_type_name_exception","reason":"Document mapping type name can\'t start with \'_\'"},"status":400}'
self       = <Urllib3HttpConnection: http://elasticsearch2:9200>
status_code = 400

/home/user/.local/lib/python3.6/site-packages/elasticsearch/connection/base.py:114: RequestError

Initializing / Test / Python-python-3.6-4 / test_exists – tests.instrumentation.elasticsearch_tests

Expand to view the error details
 elasticsearch.exceptions.RequestError: TransportError(400, 'invalid_type_name_exception', "Document mapping type name can't start with '_'")

Expand to view the stacktrace
 instrument = None
elasticapm_client = <tests.fixtures.TempStoreClient object at 0x7f0caa759588>
elasticsearch = <Elasticsearch([{'host': 'elasticsearch2', 'port': 9200, 'scheme': 'http'}])>

    @pytest.mark.integrationtest
    def test_exists(instrument, elasticapm_client, elasticsearch):
>       elasticsearch.create(index="tweets", id="1", refresh=True, **get_kwargs({"user": "kimchy", "text": "hola"}))

elasticapm_client = <tests.fixtures.TempStoreClient object at 0x7f0caa759588>
elasticsearch = <Elasticsearch([{'host': 'elasticsearch2', 'port': 9200, 'scheme': 'http'}])>
instrument = None

tests/instrumentation/elasticsearch_tests.py:200:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/home/user/.local/lib/python3.6/site-packages/elasticsearch/client/utils.py:69: in _wrapped
    return func(*args, params=params, **kwargs)
        args       = (<Elasticsearch([{'host': 'elasticsearch2', 'port': 9200, 'scheme': 'http'}])>,)
        es_query_params = ('consistency', 'parent', 'refresh', 'routing', 'timeout', 'timestamp', ...)
        func       = <function Elasticsearch.create at 0x7f0caa6976a8>
        kwargs     = {'body': {'text': 'hola', 'user': 'kimchy'}, 'doc_type': '_doc', 'id': '1', 'index': 'tweets'}
        p          = 'request_timeout'
        params     = {'op_type': b'create', 'refresh': b'true'}
/home/user/.local/lib/python3.6/site-packages/elasticsearch/client/__init__.py:248: in create
    return self.index(index, doc_type, body, id=id, params=params, op_type='create')
        body       = {'text': 'hola', 'user': 'kimchy'}
        doc_type   = '_doc'
        id         = '1'
        index      = 'tweets'
        params     = {'op_type': b'create', 'refresh': b'true'}
        self       = <Elasticsearch([{'host': 'elasticsearch2', 'port': 9200, 'scheme': 'http'}])>
/home/user/.local/lib/python3.6/site-packages/elasticsearch/client/utils.py:69: in _wrapped
    return func(*args, params=params, **kwargs)
        args       = (<Elasticsearch([{'host': 'elasticsearch2', 'port': 9200, 'scheme': 'http'}])>, 'tweets', '_doc', {'text': 'hola', 'user': 'kimchy'})
        es_query_params = ('consistency', 'op_type', 'parent', 'refresh', 'routing', 'timeout', ...)
        func       = <function Elasticsearch.index at 0x7f0caa6977b8>
        kwargs     = {'id': '1'}
        p          = 'request_timeout'
        params     = {'op_type': b'create', 'refresh': b'true'}
/home/user/.local/lib/python3.6/site-packages/elasticsearch/client/__init__.py:279: in index
    _make_path(index, doc_type, id), params=params, body=body)
        body       = {'text': 'hola', 'user': 'kimchy'}
        doc_type   = '_doc'
        id         = '1'
        index      = 'tweets'
        param      = {'text': 'hola', 'user': 'kimchy'}
        params     = {'op_type': b'create', 'refresh': b'true'}
        self       = <Elasticsearch([{'host': 'elasticsearch2', 'port': 9200, 'scheme': 'http'}])>
elasticapm/utils/wrapt/wrappers.py:562: in __call__
    args, kwargs)
        args       = ('PUT', '/tweets/_doc/1')
        kwargs     = {'body': {'text': 'hola', 'user': 'kimchy'}, 'params': {'op_type': b'create', 'refresh': b'true'}}
        self       = <BoundFunctionWrapper at 0x7f0caad3c388 for method at 0x7f0caad1a808>
elasticapm/instrumentation/packages/base.py:205: in call_if_sampling
    return wrapped(*args, **kwargs)
        args       = ('PUT', '/tweets/_doc/1')
        instance   = <elasticsearch.transport.Transport object at 0x7f0caadc4978>
        kwargs     = {'body': {'text': 'hola', 'user': 'kimchy'}, 'params': {'op_type': b'create', 'refresh': b'true'}}
        method     = 'Transport.perform_request'
        module     = 'elasticsearch.transport'
        self       = <elasticapm.instrumentation.packages.elasticsearch.ElasticsearchTransportInstrumentation object at 0x7f0caa52b080>
        transaction = None
        wrapped    = <bound method Transport.perform_request of <elasticsearch.transport.Transport object at 0x7f0caadc4978>>
/home/user/.local/lib/python3.6/site-packages/elasticsearch/transport.py:327: in perform_request
    status, headers, data = connection.perform_request(method, url, params, body, ignore=ignore, timeout=timeout)
        attempt    = 0
        body       = b'{"user": "kimchy", "text": "hola"}'
        connection = <Urllib3HttpConnection: http://elasticsearch2:9200>
        ignore     = ()
        method     = 'PUT'
        params     = {'op_type': b'create', 'refresh': b'true'}
        retry      = False
        self       = <elasticsearch.transport.Transport object at 0x7f0caadc4978>
        timeout    = None
        url        = '/tweets/_doc/1'
elasticapm/utils/wrapt/wrappers.py:562: in __call__
    args, kwargs)
        args       = ('PUT', '/tweets/_doc/1', {'op_type': b'create', 'refresh': b'true'}, b'{"user": "kimchy", "text": "hola"}')
        kwargs     = {'ignore': (), 'timeout': None}
        self       = <BoundFunctionWrapper at 0x7f0caad9aba8 for method at 0x7f0caad5fec8>
elasticapm/instrumentation/packages/base.py:205: in call_if_sampling
    return wrapped(*args, **kwargs)
        args       = ('PUT', '/tweets/_doc/1', {'op_type': b'create', 'refresh': b'true'}, b'{"user": "kimchy", "text": "hola"}')
        instance   = <Urllib3HttpConnection: http://elasticsearch2:9200>
        kwargs     = {'ignore': (), 'timeout': None}
        method     = 'Urllib3HttpConnection.perform_request'
        module     = 'elasticsearch.connection.http_urllib3'
        self       = <elasticapm.instrumentation.packages.elasticsearch.ElasticsearchConnectionInstrumentation object at 0x7f0caa54b6a0>
        transaction = None
        wrapped    = <bound method Urllib3HttpConnection.perform_request of <Urllib3HttpConnection: http://elasticsearch2:9200>>
/home/user/.local/lib/python3.6/site-packages/elasticsearch/connection/http_urllib3.py:110: in perform_request
    self._raise_error(response.status, raw_data)
        body       = b'{"user": "kimchy", "text": "hola"}'
        duration   = 0.09940767288208008
        full_url   = 'http://elasticsearch2:9200/tweets/_doc/1?refresh=true&op_type=create'
        ignore     = ()
        kw         = {}
        method     = 'PUT'
        params     = {'op_type': b'create', 'refresh': b'true'}
        raw_data   = '{"error":{"root_cause":[{"type":"invalid_type_name_exception","reason":"Document mapping type name can\'t start with ...'"}],"type":"invalid_type_name_exception","reason":"Document mapping type name can\'t start with \'_\'"},"status":400}'
        response   = <urllib3.response.HTTPResponse object at 0x7f0caadd0710>
        self       = <Urllib3HttpConnection: http://elasticsearch2:9200>
        start      = 1663681005.3633664
        timeout    = None
        url        = '/tweets/_doc/1?refresh=true&op_type=create'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <Urllib3HttpConnection: http://elasticsearch2:9200>, status_code = 400
raw_data = '{"error":{"root_cause":[{"type":"invalid_type_name_exception","reason":"Document mapping type name can\'t start with ...'"}],"type":"invalid_type_name_exception","reason":"Document mapping type name can\'t start with \'_\'"},"status":400}'

    def _raise_error(self, status_code, raw_data):
        """ Locate appropriate exception and raise it. """
        error_message = raw_data
        additional_info = None
        try:
            if raw_data:
                additional_info = json.loads(raw_data)
                error_message = additional_info.get('error', error_message)
                if isinstance(error_message, dict) and 'type' in error_message:
                    error_message = error_message['type']
        except (ValueError, TypeError) as err:
            logger.warning('Undecodable raw error response from server: %s', err)

>       raise HTTP_EXCEPTIONS.get(status_code, TransportError)(status_code, error_message, additional_info)
E       elasticsearch.exceptions.RequestError: TransportError(400, 'invalid_type_name_exception', "Document mapping type name can't start with '_'")

additional_info = {'error': {'reason': "Document mapping type name can't start with '_'", 'root_cause': [{'reason': "Document mapping ty... can't start with '_'", 'type': 'invalid_type_name_exception'}], 'type': 'invalid_type_name_exception'}, 'status': 400}
error_message = 'invalid_type_name_exception'
raw_data   = '{"error":{"root_cause":[{"type":"invalid_type_name_exception","reason":"Document mapping type name can\'t start with ...'"}],"type":"invalid_type_name_exception","reason":"Document mapping type name can\'t start with \'_\'"},"status":400}'
self       = <Urllib3HttpConnection: http://elasticsearch2:9200>
status_code = 400

/home/user/.local/lib/python3.6/site-packages/elasticsearch/connection/base.py:114: RequestError

Initializing / Test / Python-python-3.6-4 / test_get – tests.instrumentation.elasticsearch_tests

Expand to view the error details
 elasticsearch.exceptions.RequestError: TransportError(400, 'invalid_type_name_exception', "Document mapping type name can't start with '_'")

Expand to view the stacktrace
 instrument = None
elasticapm_client = <tests.fixtures.TempStoreClient object at 0x7f0caa177f98>
elasticsearch = <Elasticsearch([{'host': 'elasticsearch2', 'port': 9200, 'scheme': 'http'}])>

    @pytest.mark.integrationtest
    def test_get(instrument, elasticapm_client, elasticsearch):
>       elasticsearch.create(index="tweets", id="1", refresh=True, **get_kwargs({"user": "kimchy", "text": "hola"}))

elasticapm_client = <tests.fixtures.TempStoreClient object at 0x7f0caa177f98>
elasticsearch = <Elasticsearch([{'host': 'elasticsearch2', 'port': 9200, 'scheme': 'http'}])>
instrument = None

tests/instrumentation/elasticsearch_tests.py:247:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/home/user/.local/lib/python3.6/site-packages/elasticsearch/client/utils.py:69: in _wrapped
    return func(*args, params=params, **kwargs)
        args       = (<Elasticsearch([{'host': 'elasticsearch2', 'port': 9200, 'scheme': 'http'}])>,)
        es_query_params = ('consistency', 'parent', 'refresh', 'routing', 'timeout', 'timestamp', ...)
        func       = <function Elasticsearch.create at 0x7f0caa6976a8>
        kwargs     = {'body': {'text': 'hola', 'user': 'kimchy'}, 'doc_type': '_doc', 'id': '1', 'index': 'tweets'}
        p          = 'request_timeout'
        params     = {'op_type': b'create', 'refresh': b'true'}
/home/user/.local/lib/python3.6/site-packages/elasticsearch/client/__init__.py:248: in create
    return self.index(index, doc_type, body, id=id, params=params, op_type='create')
        body       = {'text': 'hola', 'user': 'kimchy'}
        doc_type   = '_doc'
        id         = '1'
        index      = 'tweets'
        params     = {'op_type': b'create', 'refresh': b'true'}
        self       = <Elasticsearch([{'host': 'elasticsearch2', 'port': 9200, 'scheme': 'http'}])>
/home/user/.local/lib/python3.6/site-packages/elasticsearch/client/utils.py:69: in _wrapped
    return func(*args, params=params, **kwargs)
        args       = (<Elasticsearch([{'host': 'elasticsearch2', 'port': 9200, 'scheme': 'http'}])>, 'tweets', '_doc', {'text': 'hola', 'user': 'kimchy'})
        es_query_params = ('consistency', 'op_type', 'parent', 'refresh', 'routing', 'timeout', ...)
        func       = <function Elasticsearch.index at 0x7f0caa6977b8>
        kwargs     = {'id': '1'}
        p          = 'request_timeout'
        params     = {'op_type': b'create', 'refresh': b'true'}
/home/user/.local/lib/python3.6/site-packages/elasticsearch/client/__init__.py:279: in index
    _make_path(index, doc_type, id), params=params, body=body)
        body       = {'text': 'hola', 'user': 'kimchy'}
        doc_type   = '_doc'
        id         = '1'
        index      = 'tweets'
        param      = {'text': 'hola', 'user': 'kimchy'}
        params     = {'op_type': b'create', 'refresh': b'true'}
        self       = <Elasticsearch([{'host': 'elasticsearch2', 'port': 9200, 'scheme': 'http'}])>
elasticapm/utils/wrapt/wrappers.py:562: in __call__
    args, kwargs)
        args       = ('PUT', '/tweets/_doc/1')
        kwargs     = {'body': {'text': 'hola', 'user': 'kimchy'}, 'params': {'op_type': b'create', 'refresh': b'true'}}
        self       = <BoundFunctionWrapper at 0x7f0caa0b8c78 for method at 0x7f0caa1399c8>
elasticapm/instrumentation/packages/base.py:205: in call_if_sampling
    return wrapped(*args, **kwargs)
        args       = ('PUT', '/tweets/_doc/1')
        instance   = <elasticsearch.transport.Transport object at 0x7f0caa1770f0>
        kwargs     = {'body': {'text': 'hola', 'user': 'kimchy'}, 'params': {'op_type': b'create', 'refresh': b'true'}}
        method     = 'Transport.perform_request'
        module     = 'elasticsearch.transport'
        self       = <elasticapm.instrumentation.packages.elasticsearch.ElasticsearchTransportInstrumentation object at 0x7f0caa52b080>
        transaction = None
        wrapped    = <bound method Transport.perform_request of <elasticsearch.transport.Transport object at 0x7f0caa1770f0>>
/home/user/.local/lib/python3.6/site-packages/elasticsearch/transport.py:327: in perform_request
    status, headers, data = connection.perform_request(method, url, params, body, ignore=ignore, timeout=timeout)
        attempt    = 0
        body       = b'{"user": "kimchy", "text": "hola"}'
        connection = <Urllib3HttpConnection: http://elasticsearch2:9200>
        ignore     = ()
        method     = 'PUT'
        params     = {'op_type': b'create', 'refresh': b'true'}
        retry      = False
        self       = <elasticsearch.transport.Transport object at 0x7f0caa1770f0>
        timeout    = None
        url        = '/tweets/_doc/1'
elasticapm/utils/wrapt/wrappers.py:562: in __call__
    args, kwargs)
        args       = ('PUT', '/tweets/_doc/1', {'op_type': b'create', 'refresh': b'true'}, b'{"user": "kimchy", "text": "hola"}')
        kwargs     = {'ignore': (), 'timeout': None}
        self       = <BoundFunctionWrapper at 0x7f0caa0b82b8 for method at 0x7f0caad67708>
elasticapm/instrumentation/packages/base.py:205: in call_if_sampling
    return wrapped(*args, **kwargs)
        args       = ('PUT', '/tweets/_doc/1', {'op_type': b'create', 'refresh': b'true'}, b'{"user": "kimchy", "text": "hola"}')
        instance   = <Urllib3HttpConnection: http://elasticsearch2:9200>
        kwargs     = {'ignore': (), 'timeout': None}
        method     = 'Urllib3HttpConnection.perform_request'
        module     = 'elasticsearch.connection.http_urllib3'
        self       = <elasticapm.instrumentation.packages.elasticsearch.ElasticsearchConnectionInstrumentation object at 0x7f0caa54b6a0>
        transaction = None
        wrapped    = <bound method Urllib3HttpConnection.perform_request of <Urllib3HttpConnection: http://elasticsearch2:9200>>
/home/user/.local/lib/python3.6/site-packages/elasticsearch/connection/http_urllib3.py:110: in perform_request
    self._raise_error(response.status, raw_data)
        body       = b'{"user": "kimchy", "text": "hola"}'
        duration   = 0.09197711944580078
        full_url   = 'http://elasticsearch2:9200/tweets/_doc/1?refresh=true&op_type=create'
        ignore     = ()
        kw         = {}
        method     = 'PUT'
        params     = {'op_type': b'create', 'refresh': b'true'}
        raw_data   = '{"error":{"root_cause":[{"type":"invalid_type_name_exception","reason":"Document mapping type name can\'t start with ...'"}],"type":"invalid_type_name_exception","reason":"Document mapping type name can\'t start with \'_\'"},"status":400}'
        response   = <urllib3.response.HTTPResponse object at 0x7f0caa132828>
        self       = <Urllib3HttpConnection: http://elasticsearch2:9200>
        start      = 1663681005.652513
        timeout    = None
        url        = '/tweets/_doc/1?refresh=true&op_type=create'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <Urllib3HttpConnection: http://elasticsearch2:9200>, status_code = 400
raw_data = '{"error":{"root_cause":[{"type":"invalid_type_name_exception","reason":"Document mapping type name can\'t start with ...'"}],"type":"invalid_type_name_exception","reason":"Document mapping type name can\'t start with \'_\'"},"status":400}'

    def _raise_error(self, status_code, raw_data):
        """ Locate appropriate exception and raise it. """
        error_message = raw_data
        additional_info = None
        try:
            if raw_data:
                additional_info = json.loads(raw_data)
                error_message = additional_info.get('error', error_message)
                if isinstance(error_message, dict) and 'type' in error_message:
                    error_message = error_message['type']
        except (ValueError, TypeError) as err:
            logger.warning('Undecodable raw error response from server: %s', err)

>       raise HTTP_EXCEPTIONS.get(status_code, TransportError)(status_code, error_message, additional_info)
E       elasticsearch.exceptions.RequestError: TransportError(400, 'invalid_type_name_exception', "Document mapping type name can't start with '_'")

additional_info = {'error': {'reason': "Document mapping type name can't start with '_'", 'root_cause': [{'reason': "Document mapping ty... can't start with '_'", 'type': 'invalid_type_name_exception'}], 'type': 'invalid_type_name_exception'}, 'status': 400}
error_message = 'invalid_type_name_exception'
raw_data   = '{"error":{"root_cause":[{"type":"invalid_type_name_exception","reason":"Document mapping type name can\'t start with ...'"}],"type":"invalid_type_name_exception","reason":"Document mapping type name can\'t start with \'_\'"},"status":400}'
self       = <Urllib3HttpConnection: http://elasticsearch2:9200>
status_code = 400

/home/user/.local/lib/python3.6/site-packages/elasticsearch/connection/base.py:114: RequestError

Initializing / Test / Python-python-3.6-4 / test_get_source – tests.instrumentation.elasticsearch_tests

Expand to view the error details
 elasticsearch.exceptions.RequestError: TransportError(400, 'invalid_type_name_exception', "Document mapping type name can't start with '_'")

Expand to view the stacktrace
 instrument = None
elasticapm_client = <tests.fixtures.TempStoreClient object at 0x7f0caa121ba8>
elasticsearch = <Elasticsearch([{'host': 'elasticsearch2', 'port': 9200, 'scheme': 'http'}])>

    @pytest.mark.integrationtest
    def test_get_source(instrument, elasticapm_client, elasticsearch):
>       elasticsearch.create(index="tweets", refresh=True, id="1", **get_kwargs({"user": "kimchy", "text": "hola"}))

elasticapm_client = <tests.fixtures.TempStoreClient object at 0x7f0caa121ba8>
elasticsearch = <Elasticsearch([{'host': 'elasticsearch2', 'port': 9200, 'scheme': 'http'}])>
instrument = None

tests/instrumentation/elasticsearch_tests.py:277:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/home/user/.local/lib/python3.6/site-packages/elasticsearch/client/utils.py:69: in _wrapped
    return func(*args, params=params, **kwargs)
        args       = (<Elasticsearch([{'host': 'elasticsearch2', 'port': 9200, 'scheme': 'http'}])>,)
        es_query_params = ('consistency', 'parent', 'refresh', 'routing', 'timeout', 'timestamp', ...)
        func       = <function Elasticsearch.create at 0x7f0caa6976a8>
        kwargs     = {'body': {'text': 'hola', 'user': 'kimchy'}, 'doc_type': '_doc', 'id': '1', 'index': 'tweets'}
        p          = 'request_timeout'
        params     = {'op_type': b'create', 'refresh': b'true'}
/home/user/.local/lib/python3.6/site-packages/elasticsearch/client/__init__.py:248: in create
    return self.index(index, doc_type, body, id=id, params=params, op_type='create')
        body       = {'text': 'hola', 'user': 'kimchy'}
        doc_type   = '_doc'
        id         = '1'
        index      = 'tweets'
        params     = {'op_type': b'create', 'refresh': b'true'}
        self       = <Elasticsearch([{'host': 'elasticsearch2', 'port': 9200, 'scheme': 'http'}])>
/home/user/.local/lib/python3.6/site-packages/elasticsearch/client/utils.py:69: in _wrapped
    return func(*args, params=params, **kwargs)
        args       = (<Elasticsearch([{'host': 'elasticsearch2', 'port': 9200, 'scheme': 'http'}])>, 'tweets', '_doc', {'text': 'hola', 'user': 'kimchy'})
        es_query_params = ('consistency', 'op_type', 'parent', 'refresh', 'routing', 'timeout', ...)
        func       = <function Elasticsearch.index at 0x7f0caa6977b8>
        kwargs     = {'id': '1'}
        p          = 'request_timeout'
        params     = {'op_type': b'create', 'refresh': b'true'}
/home/user/.local/lib/python3.6/site-packages/elasticsearch/client/__init__.py:279: in index
    _make_path(index, doc_type, id), params=params, body=body)
        body       = {'text': 'hola', 'user': 'kimchy'}
        doc_type   = '_doc'
        id         = '1'
        index      = 'tweets'
        param      = {'text': 'hola', 'user': 'kimchy'}
        params     = {'op_type': b'create', 'refresh': b'true'}
        self       = <Elasticsearch([{'host': 'elasticsearch2', 'port': 9200, 'scheme': 'http'}])>
elasticapm/utils/wrapt/wrappers.py:562: in __call__
    args, kwargs)
        args       = ('PUT', '/tweets/_doc/1')
        kwargs     = {'body': {'text': 'hola', 'user': 'kimchy'}, 'params': {'op_type': b'create', 'refresh': b'true'}}
        self       = <BoundFunctionWrapper at 0x7f0caa2b6db0 for method at 0x7f0caa130bc8>
elasticapm/instrumentation/packages/base.py:205: in call_if_sampling
    return wrapped(*args, **kwargs)
        args       = ('PUT', '/tweets/_doc/1')
        instance   = <elasticsearch.transport.Transport object at 0x7f0caa1210f0>
        kwargs     = {'body': {'text': 'hola', 'user': 'kimchy'}, 'params': {'op_type': b'create', 'refresh': b'true'}}
        method     = 'Transport.perform_request'
        module     = 'elasticsearch.transport'
        self       = <elasticapm.instrumentation.packages.elasticsearch.ElasticsearchTransportInstrumentation object at 0x7f0caa52b080>
        transaction = None
        wrapped    = <bound method Transport.perform_request of <elasticsearch.transport.Transport object at 0x7f0caa1210f0>>
/home/user/.local/lib/python3.6/site-packages/elasticsearch/transport.py:327: in perform_request
    status, headers, data = connection.perform_request(method, url, params, body, ignore=ignore, timeout=timeout)
        attempt    = 0
        body       = b'{"user": "kimchy", "text": "hola"}'
        connection = <Urllib3HttpConnection: http://elasticsearch2:9200>
        ignore     = ()
        method     = 'PUT'
        params     = {'op_type': b'create', 'refresh': b'true'}
        retry      = False
        self       = <elasticsearch.transport.Transport object at 0x7f0caa1210f0>
        timeout    = None
        url        = '/tweets/_doc/1'
elasticapm/utils/wrapt/wrappers.py:562: in __call__
    args, kwargs)
        args       = ('PUT', '/tweets/_doc/1', {'op_type': b'create', 'refresh': b'true'}, b'{"user": "kimchy", "text": "hola"}')
        kwargs     = {'ignore': (), 'timeout': None}
        self       = <BoundFunctionWrapper at 0x7f0caa0af1e8 for method at 0x7f0caa139dc8>
elasticapm/instrumentation/packages/base.py:205: in call_if_sampling
    return wrapped(*args, **kwargs)
        args       = ('PUT', '/tweets/_doc/1', {'op_type': b'create', 'refresh': b'true'}, b'{"user": "kimchy", "text": "hola"}')
        instance   = <Urllib3HttpConnection: http://elasticsearch2:9200>
        kwargs     = {'ignore': (), 'timeout': None}
        method     = 'Urllib3HttpConnection.perform_request'
        module     = 'elasticsearch.connection.http_urllib3'
        self       = <elasticapm.instrumentation.packages.elasticsearch.ElasticsearchConnectionInstrumentation object at 0x7f0caa54b6a0>
        transaction = None
        wrapped    = <bound method Urllib3HttpConnection.perform_request of <Urllib3HttpConnection: http://elasticsearch2:9200>>
/home/user/.local/lib/python3.6/site-packages/elasticsearch/connection/http_urllib3.py:110: in perform_request
    self._raise_error(response.status, raw_data)
        body       = b'{"user": "kimchy", "text": "hola"}'
        duration   = 0.10107851028442383
        full_url   = 'http://elasticsearch2:9200/tweets/_doc/1?refresh=true&op_type=create'
        ignore     = ()
        kw         = {}
        method     = 'PUT'
        params     = {'op_type': b'create', 'refresh': b'true'}
        raw_data   = '{"error":{"root_cause":[{"type":"invalid_type_name_exception","reason":"Document mapping type name can\'t start with ...'"}],"type":"invalid_type_name_exception","reason":"Document mapping type name can\'t start with \'_\'"},"status":400}'
        response   = <urllib3.response.HTTPResponse object at 0x7f0caa121f60>
        self       = <Urllib3HttpConnection: http://elasticsearch2:9200>
        start      = 1663681005.954141
        timeout    = None
        url        = '/tweets/_doc/1?refresh=true&op_type=create'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <Urllib3HttpConnection: http://elasticsearch2:9200>, status_code = 400
raw_data = '{"error":{"root_cause":[{"type":"invalid_type_name_exception","reason":"Document mapping type name can\'t start with ...'"}],"type":"invalid_type_name_exception","reason":"Document mapping type name can\'t start with \'_\'"},"status":400}'

    def _raise_error(self, status_code, raw_data):
        """ Locate appropriate exception and raise it. """
        error_message = raw_data
        additional_info = None
        try:
            if raw_data:
                additional_info = json.loads(raw_data)
                error_message = additional_info.get('error', error_message)
                if isinstance(error_message, dict) and 'type' in error_message:
                    error_message = error_message['type']
        except (ValueError, TypeError) as err:
            logger.warning('Undecodable raw error response from server: %s', err)

>       raise HTTP_EXCEPTIONS.get(status_code, TransportError)(status_code, error_message, additional_info)
E       elasticsearch.exceptions.RequestError: TransportError(400, 'invalid_type_name_exception', "Document mapping type name can't start with '_'")

additional_info = {'error': {'reason': "Document mapping type name can't start with '_'", 'root_cause': [{'reason': "Document mapping ty... can't start with '_'", 'type': 'invalid_type_name_exception'}], 'type': 'invalid_type_name_exception'}, 'status': 400}
error_message = 'invalid_type_name_exception'
raw_data   = '{"error":{"root_cause":[{"type":"invalid_type_name_exception","reason":"Document mapping type name can\'t start with ...'"}],"type":"invalid_type_name_exception","reason":"Document mapping type name can\'t start with \'_\'"},"status":400}'
self       = <Urllib3HttpConnection: http://elasticsearch2:9200>
status_code = 400

/home/user/.local/lib/python3.6/site-packages/elasticsearch/connection/base.py:114: RequestError

Initializing / Test / Python-python-3.6-4 / test_update_document – tests.instrumentation.elasticsearch_tests

Expand to view the error details
 elasticsearch.exceptions.RequestError: TransportError(400, 'invalid_type_name_exception', "Document mapping type name can't start with '_'")

Expand to view the stacktrace
 instrument = None
elasticapm_client = <tests.fixtures.TempStoreClient object at 0x7f0ca9f76908>
elasticsearch = <Elasticsearch([{'host': 'elasticsearch2', 'port': 9200, 'scheme': 'http'}])>

    @pytest.mark.integrationtest
    def test_update_document(instrument, elasticapm_client, elasticsearch):
>       elasticsearch.create(index="tweets", id="1", refresh=True, **get_kwargs({"user": "kimchy", "text": "hola"}))

elasticapm_client = <tests.fixtures.TempStoreClient object at 0x7f0ca9f76908>
elasticsearch = <Elasticsearch([{'host': 'elasticsearch2', 'port': 9200, 'scheme': 'http'}])>
instrument = None

tests/instrumentation/elasticsearch_tests.py:306:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/home/user/.local/lib/python3.6/site-packages/elasticsearch/client/utils.py:69: in _wrapped
    return func(*args, params=params, **kwargs)
        args       = (<Elasticsearch([{'host': 'elasticsearch2', 'port': 9200, 'scheme': 'http'}])>,)
        es_query_params = ('consistency', 'parent', 'refresh', 'routing', 'timeout', 'timestamp', ...)
        func       = <function Elasticsearch.create at 0x7f0caa6976a8>
        kwargs     = {'body': {'text': 'hola', 'user': 'kimchy'}, 'doc_type': '_doc', 'id': '1', 'index': 'tweets'}
        p          = 'request_timeout'
        params     = {'op_type': b'create', 'refresh': b'true'}
/home/user/.local/lib/python3.6/site-packages/elasticsearch/client/__init__.py:248: in create
    return self.index(index, doc_type, body, id=id, params=params, op_type='create')
        body       = {'text': 'hola', 'user': 'kimchy'}
        doc_type   = '_doc'
        id         = '1'
        index      = 'tweets'
        params     = {'op_type': b'create', 'refresh': b'true'}
        self       = <Elasticsearch([{'host': 'elasticsearch2', 'port': 9200, 'scheme': 'http'}])>
/home/user/.local/lib/python3.6/site-packages/elasticsearch/client/utils.py:69: in _wrapped
    return func(*args, params=params, **kwargs)
        args       = (<Elasticsearch([{'host': 'elasticsearch2', 'port': 9200, 'scheme': 'http'}])>, 'tweets', '_doc', {'text': 'hola', 'user': 'kimchy'})
        es_query_params = ('consistency', 'op_type', 'parent', 'refresh', 'routing', 'timeout', ...)
        func       = <function Elasticsearch.index at 0x7f0caa6977b8>
        kwargs     = {'id': '1'}
        p          = 'request_timeout'
        params     = {'op_type': b'create', 'refresh': b'true'}
/home/user/.local/lib/python3.6/site-packages/elasticsearch/client/__init__.py:279: in index
    _make_path(index, doc_type, id), params=params, body=body)
        body       = {'text': 'hola', 'user': 'kimchy'}
        doc_type   = '_doc'
        id         = '1'
        index      = 'tweets'
        param      = {'text': 'hola', 'user': 'kimchy'}
        params     = {'op_type': b'create', 'refresh': b'true'}
        self       = <Elasticsearch([{'host': 'elasticsearch2', 'port': 9200, 'scheme': 'http'}])>
elasticapm/utils/wrapt/wrappers.py:562: in __call__
    args, kwargs)
        args       = ('PUT', '/tweets/_doc/1')
        kwargs     = {'body': {'text': 'hola', 'user': 'kimchy'}, 'params': {'op_type': b'create', 'refresh': b'true'}}
        self       = <BoundFunctionWrapper at 0x7f0caa0af250 for method at 0x7f0ca9f22388>
elasticapm/instrumentation/packages/base.py:205: in call_if_sampling
    return wrapped(*args, **kwargs)
        args       = ('PUT', '/tweets/_doc/1')
        instance   = <elasticsearch.transport.Transport object at 0x7f0ca9f760b8>
        kwargs     = {'body': {'text': 'hola', 'user': 'kimchy'}, 'params': {'op_type': b'create', 'refresh': b'true'}}
        method     = 'Transport.perform_request'
        module     = 'elasticsearch.transport'
        self       = <elasticapm.instrumentation.packages.elasticsearch.ElasticsearchTransportInstrumentation object at 0x7f0caa52b080>
        transaction = None
        wrapped    = <bound method Transport.perform_request of <elasticsearch.transport.Transport object at 0x7f0ca9f760b8>>
/home/user/.local/lib/python3.6/site-packages/elasticsearch/transport.py:327: in perform_request
    status, headers, data = connection.perform_request(method, url, params, body, ignore=ignore, timeout=timeout)
        attempt    = 0
        body       = b'{"user": "kimchy", "text": "hola"}'
        connection = <Urllib3HttpConnection: http://elasticsearch2:9200>
        ignore     = ()
        method     = 'PUT'
        params     = {'op_type': b'create', 'refresh': b'true'}
        retry      = False
        self       = <elasticsearch.transport.Transport object at 0x7f0ca9f760b8>
        timeout    = None
        url        = '/tweets/_doc/1'
elasticapm/utils/wrapt/wrappers.py:562: in __call__
    args, kwargs)
        args       = ('PUT', '/tweets/_doc/1', {'op_type': b'create', 'refresh': b'true'}, b'{"user": "kimchy", "text": "hola"}')
        kwargs     = {'ignore': (), 'timeout': None}
        self       = <BoundFunctionWrapper at 0x7f0caa0afce0 for method at 0x7f0caa12af48>
elasticapm/instrumentation/packages/base.py:205: in call_if_sampling
    return wrapped(*args, **kwargs)
        args       = ('PUT', '/tweets/_doc/1', {'op_type': b'create', 'refresh': b'true'}, b'{"user": "kimchy", "text": "hola"}')
        instance   = <Urllib3HttpConnection: http://elasticsearch2:9200>
        kwargs     = {'ignore': (), 'timeout': None}
        method     = 'Urllib3HttpConnection.perform_request'
        module     = 'elasticsearch.connection.http_urllib3'
        self       = <elasticapm.instrumentation.packages.elasticsearch.ElasticsearchConnectionInstrumentation object at 0x7f0caa54b6a0>
        transaction = None
        wrapped    = <bound method Urllib3HttpConnection.perform_request of <Urllib3HttpConnection: http://elasticsearch2:9200>>
/home/user/.local/lib/python3.6/site-packages/elasticsearch/connection/http_urllib3.py:110: in perform_request
    self._raise_error(response.status, raw_data)
        body       = b'{"user": "kimchy", "text": "hola"}'
        duration   = 0.08222699165344238
        full_url   = 'http://elasticsearch2:9200/tweets/_doc/1?refresh=true&op_type=create'
        ignore     = ()
        kw         = {}
        method     = 'PUT'
        params     = {'op_type': b'create', 'refresh': b'true'}
        raw_data   = '{"error":{"root_cause":[{"type":"invalid_type_name_exception","reason":"Document mapping type name can\'t start with ...'"}],"type":"invalid_type_name_exception","reason":"Document mapping type name can\'t start with \'_\'"},"status":400}'
        response   = <urllib3.response.HTTPResponse object at 0x7f0ca9f76a58>
        self       = <Urllib3HttpConnection: http://elasticsearch2:9200>
        start      = 1663681006.2450087
        timeout    = None
        url        = '/tweets/_doc/1?refresh=true&op_type=create'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <Urllib3HttpConnection: http://elasticsearch2:9200>, status_code = 400
raw_data = '{"error":{"root_cause":[{"type":"invalid_type_name_exception","reason":"Document mapping type name can\'t start with ...'"}],"type":"invalid_type_name_exception","reason":"Document mapping type name can\'t start with \'_\'"},"status":400}'

    def _raise_error(self, status_code, raw_data):
        """ Locate appropriate exception and raise it. """
        error_message = raw_data
        additional_info = None
        try:
            if raw_data:
                additional_info = json.loads(raw_data)
                error_message = additional_info.get('error', error_message)
                if isinstance(error_message, dict) and 'type' in error_message:
                    error_message = error_message['type']
        except (ValueError, TypeError) as err:
            logger.warning('Undecodable raw error response from server: %s', err)

>       raise HTTP_EXCEPTIONS.get(status_code, TransportError)(status_code, error_message, additional_info)
E       elasticsearch.exceptions.RequestError: TransportError(400, 'invalid_type_name_exception', "Document mapping type name can't start with '_'")

additional_info = {'error': {'reason': "Document mapping type name can't start with '_'", 'root_cause': [{'reason': "Document mapping ty... can't start with '_'", 'type': 'invalid_type_name_exception'}], 'type': 'invalid_type_name_exception'}, 'status': 400}
error_message = 'invalid_type_name_exception'
raw_data   = '{"error":{"root_cause":[{"type":"invalid_type_name_exception","reason":"Document mapping type name can\'t start with ...'"}],"type":"invalid_type_name_exception","reason":"Document mapping type name can\'t start with \'_\'"},"status":400}'
self       = <Urllib3HttpConnection: http://elasticsearch2:9200>
status_code = 400

/home/user/.local/lib/python3.6/site-packages/elasticsearch/connection/base.py:114: RequestError

Steps errors
Expand to view the steps failures

Show only the first 10 steps failures

Restore files previously stashed

Took 0 min 0 sec . View more details here
Description: coverage-python-3.6-httpx-newest

Restore files previously stashed

Took 0 min 0 sec . View more details here
Description: coverage-python-3.6-prometheus_client-newest

Restore files previously stashed

Took 0 min 0 sec . View more details here
Description: coverage-python-3.10-gevent-newest

Restore files previously stashed

Took 0 min 0 sec . View more details here
Description: coverage-python-3.10-pymysql-newest

Restore files previously stashed

Took 0 min 0 sec . View more details here
Description: coverage-python-3.10-aiopg-newest

Restore files previously stashed

Took 0 min 0 sec . View more details here
Description: coverage-python-3.10-tornado-newest

Restore files previously stashed

Took 0 min 0 sec . View more details here
Description: coverage-python-3.10-httplib2-newest

Restore files previously stashed

Took 0 min 0 sec . View more details here
Description: coverage-python-3.10-sanic-newest

Archive the artifacts

Took 0 min 0 sec . View more details here
Description: [2022-09-20T13:41:28.357Z] Archiving artifacts
Python-python-3.10-elasticsearch-8 tests failed : hu

Error signal

Took 0 min 0 sec . View more details here
Description: Python-python-3.6-elasticsearch-8 tests failed : hudson.AbortException: script returned exit code 2

:bug: Flaky test report
:grey_exclamation: There are test failures but not known flaky tests.
Expand to view the summary

Genuine test errors
:broken_heart: There are test failures but not known flaky tests, most likely a genuine test failure.

Name: Initializing / Test / Python-python-3.10-0 / test_ping – tests.instrumentation.elasticsearch_tests
Name: Initializing / Test / Python-python-3.10-0 / test_create – tests.instrumentation.asyncio_tests.async_elasticsearch_client_tests
Name: Initializing / Test / Python-python-3.10-0 / test_search_body – tests.instrumentation.asyncio_tests.async_elasticsearch_client_tests
Name: Initializing / Test / Python-python-3.10-0 / test_count_body – tests.instrumentation.asyncio_tests.async_elasticsearch_client_tests
Name: Initializing / Test / Python-python-3.6-4 / test_create – tests.instrumentation.elasticsearch_tests
Name: Initializing / Test / Python-python-3.6-4 / test_index – tests.instrumentation.elasticsearch_tests
Name: Initializing / Test / Python-python-3.6-4 / test_exists – tests.instrumentation.elasticsearch_tests
Name: Initializing / Test / Python-python-3.6-4 / test_get – tests.instrumentation.elasticsearch_tests
Name: Initializing / Test / Python-python-3.6-4 / test_get_source – tests.instrumentation.elasticsearch_tests
Name: Initializing / Test / Python-python-3.6-4 / test_update_document – tests.instrumentation.elasticsearch_tests
Name: Initializing / Test / Python-python-3.6-4 / test_search_body – tests.instrumentation.elasticsearch_tests
Name: Initializing / Test / Python-python-3.6-4 / test_search_querystring – tests.instrumentation.elasticsearch_tests
Name: Initializing / Test / Python-python-3.6-4 / test_search_both – tests.instrumentation.elasticsearch_tests
Name: Initializing / Test / Python-python-3.6-4 / test_count_body – tests.instrumentation.elasticsearch_tests
Name: Initializing / Test / Python-python-3.6-4 / test_count_querystring – tests.instrumentation.elasticsearch_tests
Name: Initializing / Test / Python-python-3.6-4 / test_delete – tests.instrumentation.elasticsearch_tests
Name: Initializing / Test / Python-python-3.6-4 / test_multiple_indexes – tests.instrumentation.elasticsearch_tests
Name: Initializing / Test / Python-python-3.10-3 / test_create – tests.instrumentation.elasticsearch_tests
Name: Initializing / Test / Python-python-3.10-3 / test_index – tests.instrumentation.elasticsearch_tests
Name: Initializing / Test / Python-python-3.10-3 / test_exists – tests.instrumentation.elasticsearch_tests
Name: Initializing / Test / Python-python-3.10-3 / test_get – tests.instrumentation.elasticsearch_tests
Name: Initializing / Test / Python-python-3.10-3 / test_get_source – tests.instrumentation.elasticsearch_tests
Name: Initializing / Test / Python-python-3.10-3 / test_update_document – tests.instrumentation.elasticsearch_tests
Name: Initializing / Test / Python-python-3.10-3 / test_search_body – tests.instrumentation.elasticsearch_tests
Name: Initializing / Test / Python-python-3.10-3 / test_search_querystring – tests.instrumentation.elasticsearch_tests
Name: Initializing / Test / Python-python-3.10-3 / test_search_both – tests.instrumentation.elasticsearch_tests
Name: Initializing / Test / Python-python-3.10-3 / test_count_body – tests.instrumentation.elasticsearch_tests
Name: Initializing / Test / Python-python-3.10-3 / test_count_querystring – tests.instrumentation.elasticsearch_tests
Name: Initializing / Test / Python-python-3.10-3 / test_delete – tests.instrumentation.elasticsearch_tests
Name: Initializing / Test / Python-python-3.10-3 / test_multiple_indexes – tests.instrumentation.elasticsearch_tests
Name: Initializing / Test / Python-python-3.6-1 / test_ping – tests.instrumentation.elasticsearch_tests

:robot: GitHub comments
Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

/test : Re-trigger the build.

/test linters : Run the Python linters only.

/test full : Run the full matrix of tests.

/test benchmark : Run the APM Agent Python benchmarks tests.

run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

:globe_with_meridians: Coverage report

Name
Metrics % (covered/total)
Diff

Packages
100.0% (64/64)
:green_heart:

Files
100.0% (218/218)
:green_heart:

Classes
100.0% (218/218)
:green_heart:

Lines
87.846% (16790/19113)
:-1: -1.962

Conditionals
75.761% (3063/4043)
:-1: -1.384

authors: apmmachine beniwohli

repo: elastic/apm-agent-python


text:
OTel mapping doesn't populate span.Db

Our code in traces.go doesn’t seem to map db attributes onto span.db, which should be reviewed and fixed.

It's setting them here: https://github.com/elastic/apm-data/blob/455fb9f1280fa9dcb0ff4fa9ee08adb9a7970511/input/otlp/traces.go#L733
There's a test: https://github.com/elastic/apm-data/blob/455fb9f1280fa9dcb0ff4fa9ee08adb9a7970511/input/otlp/traces_test.go#L444-L486

Thanks @axw. My bad; I misread the earlier code, and my actual issue is not what I thought. I will close this!

authors: axw stevejgordon

repo: elastic/apm-data


text:
Remove Elasticsearch 0.90 support

ES 0.90 while popular is old and maintained. Upgrading to 1.x is easy and transparent and the stability improvements obvious. With ES 2.x around the corner, there's no real usage for 0.90 and thus in ES-Hadoop 2.2, support for 0.90 is officially removed.

Removed in master.

repo: elastic/elasticsearch-hadoop


text:
ConnectionSettings.ServerCertificateValidationCallback does not use System.Net.Security.RemoteCertificateValidationCallback

For stringent certificate handling it would be helpful if ConnectionSettings.ServerCertificateValidationCallback would use the standard RemoteCertificateValidationCallback delegate from the framework. Currently it uses a slightly different func that would need extra lifting in a centralized certificate handling scenario.
Yours
Func<object, X509Certificate, X509Chain, SslPolicyErrors, bool> callback
vs
public delegate bool RemoteCertificateValidationCallback(object sender, X509Certificate? certificate, X509Chain? chain, SslPolicyErrors sslPolicyErrors);
The only difference seems to be the nullability of the certificate and chain. So i don't see the why it needs to be different from the standard here.
Proposal:
Keep ConnectionSettings.ServerCertificateValidationCallback as it is for backward compatibility and add another RemoteCertificateValidationCallback property to ConnectionSettings conforming to the standard delegate from the framework.

Hi, @Another-Ralf. We specifically do not depend on the framework type in order to provide an abstraction that can work across our target frameworks. The library also targets net461, for example, where the signature of the framework types is different. Specifically, in this case, nullable reference types are not available on all targets. Our method needs to be independent of the target framework. While we could technically add framework dependent overloads, it because hard to maintain over time. For the same reason, we provide our own ITransport abstractions which decouple the public API of the library from the underlying HTTP implementation.
In your case, could you not provide a function somewhere to convert as necessary. A simple local function like this should be sufficient and doesn't feel like much extra lifting:
static Func<object, X509Certificate, X509Chain, SslPolicyErrors, bool> Interop(RemoteCertificateValidationCallback callback)
	=> (a, b, c, d) => callback(a, b, c, d);

If this is not practical, I'd like to understand your scenario further if you can share more details.

Wasn't aware that the callback signature isn't consistent over all frameworks. Good Argument.
I was already doing something along the line of your code sample. It is practical but felt unnecessary at first.

authors: Another-Ralf stevejgordon

repo: elastic/elasticsearch-net


text:
Script mapping parameters missing from some types

NEST/Elasticsearch.Net version: 7.16.4
Elasticsearch version: 7.16.4
.NET runtime version: .NET 6.0
Operating system version: Linux
Description of the problem including expected versus actual behavior:
Some mapping data types (e.g. keyword, number allow setting script as value source.
Currently NEST only allows this for GeoShape / GeoPoint which was requested in #6555.
Expected behavior
I can set up scripts in mappings for all the types that support it.
Provide ConnectionSettings (if relevant):
Provide DebugInformation (if relevant):

Thanks for raising this gap in the client @marcin-dardzinski. I'll review this further and look at adding this missing property for the other mapping types.

authors: marcin-dardzinski stevejgordon


text:
Mark data stream stats API as private on Serverless

As done by @dakrone in https://github.com/elastic/elasticsearch/pull/108745. This will remove this method from the Serverless clients.

This was actually reverted in https://github.com/elastic/elasticsearch/pull/109814, so let's hold off on this until it's been re-merged.

The new PR for this is https://github.com/elastic/elasticsearch/pull/112712, so this can be merged once that is merged (scheduled for next Thursday or Friday)

Thanks for the heads up! Subscribed. (Typically we wait for the pull request to actually be deployed to Serverless, as the clients are generated from the main branch.)

The change was deployed to production, merging.

authors: dakrone pquentin

repo: elastic/elasticsearch-specification


text:
Add default index pattern

Describe the feature:
I want the ability to configure a default indexing pattern (or patterns) in the kibana helm-chart
so that I can avoid having to manually configure index patterns every time I create a new kubernetes cluster with kibana.
Describe a specific use case for the feature:
I have code created that creates a k8s cluster with elastic/kibana/fluentd on it.  Every single time I create a cluster, when I navigate to kibana, it always asks me to configure an index pattern (because one does not exist).  I know what this pattern is and would like to define that in the helm chart so that it gets configured for me during the deployment process.

Hello, @DotNetRockStar
I am not maintainer, just a user. I am also trying to automate ELK cluster bootstrap.
Today I learned that there is a kibana API for this purpose: https://www.elastic.co/guide/en/kibana/7.17/index-patterns-api-create.html
I hope, it might be helpful for your issue.

It doesn't seem to an issue with helm-chart itself. please, for questions like that use our discuss https://discuss.elastic.co

I disagree with the hcomment, but I understand. I will proceed with another solution.

authors: DotNetRockStar framsouza v8v5v

repo: elastic/helm-charts


text:
Allow index pattern for source-index in shrink-index operation

This commit adds support for specifying several source indices using the
standard Elasticsearch Multi-target syntax for the shrink-index
runner.
This helps automate shrink operations for multiple indices.

@danielmitterdorfer Thanks for the review! I addressed your comments and requested a second review.

repo: elastic/rally


text:
github-action: use oblt-actions/git/setup

Details
⚠ This PR was created by an automated tool. Please review the changes carefully. ⚠
NOTE: https://github.com/elastic/apm-pipeline-library has been deprecated in favor of
https://github.com/elastic/oblt-actions.
If there are any questions, please reach out to the @elastic/observablt-ci

:green_heart: Build Succeeded

Buildkite Build
Commit: 2e8dd24c310071160be1a0ca2f03d2b5e36e3742

cc @v1v

The GH workflow that uses the affected code does not run on PRs so this we'll have to check the build after the fact.

authors: andrewkroh elasticmachine v1v

repo: elastic/stream


text:
[BUG]ElasticDump exports fields with data lengths greater than 17 bits, resulting in loss of precision

node --version > v12.16.0
npm --version >6.13.4
elasticdump --version > 6.71.0
elasticsearch --version >6.x
When exporting index data using elasticdump, the last 2 bits of exported data will become 0 if the shape data stored in the field is found and the length exceeds 17 bits,But this problem will not occur through curl queries
PUT test_01
{
  "mappings": {
      "doc": {
        "dynamic": "strict",
        "properties": {
          "x_id": {
            "type": "keyword"
          }
        }
      }
  }
}
---insert
POST test_01/doc/1306415010221662247
{
  "x_id":1306415010221662247
}

elasticdump --limit=100 --input=http://elastic:xxxx@172.xx.xx.xx:9200/test_01 --output=/home/data/test_01.json --type=data

----------------------
cat /home/data/test_01.json
{"_index":"test_01","_type":"doc","_id":"1306415010221662247","_score":1,"_source":{"x_id":1306415010221662200}}

x_id the last 2 bits of exported data will become 0
-----------------------
curl -u elastic:xxx  -H "Content-Type: application/json"  -XGET "http://172.xx.xx.xx:9200/test_01/doc/1306415010221662247"
{"_index":"test_01","_type":"doc","_id":"1306415010221662247","_version":1,"found":true,"_source":{
  "x_id":1306415010221662247
}

Changing the field type to long has the same problem

Use the `--support-big-int`` flag

repo: elasticsearch-dump/elasticsearch-dump


text:
Fix broken headings in Markdown files

GitHub changed the way Markdown headings are parsed, so this change fixes it.
See bryant1410/readmesfix for more information.
Tackles bryant1410/readmesfix#1

Hi! Thanks for MR, it was fixed before.

repo: elasticweb/nginx-snippets


text:
[3] Update to kubespray 2.18.1

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
There's a new kubespray release with some containerd fixes which probably nice to have before upgrading customers to it. It's not so much changes so should probably not be to hard to add.
https://github.com/kubernetes-sigs/kubespray/releases/tag/v2.18.1
Definition of done:
When could this feature be considered done.

Kubespray is updated to v2.18.1

Try updating etcd to 3.5.3 as well

repo: elastisys/compliantkubernetes-kubespray


text:
Add instructions for using Lens with Compliant Kubernetes

As a Compliant Kubernetes user, I want a graphical UI to quickly discover and navigate through Kubernetes resources.
Lens -- the Kubernetes IDE -- works out-of-the-box with Compliant Kubernetes.
Definition of done:

This page gives step-by-step instructions, including screenshots for the main steps, on how to connect Lens to a Compliant Kubernetes environment.

Related https://github.com/elastisys/roadmaps/issues/29

authors: cristiklein llarsson

repo: elastisys/compliantkubernetes


text:
HTML

HTML
User Story
As a bootcamp student
I want the prework notes to be structured on a webpage
so that I can easily find and read information
Acceptable criteria
GIVEN a Prework Study Guide website
WHEN I visit the website in my browser
THEN I see four boxes titled HTML, CSS, Git, and JavaScript with associated notes listed

Closed this issue because the issue is closed.

repo: elcaine/prework-study-guide


text:
[NewFeature] Multi-Lang support

Request of a new feature
Is multi-lang something possible ?
The Lychee comunity could be availble to do the translation in others languages than English.
Thanks

See https://github.com/electerious/Lychee/issues/207

authors: electerious givre

repo: electerious/Lychee


text:
能不能通过IP地址连接iphone呢？

不想连数据线

https://github.com/electricbubble/gwda/blob/3df5b5a59f91d9800661b80433e36ff5bf4d58cc/driver_test.go#L66-L72

repo: electricbubble/gwda