How to fix Server Error, connect ETIMEDOUT after execute 'firebase deploy' - firebase

I'm recently working with Firebase. After practice with some services, Iwanted to deploy my functions. However, every time I want to deploy it, a timeout error appears.
I'm working with Ubuntu 19.04 and the version of firebase cli is 7.3.0
This is the error, sometimes the timeout appears before and any line.
firebase deploy --only functions:helloWorld --debug
[2019-09-01T14:47:30.465Z] ----------------------------------------------------------------------
[2019-09-01T14:47:30.470Z] Command: /opt/nodejs/node-v10.16.0-linux-x64/bin/node /opt/nodejs/node-v10.16.0-linux-x64/bin/firebase deploy --only functions:helloWorld --debug
[2019-09-01T14:47:30.471Z] CLI Version: 7.3.0
[2019-09-01T14:47:30.471Z] Platform: linux
[2019-09-01T14:47:30.471Z] Node Version: v10.16.0
[2019-09-01T14:47:30.472Z] Time: Sun Sep 01 2019 09:47:30 GMT-0500 (GMT-05:00)
[2019-09-01T14:47:30.472Z] ----------------------------------------------------------------------
[2019-09-01T14:47:30.483Z] > 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"]
[2019-09-01T14:47:30.483Z] > authorizing via signed-in user
[2019-09-01T14:47:30.484Z] [iam] checking project angular-preview-5ac98 for permissions ["cloudfunctions.functions.create","cloudfunctions.functions.delete","cloudfunctions.functions.get","cloudfunctions.functions.list","cloudfunctions.functions.update","cloudfunctions.operations.get","firebase.projects.get"]
[2019-09-01T14:47:30.486Z] >>> HTTP REQUEST POST https://cloudresourcemanager.googleapis.com/v1/projects/angular-preview-5ac98:testIamPermissions
permissions=[cloudfunctions.functions.create, cloudfunctions.functions.delete, cloudfunctions.functions.get, cloudfunctions.functions.list, cloudfunctions.functions.update, cloudfunctions.operations.get, firebase.projects.get]
[2019-09-01T14:47:31.973Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Sun, 01 Sep 2019 14:47:31 GMT, server=ESF, cache-control=private, x-xss-protection=0, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, server-timing=gfet4t7; dur=124, alt-svc=quic=":443"; ma=2592000; v="46,43,39", accept-ranges=none, transfer-encoding=chunked
=== Deploying to 'angular-preview-5ac98'...
i deploying functions
[2019-09-01T14:47:33.372Z] > [functions] package.json contents: {
"name": "functions",
"description": "Cloud Functions for Firebase",
"scripts": {
"serve": "firebase serve --only functions",
"shell": "firebase functions:shell",
"start": "npm run shell",
"deploy": "firebase deploy --only functions",
"logs": "firebase functions:log"
},
"engines": {
"node": "8"
},
"dependencies": {
"firebase-admin": "^8.0.0",
"firebase-functions": "^3.1.0"
},
"devDependencies": {
"firebase-functions-test": "^0.1.6"
},
"private": true
}
i functions: ensuring necessary APIs are enabled...
[2019-09-01T14:47:33.373Z] >>> HTTP REQUEST GET https://serviceusage.googleapis.com/v1/projects/angular-preview-5ac98/services/cloudfunctions.googleapis.com
[2019-09-01T14:47:33.374Z] >>> HTTP REQUEST GET https://serviceusage.googleapis.com/v1/projects/angular-preview-5ac98/services/runtimeconfig.googleapis.com
[2019-09-01T14:47:33.956Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Sun, 01 Sep 2019 14:47:33 GMT, server=ESF, cache-control=private, x-xss-protection=0, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, alt-svc=quic=":443"; ma=2592000; v="46,43,39", accept-ranges=none, transfer-encoding=chunked
✔ functions: all necessary APIs are enabled
[2019-09-01T14:49:43.050Z] Error: connect ETIMEDOUT 172.217.8.106:443
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1106:14)
Error: Server Error. connect ETIMEDOUT 172.217.8.106:443
I use the services of hosting. I deployed an app with integration with firestore without any error. I want to know the reason of this problem.

I executed all the commands to deploy my functions in other machine and in other network. It's possibly that my internet is unstable.
At this moment, I'm using the integration of Github with Travis CI to deploy my functions and I have no problems by the moment.

Restarting the Network router worked for me.

Related

Unable to connect to cloud shell from GCP console

I've been running into the following error for a while now when trying to connect to my Cloud Shell instance from the console:
Cloud Shell is experiencing some issues provisioning a VM to you. Please try again in a few minutes.
I get the following error when I try to SSH into the Cloud Shell from the CLI:
$gcloud cloud-shell ssh
Automatic authentication with GCP CLI tools in Cloud Shell is disabled. To enable, please rerun command with `--authorize-session` flag.
WARNING: The private SSH key file for gcloud does not exist.
WARNING: The public SSH key file for gcloud does not exist.
WARNING: The PuTTY PPK SSH key file for gcloud does not exist.
WARNING: You do not have an SSH key for gcloud.
WARNING: SSH keygen will be executed to generate a key.
Pushing your public key to Cloud Shell...done.
Starting your Cloud Shell machine...
ERROR: (gcloud.cloud-shell.ssh) HttpError accessing <https://cloudshell.googleapis.com/v1/users/me/environments/default:start?alt=json>: response: <{'vary': 'Origin, X-Origin, Referer', 'content-type': 'application/json; charset=UTF-8', 'content-encoding': 'gzip', 'date': 'Wed, 07 Dec 2022 11:22:20 GMT', 'server': 'ESF', 'cache-control': 'private', 'x-xss-protection': '0', 'x-frame-options': 'SAMEORIGIN', 'x-content-type-options': 'nosniff', 'alt-svc': 'h3=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"', 'transfer-encoding': 'chunked', 'status': 503}>, content <{
"error": {
"code": 503,
"message": "The service is currently unavailable.",
"status": "UNAVAILABLE"
}
}
>
This may be due to network connectivity issues. Please check your network settings, and the status of the service you are trying to reach.
Any thoughts on how i could resolve this?

Firebase Hosting NodeJS Express App not working, times out a lot

I have my big NodeJS app using Firebase, it was last modified in 2018. Since at that time i was learning firebase and firebase hosting from examples. index.js file kinda became huge, it contains routes as well as definitions of Firebase Functions. Currently i wanted to modularize it. So proceeded to upgrade Firebase and dependencies. Something new i had noticied is Firebase Emulators, currently firebase server command is not working. Firebase emulator:start seems to start the app but mostly times out like out of 30 attempts only once it works.
Version info
Firebase : 11.5.0
Below is the package.json in functions folder.
{
"name": "functions",
"description": "Cloud Functions for Firebase",
"scripts": {
"serve": "firebase emulators:start --only functions",
"shell": "firebase functions:shell",
"start": "npm run shell",
"deploy": "firebase deploy --only functions",
"logs": "firebase functions:log"
},
"engines": {
"node": "16"
},
"main": "index.js",
"dependencies": {
"#grpc/grpc-js": "^1.6.8",
"#sendgrid/mail": "^6.3.1",
"async": "^2.6.1",
"bluebird": "^3.5.3",
"ejs": "^3.1.8",
"express": "^4.16.3",
"firebase": "^8.2.2",
"firebase-admin": "^10.0.2",
"firebase-functions": "^3.18.0"
},
"devDependencies": {
"firebase-functions-test": "^0.2.0"
},
"private": true
}
Below is the firebase.json, emulator key/value is the new one, rest all i had from 2018 and no changes.
{
"database": {
"rules": "database.rules.json"
},
"functions": {
"ignore": [
"node_modules",
".git",
"firebase-debug.log",
"firebase-debug.*.log"
],
"source": "functions"
},
"hosting": {
"public": "public",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"headers": [
{
"source": "/**",
"headers": [
{
"key": "Cache-Control",
"value": "no-cache, no-store, must-revalidate"
}
]
}
],
"rewrites": [
{
"source": "**",
"function": "app"
}
]
},
"emulators": {
"hosting": {
"port": 5000
},
"ui": {
"enabled": false
},
"functions": {
"port": 5001
},
"database": {
"port": 9000
}
}
}
After i do the firebase emulators:start
In the browser, i am getting
Timed out waiting for function to respond.
In the firebase-debug.log, i see below messages. It says BUSY at multiple places but not sure whats BUSY as it being run locally.
[debug] [2022-08-10T05:47:37.602Z] [work-queue] {"queueLength":1,"workRunningCount":0}
[debug] [2022-08-10T05:47:37.602Z] [work-queue] {"queueLength":0,"workRunningCount":1}
[debug] [2022-08-10T05:47:37.602Z] Accepted request GET /prj-out22-20180718/us-central1/app/ --> us-central1-app
[debug] [2022-08-10T05:47:37.626Z] [worker-pool] addWorker(us-central1-app) {"metadata":{"emulator":{"name":"functions"},"message":"[worker-pool] addWorker(us-central1-app)"}}
[debug] [2022-08-10T05:47:37.627Z] [worker-pool] Adding worker with key us-central1-app, total=2 {"metadata":{"emulator":{"name":"functions"},"message":"[worker-pool] Adding worker with key us-central1-app, total=2"}}
[debug] [2022-08-10T05:47:37.627Z] [worker-pool] submitWork(triggerId=us-central1-app) {"metadata":{"emulator":{"name":"functions"},"message":"[worker-pool] submitWork(triggerId=us-central1-app)"}}
[debug] [2022-08-10T05:47:37.628Z] [worker-us-central1-app-37b679fa-3191-43c2-9b15-aad75042f00c]: BUSY {"metadata":{"emulator":{"name":"functions"},"message":"[worker-us-central1-app-37b679fa-3191-43c2-9b15-aad75042f00c]: BUSY"}}
[debug] FirebaseError: Failed to load function.
at Timeout._onTimeout (C:\Users\Sushanth\AppData\Roaming\npm\node_modules\firebase-tools\lib\emulator\functionsRuntimeWorker.js:104:24)
at listOnTimeout (node:internal/timers:559:17)
at processTimers (node:internal/timers:502:7) {"metadata":{"emulator":{"name":"functions"},"message":{"name":"FirebaseError","children":[],"exit":1,"message":"Failed to load function.","status":500}}}
And when it works, i see below
[debug] [2022-08-10T06:05:11.950Z] [worker-us-central1-app-873dbf58-beeb-4662-bbc0-23271dfe56e0]: BUSY {"metadata":{"emulator":{"name":"functions"},"message":"[worker-us-central1-app-873dbf58-beeb-4662-bbc0-23271dfe56e0]: BUSY"}}
[debug] [2022-08-10T06:05:16.977Z] [runtime-status] [13808] Resolved module firebase-admin {"declared":true,"installed":true,"version":"10.3.0","resolution":"D:\\BigData\\13. Firebase\\FB-BTD\\kickbear\\functions\\node_modules\\firebase-admin\\lib\\index.js"} {"metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-app"},"extension":{},"message":"[runtime-status] [13808] Resolved module firebase-admin {\"declared\":true,\"installed\":true,\"version\":\"10.3.0\",\"resolution\":\"D:\\\\BigData\\\\13. Firebase\\\\FB-BTD\\\\kickbear\\\\functions\\\\node_modules\\\\firebase-admin\\\\lib\\\\index.js\"}"}}
[debug] [2022-08-10T06:05:16.980Z] [runtime-status] [13808] Resolved module firebase-functions {"declared":true,"installed":true,"version":"3.22.0","resolution":"D:\\BigData\\13. Firebase\\FB-BTD\\kickbear\\functions\\node_modules\\firebase-functions\\lib\\index.js"} {"metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-app"},"extension":{},"message":"[runtime-status] [13808] Resolved module firebase-functions {\"declared\":true,\"installed\":true,\"version\":\"3.22.0\",\"resolution\":\"D:\\\\BigData\\\\13. Firebase\\\\FB-BTD\\\\kickbear\\\\functions\\\\node_modules\\\\firebase-functions\\\\lib\\\\index.js\"}"}}
[debug] [2022-08-10T06:05:16.981Z] [runtime-status] [13808] Found local functions config: D:\BigData\13. Firebase\FB-BTD\kickbear\functions/.runtimeconfig.json {"metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-app"},"extension":{},"message":"[runtime-status] [13808] Found local functions config: D:\\BigData\\13. Firebase\\FB-BTD\\kickbear\\functions/.runtimeconfig.json"}}
[debug] [2022-08-10T06:05:16.981Z] [runtime-status] [13808] Outgoing network have been stubbed. [{"name":"http","status":"mocked"},{"name":"http","status":"mocked"},{"name":"https","status":"mocked"},{"name":"https","status":"mocked"},{"name":"net","status":"mocked"}] {"metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-app"},"extension":{},"message":"[runtime-status] [13808] Outgoing network have been stubbed. [{\"name\":\"http\",\"status\":\"mocked\"},{\"name\":\"http\",\"status\":\"mocked\"},{\"name\":\"https\",\"status\":\"mocked\"},{\"name\":\"https\",\"status\":\"mocked\"},{\"name\":\"net\",\"status\":\"mocked\"}]"}}
[debug] [2022-08-10T06:05:16.984Z] [runtime-status] [13808] Resolved module firebase-functions {"declared":true,"installed":true,"version":"3.22.0","resolution":"D:\\BigData\\13. Firebase\\FB-BTD\\kickbear\\functions\\node_modules\\firebase-functions\\lib\\index.js"} {"metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-app"},"extension":{},"message":"[runtime-status] [13808] Resolved module firebase-functions {\"declared\":true,\"installed\":true,\"version\":\"3.22.0\",\"resolution\":\"D:\\\\BigData\\\\13. Firebase\\\\FB-BTD\\\\kickbear\\\\functions\\\\node_modules\\\\firebase-functions\\\\lib\\\\index.js\"}"}}
[debug] [2022-08-10T06:05:17.175Z] [runtime-status] [13808] Checked functions.config() {"config":{}} {"metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-app"},"extension":{},"message":"[runtime-status] [13808] Checked functions.config() {\"config\":{}}"}}
[debug] [2022-08-10T06:05:17.175Z] [runtime-status] [13808] firebase-functions has been stubbed. {"functionsResolution":{"declared":true,"installed":true,"version":"3.22.0","resolution":"D:\\BigData\\13. Firebase\\FB-BTD\\kickbear\\functions\\node_modules\\firebase-functions\\lib\\index.js"}} {"metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-app"},"extension":{},"message":"[runtime-status] [13808] firebase-functions has been stubbed. {\"functionsResolution\":{\"declared\":true,\"installed\":true,\"version\":\"3.22.0\",\"resolution\":\"D:\\\\BigData\\\\13. Firebase\\\\FB-BTD\\\\kickbear\\\\functions\\\\node_modules\\\\firebase-functions\\\\lib\\\\index.js\"}}"}}
[debug] [2022-08-10T06:05:17.178Z] [runtime-status] [13808] Resolved module firebase-functions {"declared":true,"installed":true,"version":"3.22.0","resolution":"D:\\BigData\\13. Firebase\\FB-BTD\\kickbear\\functions\\node_modules\\firebase-functions\\lib\\index.js"} {"metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-app"},"extension":{},"message":"[runtime-status] [13808] Resolved module firebase-functions {\"declared\":true,\"installed\":true,\"version\":\"3.22.0\",\"resolution\":\"D:\\\\BigData\\\\13. Firebase\\\\FB-BTD\\\\kickbear\\\\functions\\\\node_modules\\\\firebase-functions\\\\lib\\\\index.js\"}"}}
[debug] [2022-08-10T06:05:17.183Z] [runtime-status] [13808] Resolved module firebase-admin {"declared":true,"installed":true,"version":"10.3.0","resolution":"D:\\BigData\\13. Firebase\\FB-BTD\\kickbear\\functions\\node_modules\\firebase-admin\\lib\\index.js"} {"metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-app"},"extension":{},"message":"[runtime-status] [13808] Resolved module firebase-admin {\"declared\":true,\"installed\":true,\"version\":\"10.3.0\",\"resolution\":\"D:\\\\BigData\\\\13. Firebase\\\\FB-BTD\\\\kickbear\\\\functions\\\\node_modules\\\\firebase-admin\\\\lib\\\\index.js\"}"}}
[debug] [2022-08-10T06:05:17.186Z] [runtime-status] [13808] Resolved module firebase-functions {"declared":true,"installed":true,"version":"3.22.0","resolution":"D:\\BigData\\13. Firebase\\FB-BTD\\kickbear\\functions\\node_modules\\firebase-functions\\lib\\index.js"} {"metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-app"},"extension":{},"message":"[runtime-status] [13808] Resolved module firebase-functions {\"declared\":true,\"installed\":true,\"version\":\"3.22.0\",\"resolution\":\"D:\\\\BigData\\\\13. Firebase\\\\FB-BTD\\\\kickbear\\\\functions\\\\node_modules\\\\firebase-functions\\\\lib\\\\index.js\"}"}}
[debug] [2022-08-10T06:05:17.186Z] [runtime-status] [13808] firebase-admin has been stubbed. {"adminResolution":{"declared":true,"installed":true,"version":"10.3.0","resolution":"D:\\BigData\\13. Firebase\\FB-BTD\\kickbear\\functions\\node_modules\\firebase-admin\\lib\\index.js"}} {"metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-app"},"extension":{},"message":"[runtime-status] [13808] firebase-admin has been stubbed. {\"adminResolution\":{\"declared\":true,\"installed\":true,\"version\":\"10.3.0\",\"resolution\":\"D:\\\\BigData\\\\13. Firebase\\\\FB-BTD\\\\kickbear\\\\functions\\\\node_modules\\\\firebase-admin\\\\lib\\\\index.js\"}}"}}
[debug] [2022-08-10T06:05:17.187Z] [runtime-status] [13808] Functions runtime initialized. {"cwd":"D:\\BigData\\13. Firebase\\FB-BTD\\kickbear\\functions","node_version":"16.16.0"} {"metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-app"},"extension":{},"message":"[runtime-status] [13808] Functions runtime initialized. {\"cwd\":\"D:\\\\BigData\\\\13. Firebase\\\\FB-BTD\\\\kickbear\\\\functions\",\"node_version\":\"16.16.0\"}"}}
[warn] ! It looks like you're trying to access functions.config().firebase but there is no value there. You can learn more about setting up config here: https://firebase.google.com/docs/functions/local-emulator {"metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-app"},"extension":{},"message":"It looks like you're trying to access functions.config().firebase but there is no value there. You can learn more about setting up config here: https://firebase.google.com/docs/functions/local-emulator"}}
[debug] [2022-08-10T06:05:18.528Z] [runtime-status] [13808] initializeApp(DEFAULT) {"storageBucket":"prj-out22-20180718.appspot.com","databaseURL":"http://localhost:9000/?ns=prj-out22-20180718","projectId":"prj-out22-20180718"} {"metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-app"},"extension":{},"message":"[runtime-status] [13808] initializeApp(DEFAULT) {\"storageBucket\":\"prj-out22-20180718.appspot.com\",\"databaseURL\":\"http://localhost:9000/?ns=prj-out22-20180718\",\"projectId\":\"prj-out22-20180718\"}"}}
[debug] [2022-08-10T06:05:18.812Z] [runtime-status] [13808] Beginning invocation function app! {"metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-app"},"extension":{},"message":"[runtime-status] [13808] Beginning invocation function app!"}}
[info] i functions: Beginning execution of "app" {"metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-app"},"extension":{},"message":"Beginning execution of \"app\""}}
[debug] [2022-08-10T06:05:18.814Z] [runtime-status] [13808] Running app in signature http {"metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-app"},"extension":{},"message":"[runtime-status] [13808] Running app in signature http"}}
[debug] [2022-08-10T06:05:18.834Z] [runtime-status] [13808] Listening to port: \\?\pipe\fire_emu_c5878ff69629ce9a {"metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-app"},"extension":{},"message":"[runtime-status] [13808] Listening to port: \\\\?\\pipe\\fire_emu_c5878ff69629ce9a"}}
[debug] [2022-08-10T06:05:18.950Z] [functions] Runtime ready! Sending request! {"metadata":{"emulator":{"name":"functions"},"message":"[functions] Runtime ready! Sending request!"}}
[debug] [2022-08-10T06:05:18.951Z] [functions] Got req.url=/prj-out22-20180718/us-central1/app/, mapping to path=/ {"metadata":{"emulator":{"name":"functions"},"message":"[functions] Got req.url=/prj-out22-20180718/us-central1/app/, mapping to path=/"}}
[debug] [2022-08-10T06:05:18.957Z] [runtime-status] [13808] Ephemeral server handling GET request {"metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-app"},"extension":{},"message":"[runtime-status] [13808] Ephemeral server handling GET request"}}
[debug] [2022-08-10T06:05:18.963Z] [runtime-status] [13808] Ephemeral server survived. {"metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-app"},"extension":{},"message":"[runtime-status] [13808] Ephemeral server survived."}}
[debug] [2022-08-10T06:05:19.597Z] <<< [apiv2][status] GET http://localhost:5001/prj-out22-20180718/us-central1/app/ 200
[debug] [2022-08-10T06:05:19.597Z] <<< [apiv2][body] GET http://localhost:5001/prj-out22-20180718/us-central1/app/ [stream]
Please advise, if any dependencies need to be upgraded to downgraded.
I was stuck with this for nearly two days. So i did couple of things.
Uninstalled all the NPM Packages which i had installed globally and locally.
Reinstalled Firebase-admin, Firebase-Functions and also other packages which was outdated with #latest, locally in the app folder.
Was not sure if firebase-tools package is to be installed locally or globally as a standard as Google Docs has global keyword in and one of David Easts recent video he has installed it locally. But anyhow reinstalled globally.
Not much actually changed in my code.
Just restarted the computer all worked.
Update : There seem to be a known issue. Downgraded to 11.2.2

NextJS collecting page data fails with status code 500

I have a NextJS application which builds an optimised front end. npm run build is now throwing this error:
> my-app#0.1.0 build C:\git\MyApp\MyApp-UI\src
> next build
info - Loaded env from C:\git\MyApp\MyApp-UI\src\.env.local
info - Loaded env from C:\git\MyApp\MyApp-UI\src\.env.production
(node:15540) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification.
(Use `node --trace-warnings ...` to show where the warning was created)
info - Checking validity of types
info - Creating an optimized production build
info - Compiled successfully
When it gets to this point I see this:
info - Collecting page data ..
But a moment later that line disappears and I see this:
> Build error occurred
Error: Request failed with status code 500
at createError (C:\git\MyApp\MyApp-UI\src\node_modules\axios\lib\core\createError.js:16:15)
at settle (C:\git\MyApp\MyApp-UI\src\node_modules\axios\lib\core\settle.js:17:12)
at IncomingMessage.handleStreamEnd (C:\git\MyApp\MyApp-UI\src\node_modules\axios\lib\adapters\http.js:293:11)
at IncomingMessage.emit (events.js:387:35)
at endReadableNT (internal/streams/readable.js:1317:12)
at processTicksAndRejections (internal/process/task_queues.js:82:21) {
type: 'Error',
config: {
transitional: {
silentJSONParsing: true,
forcedJSONParsing: true,
clarifyTimeoutError: false
},
transformRequest: [ null ],
transformResponse: [ null ],
timeout: 0,
xsrfCookieName: 'XSRF-TOKEN',
xsrfHeaderName: 'X-XSRF-TOKEN',
maxContentLength: -1,
maxBodyLength: -1,
headers: { Accept: 'application/json', 'User-Agent': 'axios/0.23.0' },
method: 'get',
url: 'http://localhost:8080/api/v1/catalog/en-GB/pages',
data: null,
withCredentials: false
},
status: 500
}
info - Collecting page data .npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! my-app#0.1.0 build: `next build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the my-app#0.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
The package.json contains this:
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "eslint ./ --ext js,jsx,ts,tsx",
"export": "next export",
"gzip": "gzipper compress --gzip-level 9 --verbose --output-file-format [filename].[ext] ./out ./zipped",
"sitemap": "node ./sitemap-generator/sitemap-gen.js",
"sitemap-index": "node ./sitemap-generator/sitemap-index-gen.js"
},
The URL at 8080 which provides the build-time data returns sensible content when I drop it into a browser. As far as I can see, there is no error there.
The basic question is, what would be causing this and where should I look to identify the source?
If this is something to do with the NODE_TLS_REJECT_UNAUTHORIZED environment variable, where/what do I need to adjust and what is that? (I can't find that variable in the solution.)
Turns out there was an error in the solution which was being called but due to errors being ignored I had not seen it get caught in the debugger.

How to fix failure to create function when deploying functions.pubsub.schedule

When I attempt to deploy the functions.pubsub.schedule like this on index.js:
const functions = firebase.functions;
var cronCount = 0;
exports.processPostsCron = functions.pubsub.schedule('* * * *
*').onRun(context => {
cronCount++;
console.log(`### this runs every minute. count: ${cronCount}`);
});
Error occured:
functions: failed to create function processPostsCron
HTTP Error: 400, The request has errors
How do I fix this error or am I doing it wrong?
I was referring to this https://github.com/firebase/functions-samples/blob/master/delete-unused-accounts-cron/functions/index.js
I am using firebase-admin#7.0.0 and firebase-functions#2.3.1.
Edit 1:
Debug result:
i functions: creating Node.js 8 function processPostsCron(us-central1)...
[2019-05-29T17:19:41.712Z] Trigger is: {"eventTrigger":{"resource":"projects/ticktock-d34b6/topics","eventType":"google.pubsub.topic.publish","service":"pubsub.googleapis.com"}}
[2019-05-29T17:19:41.714Z] >>> HTTP REQUEST POST https://cloudfunctions.googleapis.com/v1/projects/ticktock-d34b6/locations/us-central1/functions
sourceUploadUrl=https://storage.googleapis.com/gcf-upload-us-central1-f74bb5e4-12fb-4381-9f5a-ba9e11a921a8/2fac50ef-9d15-4390-8836-21209adfa8b4.zip?GoogleAccessId=service-1096541131355#gcf-admin-robot.iam.gserviceaccount.com&Expires=1559152179&Signature=EzcN7sYYs05vuTyVu7%2BMyJGU8viklA5VWPZRmMeASBCmlK6Xl%2BtMhL1G%2Fv4JHempDcLJ3FmvLDGPbar1iP%2BtNiApL%2B%2Fn6wjQINbF4CmpmqKnjxieBqpzkRYUD40zNMyCGbRDnkhcsps6DBpI9reiHvxdKkqYqadBPCaCn10nZwo96zaHcxZYHWg5PIo4cPLoPyOI7PTl4WYdwwt%2FzOHKlQSdyh1VuRgZqwfgy0vgDQR9HY846k0Tkg6RB6fGex8MzysUxiZ4RfPdt1i0LGd1KpY%2ByhG0OlEsMODQY3bBQ4TMh6LNbVyC2s9%2F0wJPkzAdJpnTjarf3hOgsF9908VkOg%3D%3D, name=projects/ticktock-d34b6/locations/us-central1/functions/processPostsCron, entryPoint=processPostsCron, deployment-tool=cli-firebase, deployment-scheduled=true, runtime=nodejs8, resource=projects/ticktock-d34b6/topics, eventType=google.pubsub.topic.publish, service=pubsub.googleapis.com
[2019-05-29T17:19:42.141Z] <<< HTTP RESPONSE 400 vary=X-Origin, Referer, Origin,Accept-Encoding, content-type=application/json; charset=UTF-8, date=Wed, 29 May 2019 17:19:42 GMT, server=ESF, cache-control=private, x-xss-protection=0, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, alt-svc=quic=":443"; ma=2592000; v="46,44,43,39", accept-ranges=none, connection=close
[2019-05-29T17:19:42.141Z] <<< HTTP RESPONSE BODY code=400, message=The request has errors, status=INVALID_ARGUMENT, details=[#type=type.googleapis.com/google.rpc.BadRequest, fieldViolations=[field=pubsub_topic, description=Pub/Sub topic name projects/ticktock-d34b6/topics does not match the expected pattern]]
⚠ functions: failed to create function processPostsCron
HTTP Error: 400, The request has errors
Functions deploy had errors with the following functions:
processPostsCron
To try redeploying those functions, run:
firebase deploy --only functions:processPostsCron
To continue deploying other features (such as database), run:
firebase deploy --except functions
Error: Functions did not deploy properly.
Seems like the error occurs from:
fieldViolations=[field=pubsub_topic, description=Pub/Sub topic name projects/ticktock-d34b6/topics does not match the expected pattern]]
Firebase Support has given me the instruction to update CLI and it's all good after update. Here's the command:
npm install -g firebase-tools#latest
It didn't worked for me at first, I have added 'unsafe-perm' option to proceed:
npm install -g firebase-tools#latest --unsafe-perm

Meteor --production not running on https://localhost:3443 but defaults to localhost:3000

I am running meteor from the console (not using mup)
Development:
ROOT_URL=https://localhost:3443 meteor --settings=settings.json
Production:
ROOT_URL=https://localhost:3443 meteor
--settings=settings.json
--production
I want production to run in https://localhost:3443 but it only shows up on localhost:3000. Both use the same settings.json file
The settings.json has this (shown below) and a couple other things:
"dev": {
"ssl": {
"key": "localhost.key",
"crt": "localhost.crt",
"port": 3443
}
},
Try below command
meteor run --port 3443

Resources