Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: The 'kernel' service is synthetic, it needs to be set at boot time when running update index command on 11.3.1 #202

Open
lucas-langa opened this issue Sep 18, 2024 · 10 comments

Comments

@lucas-langa
Copy link

Pimcore version

11.3.1

Steps to reproduce

php bin/console ecommerce:indexservice:bootstrap --update-index

Actual Behavior

429 from opensearch
image
then "The 'kernel' service is synthetic, it needs to be set at boot time" error
Screenshot from 2024-09-18 10-30-00

Expected Behavior

products get saved in opensearch index

@lucas-langa lucas-langa changed the title [Bug]: [Bug]: The 'kernel' service is synthetic, it needs to be set at boot time when running update index command on 11.3.1 Sep 18, 2024
@medovanx
Copy link

medovanx commented Oct 7, 2024

I have the same issue on Pimcore 11.4.0 using ES8
image

@fashxp
Copy link
Member

fashxp commented Oct 9, 2024

related to pimcore/data-importer#420?

@mattamon mattamon self-assigned this Oct 16, 2024
@mattamon
Copy link
Contributor

@lucas-langa Thank you for sharing this bug with us.

My first note would be, how does this even work with OpenSearch? Currently we are not supporting OpenSearch with the E-Commerce Framework. I would need some more details here if you are able to share them.

@medovanx I trued to reproduce the issue with ES8 in our docker setup, but was not able to reproduce it.
Can you please also provide more infos about how you setup elasticsearch?

@medovanx
Copy link

@mattamon

I used docker-compose with the following service

    elasticsearch:
        image: docker.elastic.co/elasticsearch/elasticsearch:8.15.0
        ports:
            - "9200:9200"
        volumes:
            - es_data:/usr/share/elasticsearch/data
        environment:
            - "ES_JAVA_OPTS=-Xms1g -Xmx1g"
            - "discovery.type=single-node"
            - xpack.security.enabled=false

and contents of ./config/ecommerce/elastic-search.yaml

pimcore_ecommerce_framework:
    index_service:
        tenants:
            EcommerceProductIndex:
                worker_id: Pimcore\Bundle\EcommerceFrameworkBundle\IndexService\Worker\ElasticSearch\DefaultElasticSearch8
                config_id: Pimcore\Bundle\EcommerceFrameworkBundle\IndexService\Config\ElasticSearch
                
                config_options:
                    client_config:
                        logging: false
                        indexName: 'product-index'

                    # elasticsearch client name, for Elasticsearch 8 only
                    es_client_name: default

                    index_settings:
                        number_of_shards: 5
                        number_of_replicas: 0
                        max_ngram_diff: 30
                        analysis:
                            analyzer:
                                my_ngram_analyzer:
                                    tokenizer: my_ngram_tokenizer
                                allow_list_analyzer:
                                    tokenizer: standard
                                    filter:
                                      - allow_list_filter
                            tokenizer:
                                my_ngram_tokenizer:
                                    type: ngram
                                    min_gram: 2
                                    max_gram: 15
                                    token_chars: [letter, digit]
                            filter:
                                allow_list_filter:
                                    type: keep
                                    keep_words:
                                      - was
                                      - WAS

pimcore_elasticsearch_client:
    es_clients:
        default:
            hosts: ['%env(ELASTICSEARCH_HOST)%:%env(ELASTICSEARCH_PORT)%']
            logger_channel: 'pimcore.elasticsearch'    

The Product class is called "Products" so I specify by running

bin/console \
ecommerce:indexservice:bootstrap --update-index \
--object-list-class Pimcore\\Model\\DataObject\\Products\\Listing```

I have the following in services.yaml because it was complaining of this method not being public when running the update-index command

    Symfony\Component\Lock\LockFactory:
        public: true

The Products class

Implements Interface: \Pimcore\Bundle\EcommerceFrameworkBundle\Model\IndexableInterface
Uses this Trait: \App\Ecommerce\IndexService\IndexableTrait

@mattamon
Copy link
Contributor

@medovanx thank you for your detailed description. I checked for differences and I updated my elastic search image. I still cannot reproduce this issue.

When does this error occur? Everytime you reindex your Products?

Do you manually execute the command or is it scheduled?

@medovanx
Copy link

@medovanx thank you for your detailed description. I checked for differences and I updated my elastic search image. I still cannot reproduce this issue.

When does this error occur? Everytime you reindex your Products?

Do you manually execute the command or is it scheduled?

Yep everytime I try to index, I run it manually

@mattamon
Copy link
Contributor

@medovanx thank you for your detailed description. I checked for differences and I updated my elastic search image. I still cannot reproduce this issue.
When does this error occur? Everytime you reindex your Products?
Do you manually execute the command or is it scheduled?

Yep everytime I try to index, I run it manually

Hmm okay, maybe some of my colleagues have to try it, but for me currently it works everytime. Thanks for your detailed description though!

@lukmzig
Copy link
Contributor

lukmzig commented Oct 21, 2024

This error suggests that the kernel service isn't being properly initialized or injected when running the index update

@medovanx since we are not able to reproduce this error, could you maybe share with us how and from where are you running the command exactly? What project setup are you using?

@medovanx
Copy link

@lukmzig
I already shared the setup above, could you please clarify what other details you need? I'd be happy to provide it

and also I'm running using docker compose exec php-fpm bin/console ~~~~

@mattamon
Copy link
Contributor

mattamon commented Oct 21, 2024

@medovanx e.g. that you are using console-parallelization even thought we tried it with running it with console-parallelization we could not reproduce it unfortunately.
Can you give us a rought amount on how many products you are processing?
So maybe we can update our test database.

Also you are using your own trait, the indexable trait. What does it do?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants