Skip to content

Metadata string value "..." contains illegal characters #463

@samarthagarwal

Description

@samarthagarwal

Related issues

Version info

node: 10.13.0

firebase-functions: ^2.3.1

firebase-tools: 6.11.0

firebase-admin: 8.1.0

Test case

Inside a cloud function (HTTP or Firestore trigger), if we try to read a document nested within other documents, special characters in the document name are cause the function to crash.

So the following code crashes if churchId is Sørlandskirken or something like that. I tested and it allows spaces but not special characters like ø and æ. I have documents in my Cloud Firestore database with names with these characters and everything else works fine with the client SDK.

let programItems: QuerySnapshot = await admin.firestore().collection("Denominations/NO-Pinsebevegelsen/Churches/" + churchId + "/ProgramItems").get();

I get the error message that says.

Metadata string value "parent=projects/jesuskidsflutter-prod/databases/(default)/documents/Denominations/NO-Pinsebevegelsen/Churches/Sørlandskirken" contains illegal characters

Steps to reproduce

Create a document inside any collection with document ID as a string that contains special characters like ø and æ.
Create a sub-collection within this collection and create some documents inside the subcollections.
Next, try to read the documents such that the path to the document being read contains the document ID with special characters using the NodeJS SDK.

Expected behavior

The documents should be read without error. It handles spaces well but not special characters like ø and æ. I have not tested with other special characters.

Actual behavior

I get the error message that says.

Metadata string value "parent=projects/jesuskidsflutter-prod/databases/(default)/documents/Denominations/NO-Pinsebevegelsen/Churches/sørlandskirken" contains illegal characters

Were you able to successfully deploy your functions?

Yes, but function crashes because of this error. Please note that I am successfully able to create a Firestore trigger for the same path (that contains the special characters) and it works. Just can't read the documents.

Metadata

Metadata

Assignees

Labels

api: firestoretracked internallyIssues that are tracked internally, even though the issue is closed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions