Skip to content

[Bug] Cannot update functions with Package URL #18966

Closed

Description

@flowchartsman

Search before asking

  • I searched in the issues and found nothing similar.

Version

Pulsar v2.10.2

Minimal reproduce step

  1. Enable package service
  2. build a go function (maybe works with python or java too, don't know)
pulsar-admin packages upload function://public/default/[email protected] --path /full/path/to/function_binary --description "my function"
The package 'function://public/default/[email protected]' uploaded from path '/full/path/to/function_binary' successfully

pulsar-admin functions create --tenant public --namespace default --name myfunc --go "function://public/default/[email protected]" --inputs persistent://public/default/test
Created successfully

pulsar-admin packages upload function://public/default/[email protected] --path /full/path/to/function_binary_v2 --description "my function, but newer"
The package 'function://public/default/[email protected]' uploaded from path '/full/path/to/function_binary_v2' successfully

pulsar-admin functions update --go "function://public/default/[email protected]" --tenant public --namespace default --name myfunc
null

Reason: java.lang.IllegalArgumentException: File is not a normal file /Users/me/pulsar/function:/public/default/[email protected]

What did you expect to see?

Updated successfully

What did you see instead?

Reason: java.lang.IllegalArgumentException: File is not a normal file /Users/me/pulsar/function:/public/default/[email protected]

Anything else?

Unlike functions create, functions update does not seem to understand package URLs, and attempts to access a local file. Since packages have built in versioning, it only makes sense that you would be able to create a new package version and update the function to use it. This would be emanently useful for testing and/or staging upgrades to running functions, so it feels like it should work, however documentation on the subject is kind of hazy. In any case, it should be supported if it's not.

Are you willing to submit a PR?

  • I'm willing to submit a PR!

Activity

  1. added
    type/bug
    on Dec 17, 2022
  2. flowchartsman commented on Dec 17, 2022

    @flowchartsman
    ContributorAuthor

    Deleting and re-creating the function with function create might work under certain circumstances, but if you have your function set to clean up subscriptions when it is deleted, then this would essentially wipe its cursor and create a new one at "earliest/latest" depending, and my functions are set up in this way, so the workaround won't work for me, sadly.

  3. flowchartsman commented on Dec 17, 2022

    @flowchartsman
    ContributorAuthor

    It's worth noting that the docs for pulsar-admin functions update explicitly say you can do this with function and file urls:

        --go
          Path to the main Go executable binary for the function (if the function
          is written in Go). It also supports URL path [http/https/file (file
          protocol assumes that file already exists on worker host)/function
          (package URL from packages management service)] from which worker can
          download the package.
    

    file does not work either.

  4. github-actions commented on Jan 17, 2023

    @github-actions

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

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Staletype/bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions