firebase / firebase/firebase-tools

`firebase deploy` fails to delete task function with an underscore in its name

Open
#7,365 8 comments 0 reactions 2 assignees Claimed by @shettyvarun268 View on GitHub
api: functions Needs: Attention reproducible
Dominant language
TypeScript
Stars
4.5k
Forks
1.3k
Avg merge
1d 12h
Merged PRs (30d)
84

Description

### [REQUIRED] Environment info

**firebase-tools:** 13.11.4

**Platform:** Ubuntu 23.10 / fish

### [REQUIRED] Test case

```python
from firebase_functions import tasks_fn

@tasks_fn.on_task_dispatched()
def dummy_function(request: tasks_fn.CallableRequest) -> str:
return "Hello World"
```

### [REQUIRED] Steps to reproduce

1. Initialize functions.
1. Save the above function in `functions/main.py` (the default).
1. Execute `firebase deploy --only functions`. `dummy_function` will be deployed. (cf. https://github.com/firebase/firebase-tools/issues/6324)
1. Rename `dummy_function` to `dummy` in `functions/main.py`.
1. Execute `firebase deploy --only functions`. When queried for deletion of `dummy_function`, answer `y` (yes).

### [REQUIRED] Expected behavior

The old function should be deleted.

### [REQUIRED] Actual behavior

The old function is not deleted. Instead, an error is shown.

```
✔ functions: functions folder uploaded successfully

The following functions are found in your project but do not exist in your local source code:
dummy_function(us-central1)

If you are renaming a function or changing its region, it is recommended that you create the new function first before deleting the old one to prevent event loss. For more info, visit https://firebase.google.com/docs/functions/manage-functions#modify

? Would you like to proceed with deletion? Selecting no will continue the rest of the deployments. (y/N)
```

```
i functions: deleting Python 3.12 (2nd Gen) function dummy_function(us-central1)...
HTTP Error: 400, Queue ID "dummy_function" can contain only letters ([A-Za-z]), numbers ([0-9]), or hyphens (-). Queue ID must be between 1 and 100 characters.
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.