apache / pulsar

Apache Pulsar - distributed pub-sub messaging system
https://pulsar.apache.org/
Apache License 2.0
14.28k stars 3.59k forks source link

Error: Package Metadata Conflict When Recreating a Function with the Same Name #20930

Open divya-inaza opened 1 year ago

divya-inaza commented 1 year ago

Search before asking

Version

Pulsar Version : 2.11.1

Minimal reproduce step

The issue is related to creating and recreating functions within a development environment. The problem occurs when a function is initially created, subsequently deleted, and an attempt is made to recreate it using the same name. The error message received during the recreation attempt is as follows:

"detail": "code: 500, message: {"reason":"Package 'function://orgGroup1/org1tets1/licenseplate@0' metadata already exists"}, serviceUrl: http://standalone:8080/admin/v3/functions/orgGroup1/org1tets1/licenseplate"

What did you expect to see?

Function creation should be successful.

What did you see instead?

"detail": "code: 500, message: {"reason":"Package 'function://orgGroup1/org1tets1/licenseplate@0' metadata already exists"}, serviceUrl: http://standalone:8080/admin/v3/functions/orgGroup1/org1tets1/licenseplate"

Anything else?

No response

Are you willing to submit a PR?

1Jack2 commented 1 year ago

Package is not deleted when a related function is deleted If functionsWorkerEnablePackageManagement=true

Related to

https://github.com/apache/pulsar/issues/19721#issuecomment-1465273626

https://github.com/apache/pulsar/issues/17982

https://github.com/apache/pulsar/issues/18973#issuecomment-1458304726

github-actions[bot] commented 1 year ago

The issue had no activity for 30 days, mark with Stale label.

NurramoX commented 5 months ago

@1Jack2 When I start a fresh new standalone Apache Pulsar cluster (with docker-compose) using this configuration:

version: '3.9'
services:
  pulsar:
    container_name: pulsar
    image: apachepulsar/pulsar:3.2.2
    ports:
      - 6650:6650
      - 8080:8080
      - 8081:8081
    command: ["bin/pulsar", "standalone"]

I then access the bash console of the container (standalone cluster) and check the broker.conf file in /pulsar/conf. I find that enablePackagesManagement is set to false. Despite this setting, I still encounter the same package issue when I recreate the function. How can this apparent contradiction in configuration be explained?