Repository navigation
Closed
Labels
Description
It seems like the import path is incorrect in firebase-debug.log.
/Users/hatoya/Desktop/momiji/Users/hatoya/Desktop/momiji/saved_data/dataconnect_export/postgres.tar.gz
=>
/Users/hatoya/Desktop/momiji/saved_data/dataconnect_export/postgres.tar.gz
[REQUIRED] Environment info
firebase-tools: 13.31.1
Platform: macOS
[REQUIRED] Test case
[REQUIRED] Steps to reproduce
- Run
firebase emulators:start --only dataconnect - Run
firebase emulators:export saved_data - Stop emulator
- Run
firebase emulators:start --import saved_data --only dataconnect
[REQUIRED] Expected behavior
The emulator starts without any problems.
[REQUIRED] Actual behavior
firebase-debug.log
[debug] [2025-02-14T02:07:56.133Z] ----------------------------------------------------------------------
[debug] [2025-02-14T02:07:56.135Z] Command: /Users/hatoya/.volta/tools/image/node/20.18.0/bin/node /Users/hatoya/Desktop/momiji/node_modules/.bin/firebase emulators:start --import saved_data --only dataconnect --project default
[debug] [2025-02-14T02:07:56.135Z] CLI Version: 13.31.1
[debug] [2025-02-14T02:07:56.135Z] Platform: darwin
[debug] [2025-02-14T02:07:56.135Z] Node Version: v20.18.0
[debug] [2025-02-14T02:07:56.136Z] Time: Fri Feb 14 2025 11:07:56 GMT+0900 (日本標準時)
[debug] [2025-02-14T02:07:56.136Z] ----------------------------------------------------------------------
[debug]
[debug] [2025-02-14T02:07:56.248Z] Object "/extensions" in "firebase.json" has unknown property: {"additionalProperty":"http-pdf-generator"}
[debug] [2025-02-14T02:07:56.251Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
[debug] [2025-02-14T02:07:56.251Z] > authorizing via signed-in user ([email protected])
[info] i emulators: Starting emulators: dataconnect {"metadata":{"emulator":{"name":"hub"},"message":"Starting emulators: dataconnect"}}
[debug] [2025-02-14T02:07:56.732Z] [logging] Logging Emulator only supports listening on one address (127.0.0.1). Not listening on ::1
[debug] [2025-02-14T02:07:56.732Z] [dataconnect.postgres] postgres server for dataconnect only supports listening on one address (127.0.0.1). Not listening on ::1
[debug] [2025-02-14T02:07:56.732Z] assigned listening specs for emulators {"user":{"hub":[{"address":"127.0.0.1","family":"IPv4","port":4400},{"address":"::1","family":"IPv6","port":4400}],"logging":[{"address":"127.0.0.1","family":"IPv4","port":4500}],"dataconnect":[{"address":"127.0.0.1","family":"IPv4","port":9399},{"address":"::1","family":"IPv6","port":9399}],"dataconnect.postgres":[{"address":"127.0.0.1","family":"IPv4","port":5432}]},"metadata":{"message":"assigned listening specs for emulators"}}
[debug] [2025-02-14T02:07:56.735Z] [hub] writing locator at /var/folders/ld/x6lzhgm52v52k_lwbq1k5j040000gn/T/hub-momiji-b5434.json
[info] i dataconnect: Importing data from /Users/hatoya/Desktop/momiji/saved_data/dataconnect_export {"metadata":{"emulator":{"name":"dataconnect"},"message":"Importing data from /Users/hatoya/Desktop/momiji/saved_data/dataconnect_export"}}
[debug] [2025-02-14T02:07:57.002Z] I0214 11:07:56.997465 99223 control.go:59] [/emulator/data-connect 7b35] UpdateResources(): done
Schema: sources: schema/schema.gql [4066B]
Connector "default": sources: connector/mutations.gql [4381B] connector/queries.gql [5781B]
{"metadata":{"emulator":{"name":"dataconnect"},"message":"I0214 11:07:56.997465 99223 control.go:59] [/emulator/data-connect 7b35] UpdateResources(): done\nSchema: sources: schema/schema.gql [4066B] \nConnector \"default\": sources: connector/mutations.gql [4381B] connector/queries.gql [5781B] \n"}}
[debug] [2025-02-14T02:07:57.002Z] Ignoring unsupported arg: auto_download {"metadata":{"emulator":{"name":"dataconnect"},"message":"Ignoring unsupported arg: auto_download"}}
[debug] [2025-02-14T02:07:57.002Z] Ignoring unsupported arg: port {"metadata":{"emulator":{"name":"dataconnect"},"message":"Ignoring unsupported arg: port"}}
[debug] [2025-02-14T02:07:57.002Z] Starting Data Connect Emulator with command {"binary":"/Users/hatoya/.cache/firebase/emulators/dataconnect-emulator-1.8.1","args":["--logtostderr","-v=2","dev","--listen=127.0.0.1:9399,[::1]:9399","--config_dir=/Users/hatoya/Desktop/momiji/dataconnect","--enable_output_schema_extensions=true","--enable_output_generated_sdk=true"],"optionalArgs":["listen","config_dir","enable_output_schema_extensions","enable_output_generated_sdk"],"joinArgs":true,"shell":false,"port":9399} {"metadata":{"emulator":{"name":"dataconnect"},"message":"Starting Data Connect Emulator with command {\"binary\":\"/Users/hatoya/.cache/firebase/emulators/dataconnect-emulator-1.8.1\",\"args\":[\"--logtostderr\",\"-v=2\",\"dev\",\"--listen=127.0.0.1:9399,[::1]:9399\",\"--config_dir=/Users/hatoya/Desktop/momiji/dataconnect\",\"--enable_output_schema_extensions=true\",\"--enable_output_generated_sdk=true\"],\"optionalArgs\":[\"listen\",\"config_dir\",\"enable_output_schema_extensions\",\"enable_output_generated_sdk\"],\"joinArgs\":true,\"shell\":false,\"port\":9399}"}}
[info] i dataconnect: Data Connect Emulator logging to dataconnect-debug.log {"metadata":{"emulator":{"name":"dataconnect"},"message":"Data Connect Emulator logging to \u001b[1mdataconnect-debug.log\u001b[22m"}}
[info] i dataconnect: Started up Postgres server, listening on {"address":"127.0.0.1","family":"IPv4","port":5432} {"metadata":{"emulator":{"name":"dataconnect"},"message":"Started up Postgres server, listening on {\"address\":\"127.0.0.1\",\"family\":\"IPv4\",\"port\":5432}"}}
[debug] [2025-02-14T02:07:57.017Z] [Data Connect] Connecting to postgres://127.0.0.1:5432/database?sslmode=disable}...
[debug] [2025-02-14T02:07:57.018Z] >>> [apiv2][query] POST http://127.0.0.1:9399/emulator/configure [none]
[debug] [2025-02-14T02:07:57.018Z] >>> [apiv2][body] POST http://127.0.0.1:9399/emulator/configure {"connectionString":"postgres://127.0.0.1:5432/database?sslmode=disable","database":"database","serviceId":"data-connect","maxOpenConnections":1}
[debug] [2025-02-14T02:07:57.019Z] *** [apiv2] error from fetch(http://127.0.0.1:9399/emulator/configure, {"headers":{},"method":"POST","body":"{\"connectionString\":\"postgres://127.0.0.1:5432/database?sslmode=disable\",\"database\":\"database\",\"serviceId\":\"data-connect\",\"maxOpenConnections\":1}"}): FetchError: request to http://127.0.0.1:9399/emulator/configure failed, reason: connect ECONNREFUSED 127.0.0.1:9399
[debug] [2025-02-14T02:07:57.019Z] [Data Connect] Retrying connectToPostgress call (1 of 3 attempts): FirebaseError: Data Connect emulator: undefined
[debug] [2025-02-14T02:07:57.152Z] I0214 11:07:57.150833 99225 load.go:37] Reloading schema and connectors...
{"metadata":{"emulator":{"name":"dataconnect"},"message":"I0214 11:07:57.150833 99225 load.go:37] Reloading schema and connectors...\n"}}
[debug] [2025-02-14T02:07:57.253Z] I0214 11:07:57.253411 99225 control.go:59] [/emulator/data-connect 274a] UpdateResources(): done
Schema: sources: schema/schema.gql [4066B]
Connector "default": sources: connector/mutations.gql [4381B] connector/queries.gql [5781B]
{"metadata":{"emulator":{"name":"dataconnect"},"message":"I0214 11:07:57.253411 99225 control.go:59] [/emulator/data-connect 274a] UpdateResources(): done\nSchema: sources: schema/schema.gql [4066B] \nConnector \"default\": sources: connector/mutations.gql [4381B] connector/queries.gql [5781B] \n"}}
[debug] [2025-02-14T02:07:57.299Z] I0214 11:07:57.299519 99225 codegen.go:82] [connector "default" javascriptSdk] Generating sources into "/Users/hatoya/Desktop/momiji/generated"
{"metadata":{"emulator":{"name":"dataconnect"},"message":"I0214 11:07:57.299519 99225 codegen.go:82] [connector \"default\" javascriptSdk] Generating sources into \"/Users/hatoya/Desktop/momiji/generated\"\n"}}
[debug] [2025-02-14T02:07:57.318Z] I0214 11:07:57.317995 99225 collector.go:107] schema extensions wrote into "/Users/hatoya/Desktop/momiji/dataconnect/.dataconnect/schema"
Generated sources: prelude.gql [65218B] main/implicit.gql [4491B] main/input.gql [72265B] main/relation.gql [11377B] main/query.gql [9408B] main/mutation.gql [29721B]
{"metadata":{"emulator":{"name":"dataconnect"},"message":"I0214 11:07:57.317995 99225 collector.go:107] schema extensions wrote into \"/Users/hatoya/Desktop/momiji/dataconnect/.dataconnect/schema\"\nGenerated sources: prelude.gql [65218B] main/implicit.gql [4491B] main/input.gql [72265B] main/relation.gql [11377B] main/query.gql [9408B] main/mutation.gql [29721B] \n"}}
[debug] [2025-02-14T02:07:57.318Z] I0214 11:07:57.318747 99225 collector.go:107] connector "default" javascriptSdk wrote into "/Users/hatoya/Desktop/momiji/generated"
Generated sources: index.d.ts [27521B] esm/index.esm.js [8108B] esm/package.json [17B] index.cjs.js [9719B] package.json [626B] README.md [103787B]
{"metadata":{"emulator":{"name":"dataconnect"},"message":"I0214 11:07:57.318747 99225 collector.go:107] connector \"default\" javascriptSdk wrote into \"/Users/hatoya/Desktop/momiji/generated\"\nGenerated sources: index.d.ts [27521B] esm/index.esm.js [8108B] esm/package.json [17B] index.cjs.js [9719B] package.json [626B] README.md [103787B] \n"}}
[debug] [2025-02-14T02:07:57.323Z] I0214 11:07:57.323132 99225 installsdk.go:48] Package @firebasegen/connector is already installed. Skipping installation
{"metadata":{"emulator":{"name":"dataconnect"},"message":"I0214 11:07:57.323132 99225 installsdk.go:48] Package @firebasegen/connector is already installed. Skipping installation\n"}}
[debug] [2025-02-14T02:07:57.323Z] I0214 11:07:57.323281 99225 load.go:115] Finished reloading
{"metadata":{"emulator":{"name":"dataconnect"},"message":"I0214 11:07:57.323281 99225 load.go:115] Finished reloading\n"}}
[debug] [2025-02-14T02:07:57.326Z] I0214 11:07:57.326362 99225 dev.go:95] Listening on address (HTTP + gRPC): 127.0.0.1:9399
{"metadata":{"emulator":{"name":"dataconnect"},"message":"I0214 11:07:57.326362 99225 dev.go:95] Listening on address (HTTP + gRPC): 127.0.0.1:9399\n"}}
[debug] [2025-02-14T02:07:57.327Z] I0214 11:07:57.327303 99225 dev.go:95] Listening on address (HTTP + gRPC): [::1]:9399
{"metadata":{"emulator":{"name":"dataconnect"},"message":"I0214 11:07:57.327303 99225 dev.go:95] Listening on address (HTTP + gRPC): [::1]:9399\n"}}
[debug] [2025-02-14T02:07:59.021Z] [Data Connect] Connecting to postgres://127.0.0.1:5432/database?sslmode=disable}...
[debug] [2025-02-14T02:07:59.021Z] >>> [apiv2][query] POST http://127.0.0.1:9399/emulator/configure [none]
[debug] [2025-02-14T02:07:59.021Z] >>> [apiv2][body] POST http://127.0.0.1:9399/emulator/configure {"connectionString":"postgres://127.0.0.1:5432/database?sslmode=disable","database":"database","serviceId":"data-connect","maxOpenConnections":1}
[debug] [2025-02-14T02:07:59.058Z] Frontend message
[debug] [2025-02-14T02:07:59.059Z] Backend message AuthenticationResponse
[debug] [2025-02-14T02:07:59.059Z] Backend message ParameterStatus
[debug] [2025-02-14T02:07:59.060Z] Backend message ReadyForQuery
[debug] [2025-02-14T02:07:59.062Z] Frontend message Query
[debug] [2025-02-14T02:07:59.070Z] Importing from /Users/hatoya/Desktop/momiji/Users/hatoya/Desktop/momiji/saved_data/dataconnect_export/postgres.tar.gz
[debug] [2025-02-14T02:07:59.070Z] Error: ENOENT: no such file or directory, open '/Users/hatoya/Desktop/momiji/Users/hatoya/Desktop/momiji/saved_data/dataconnect_export/postgres.tar.gz'
at Object.openSync (node:fs:573:18)
at Object.readFileSync (node:fs:452:35)
at PostgresServer.getDb (/Users/hatoya/Desktop/momiji/node_modules/firebase-tools/lib/emulator/dataconnect/pgliteServer.js:94:31)
at async Object.onMessage (/Users/hatoya/Desktop/momiji/node_modules/firebase-tools/lib/emulator/dataconnect/pgliteServer.js:55:32)
[error]
[error] Error: An unexpected error has occurred.dataconnect-debug.log
I0214 11:07:57.150833 99225 load.go:37] Reloading schema and connectors...
I0214 11:07:57.253411 99225 control.go:59] [/emulator/data-connect 274a] UpdateResources(): done
Schema: sources: schema/schema.gql [4066B]
Connector "default": sources: connector/mutations.gql [4381B] connector/queries.gql [5781B]
I0214 11:07:57.299519 99225 codegen.go:82] [connector "default" javascriptSdk] Generating sources into "/Users/hatoya/Desktop/momiji/generated"
I0214 11:07:57.317995 99225 collector.go:107] schema extensions wrote into "/Users/hatoya/Desktop/momiji/dataconnect/.dataconnect/schema"
Generated sources: prelude.gql [65218B] main/implicit.gql [4491B] main/input.gql [72265B] main/relation.gql [11377B] main/query.gql [9408B] main/mutation.gql [29721B]
I0214 11:07:57.318747 99225 collector.go:107] connector "default" javascriptSdk wrote into "/Users/hatoya/Desktop/momiji/generated"
Generated sources: index.d.ts [27521B] esm/index.esm.js [8108B] esm/package.json [17B] index.cjs.js [9719B] package.json [626B] README.md [103787B]
I0214 11:07:57.323132 99225 installsdk.go:48] Package @firebasegen/connector is already installed. Skipping installation
I0214 11:07:57.323281 99225 load.go:115] Finished reloading
I0214 11:07:57.326362 99225 dev.go:95] Listening on address (HTTP + gRPC): 127.0.0.1:9399
I0214 11:07:57.327303 99225 dev.go:95] Listening on address (HTTP + gRPC): [::1]:9399
Activity
jbkeg commentedon Feb 14, 2025
Hi, I encountered the same issue and found the root cause.
The problem lies in the
/src/emulator/controller.tsfile at line 893:The issue is with
the this.args.config.pathmethod. It prefixes the project absolute path tothis.args.importPath, which is already an absolute path. This results in an incorrect path being constructed.aalej commentedon Feb 14, 2025
Thanks for the detailed report @hatoya and thanks @jbkeg for sharing your observations! I'm able to reproduce the error, and as you both mentioned, it does look like we're incorrectly constructing the import path.
I'll raise this to our engineering team and mark this as reproducible.
@jbkeg it looks like you may have correctly identified the cause of the issue here. Feel free to submit a PR if you'd like to contribute a fix. Contributions are always appreciated!