Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

“Error: Server Error. socket hang up” whenever I do “firebase deploy --only hosting, database, storage” #1309

Closed
top-talent0112 opened this issue May 17, 2019 · 14 comments

Comments

@top-talent0112
Copy link

[REQUIRED] Environment info

I am using the latest version of firebase-tools.

firebase-tools: v6.9.2

Platform: Ubuntu 18.04

[REQUIRED] Test case

I am sure that firebase.json is in a good condition.

[REQUIRED] Steps to reproduce

firebase login
firebase list
firebase use 'myprojectid'
firebase deploy --only database, functions, storage, hosting

[REQUIRED] Expected behavior

it must be done successfully.

[REQUIRED] Actual behavior

It always ends up with reporting “Error: Server Error. socket hang up” error.

@bkendall
Copy link
Contributor

If you are still seeing this error, can you provide contents of firebase-debug.log or the output of running this command with --debug? Sometimes these issues are temporary, but it's difficult to know what in particular is failing without more details.

@bkendall bkendall added the Needs: Author Feedback Issues awaiting author feedback label May 17, 2019
@top-talent0112
Copy link
Author

OK, This is the snippet of firebase-debug.log when I execute the "firebase deploy --only database,storage"

[debug] [2019-05-17T18:18:52.268Z] Error: socket hang up
    at TLSSocket.onHangUp (_tls_wrap.js:1135:19)
    at Object.onceWrapper (events.js:313:30)
    at emitNone (events.js:111:20)
    at TLSSocket.emit (events.js:208:7)
    at endReadableNT (_stream_readable.js:1055:12)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickDomainCallback (internal/process/next_tick.js:218:9)
[error] 
[error] Error: Server Error. socket hang up

@google-oss-bot google-oss-bot added Needs: Attention and removed Needs: Author Feedback Issues awaiting author feedback labels May 17, 2019
@bkendall
Copy link
Contributor

That's not quite enough to know what it's failing on. Before this part of the log, you should see some kind of URL with a method in front of it. Hopefully that will tell us what call is failing - this is only telling us that a call is failing (which is what we knew).

It may also be worth checking your environment to see if you have any PROXY settings that might effect this. You can check by doing env | grep PROXY and looking through any remaining environment variables.

@bkendall bkendall added Needs: Author Feedback Issues awaiting author feedback and removed Needs: Attention labels May 20, 2019
@top-talent0112
Copy link
Author

Thanks for your attention.
Fortunately, I solved this problem by myself. I just appended ":projectID" to the last of the deploy command. But I am still feeling strange about this. Since that I used the "firebase use" command, doesn't it contain the default "projectID"?

@google-oss-bot google-oss-bot added Needs: Attention and removed Needs: Author Feedback Issues awaiting author feedback labels May 21, 2019
@bkendall
Copy link
Contributor

Can you clarify what you mean by "appended :projectID"? Can you give the specific example? I think folks will want to look into this, but I'm not entirely sure I have enough context yet 🙂

@tohagan
Copy link

tohagan commented May 23, 2019

Hitting the same issue. Just submitted a support ticket with my firebase-debug.log attached.

firebase-tools: v6.10.0
Platform: Windows 10 + Bash

Actual Behaviour

hosting deployment fails consistently

Steps to Reproduce
firebase logout
firebase login
firebase list
firebase use 'myproject'
firebase deploy --only hosting

[info] === Deploying to 'myproject'...
[info] 
[info] i  deploying hosting
[info] Running command: yarn --cwd hosting build
[info] +  hosting: Finished running predeploy script.
[debug] [2019-05-23T13:06:37.189Z] >>> HTTP REQUEST POST https://firebasehosting.googleapis.com/v1beta1/sites/myproject/versions  

[debug] [2019-05-23T13:06:46.093Z] <<< HTTP RESPONSE 200
[info] i  hosting[myproject]: beginning deploy...
[info] i  hosting[myproject]: found 349 files in hosting/dist/spa-mat
[debug] [2019-05-23T13:06:46.198Z] [hosting] hash cache [aG9zdGluZ1xkaXN0XHNwYS1tYXQ] load error: lines is not defined
[debug] [2019-05-23T13:06:46.568Z] [hosting] hash cache [aG9zdGluZ1xkaXN0XHNwYS1tYXQ] stored for 349 files
[debug] [2019-05-23T13:06:46.568Z] [hosting][hash queue][FINAL]
[debug] [2019-05-23T13:06:46.568Z] >>> HTTP REQUEST POST https://firebasehosting.googleapis.com/v1beta1/sites/myproject/versions/6d60dfe7620f9c53:populateFiles  
 <request body omitted>
[debug] [2019-05-23T13:07:02.230Z] <<< HTTP RESPONSE 200
[debug] [2019-05-23T13:07:02.234Z] [hosting][populate queue][FINAL]
[debug] [2019-05-23T13:07:02.234Z] [hosting] uploads queued: 9
[debug] [2019-05-23T13:07:33.337Z] [uploadQueue] Retrying task 5230dc6f9f127a0c2ef002fccd08c1d9a003728fc840caa91ca1b864790647dc
[debug] [2019-05-23T13:07:33.847Z] [uploadQueue] Retrying task 8b9f21408c4c9a4c6759997a8df0c71023103f4db8be4ebde9229e7ad9a8185b
[debug] [2019-05-23T13:07:34.334Z] [uploadQueue] Retrying task 24fa10b7cd321052bf860176bd7abc6bb2a333142de1af050bdc3e77cc281c27
[debug] [2019-05-23T13:07:34.345Z] [uploadQueue] Retrying task c5a39af308be34945cc9bf1f7801d59d913967d907feaa04cdcfdd914648e284
[debug] [2019-05-23T13:07:34.836Z] [uploadQueue] Retrying task 1d7f432fe7e0e56a5c910b0c2bb3598367e898c38576ea9db37495378aa6dc96
[debug] [2019-05-23T13:07:37.409Z] [uploadQueue] Retrying task 232b02581515a51180a7f88422f33433c3b1ca06f46286b68752f8ef926d2ff4
[debug] [2019-05-23T13:07:37.887Z] [uploadQueue] Retrying task 592daea958cf457d6892259266cdba5f17d0694666dcc5d02b41d3edd8d962af
[debug] [2019-05-23T13:07:43.857Z] [uploadQueue] Retrying task 2dbe4b5cf4ff93e12e85dd4c667d416ed2b14bc29a087fed7de284e8c9ef03f6
[debug] [2019-05-23T13:07:55.093Z] [uploadQueue] Retrying task 2dbe4b5cf4ff93e12e85dd4c667d416ed2b14bc29a087fed7de284e8c9ef03f6
[debug] [2019-05-23T13:08:08.748Z] [uploadQueue] Retrying task c5a39af308be34945cc9bf1f7801d59d913967d907feaa04cdcfdd914648e284
[debug] [2019-05-23T13:08:08.766Z] [uploadQueue] Retrying task 24fa10b7cd321052bf860176bd7abc6bb2a333142de1af050bdc3e77cc281c27
[debug] [2019-05-23T13:08:09.468Z] [uploadQueue] Retrying task 1d7f432fe7e0e56a5c910b0c2bb3598367e898c38576ea9db37495378aa6dc96
[debug] [2019-05-23T13:08:09.521Z] [uploadQueue] Retrying task 50de7bcab4906e111fee7e25d8794dcfb230ee831f09c6c8ebec4806abcaf136
[debug] [2019-05-23T13:08:11.179Z] [uploadQueue] Retrying task 232b02581515a51180a7f88422f33433c3b1ca06f46286b68752f8ef926d2ff4
[debug] [2019-05-23T13:08:11.713Z] [uploadQueue] Retrying task 592daea958cf457d6892259266cdba5f17d0694666dcc5d02b41d3edd8d962af
[debug] [2019-05-23T13:08:23.153Z] [uploadQueue] Retrying task 232b02581515a51180a7f88422f33433c3b1ca06f46286b68752f8ef926d2ff4
[debug] [2019-05-23T13:08:43.687Z] [uploadQueue] Retrying task 24fa10b7cd321052bf860176bd7abc6bb2a333142de1af050bdc3e77cc281c27
[debug] [2019-05-23T13:08:43.980Z] [uploadQueue] Retrying task 1d7f432fe7e0e56a5c910b0c2bb3598367e898c38576ea9db37495378aa6dc96
[debug] [2019-05-23T13:08:46.654Z] [uploadQueue] Retrying task 8b9f21408c4c9a4c6759997a8df0c71023103f4db8be4ebde9229e7ad9a8185b
[debug] [2019-05-23T13:08:53.480Z] [uploadQueue] Retrying task 5230dc6f9f127a0c2ef002fccd08c1d9a003728fc840caa91ca1b864790647dc
[debug] [2019-05-23T13:09:08.088Z] [uploadQueue] Retrying task c5a39af308be34945cc9bf1f7801d59d913967d907feaa04cdcfdd914648e284
[debug] [2019-05-23T13:09:14.520Z] [uploadQueue] Retrying task 232b02581515a51180a7f88422f33433c3b1ca06f46286b68752f8ef926d2ff4
[debug] [2019-05-23T13:09:15.144Z] [uploadQueue] Retrying task 592daea958cf457d6892259266cdba5f17d0694666dcc5d02b41d3edd8d962af
[debug] [2019-05-23T13:09:20.149Z] [uploadQueue] Retrying task 24fa10b7cd321052bf860176bd7abc6bb2a333142de1af050bdc3e77cc281c27
[debug] [2019-05-23T13:09:20.459Z] [uploadQueue] Retrying task 1d7f432fe7e0e56a5c910b0c2bb3598367e898c38576ea9db37495378aa6dc96
[debug] [2019-05-23T13:09:21.427Z] [uploadQueue] Retrying task 8b9f21408c4c9a4c6759997a8df0c71023103f4db8be4ebde9229e7ad9a8185b
[debug] [2019-05-23T13:09:28.553Z] [uploadQueue] Retrying task 5230dc6f9f127a0c2ef002fccd08c1d9a003728fc840caa91ca1b864790647dc
[debug] [2019-05-23T13:09:42.583Z] [uploadQueue] Retrying task 50de7bcab4906e111fee7e25d8794dcfb230ee831f09c6c8ebec4806abcaf136
[debug] [2019-05-23T13:09:44.503Z] [uploadQueue] Retrying task c5a39af308be34945cc9bf1f7801d59d913967d907feaa04cdcfdd914648e284
[debug] [2019-05-23T13:09:51.680Z] [uploadQueue] Retrying task 592daea958cf457d6892259266cdba5f17d0694666dcc5d02b41d3edd8d962af
[debug] [2019-05-23T13:09:55.209Z] [uploadQueue] Retrying task 2dbe4b5cf4ff93e12e85dd4c667d416ed2b14bc29a087fed7de284e8c9ef03f6
[debug] [2019-05-23T13:09:57.580Z] [uploadQueue] Retrying task 8b9f21408c4c9a4c6759997a8df0c71023103f4db8be4ebde9229e7ad9a8185b
[debug] [2019-05-23T13:09:59.278Z] [uploadQueue] Retrying task 24fa10b7cd321052bf860176bd7abc6bb2a333142de1af050bdc3e77cc281c27
[debug] [2019-05-23T13:09:59.511Z] [uploadQueue] Retrying task 1d7f432fe7e0e56a5c910b0c2bb3598367e898c38576ea9db37495378aa6dc96
[debug] [2019-05-23T13:10:01.164Z] [uploadQueue] Retrying task c5a39af308be34945cc9bf1f7801d59d913967d907feaa04cdcfdd914648e284
[debug] [2019-05-23T13:10:04.612Z] [uploadQueue] Retrying task 5230dc6f9f127a0c2ef002fccd08c1d9a003728fc840caa91ca1b864790647dc
[debug] [2019-05-23T13:10:09.899Z] [uploadQueue] Retries exhausted for task 1d7f432fe7e0e56a5c910b0c2bb3598367e898c38576ea9db37495378aa6dc96:
[debug] [2019-05-23T13:10:09.900Z] [hosting][upload queue][FINAL]
[debug] [2019-05-23T13:10:09.902Z] Error: socket hang up
    at createHangUpError (_http_client.js:342:15)
    at TLSSocket.socketOnEnd (_http_client.js:437:23)
    at emitNone (events.js:111:20)
    at TLSSocket.emit (events.js:208:7)
    at endReadableNT (_stream_readable.js:1064:12)
    at _combinedTickCallback (internal/process/next_tick.js:139:11)
    at process._tickDomainCallback (internal/process/next_tick.js:219:9)
[error] 
[error] Error: An unexpected error has occurred.

@tohagan
Copy link

tohagan commented May 23, 2019

I also noticed that it attempts to upload files it will display
hosting: uploading new files [0/9] 0%
Then timeout and FAIL.

Next ... when I retry this it thinks the last file succeeded so it now displays
hosting: uploading new files [0/8] 0% - decrements the number of files to upload to 8
Next when i retry this again it thinks the last file succeeded so it now displays
hosting: uploading new files [0/7] 0% - decrements the number of files to upload to 7

Which I suspect is incorrect since I really doubt that it succeeded to upload any files.

@thechenky
Copy link
Contributor

thechenky commented May 23, 2019

@tohagan @dreamhigh0822 Problems like this are typically caused by poor internet connectivity. Do you have issues running commands like firebase list?

similar issue internal reference: 63925427

@thechenky thechenky added Needs: Author Feedback Issues awaiting author feedback and removed Needs: Attention labels May 23, 2019
@top-talent0112
Copy link
Author

Thanks for your attention.
@thechenky No, I don't have any internet connectivity. firebase list is rather working properly.

This is the error case I have met.

dreamhigh@ubuntu:~/workspace/Gobot/gobot$ firebase deploy --only database,storage

=== Deploying to 'gobot-dev'...

i  deploying database, storage
i  database: checking rules syntax...
✔  database: rules syntax for database gobot-dev is valid
i  storage: checking storageRules.rules for compilation errors...
✔  storage: rules file storageRules.rules compiled successfully
i  storage: uploading rules storageRules.rules...
i  database: releasing rules...

Error: Server Error. socket hang up

The following is the case I have solved by myself.

dreamhigh@ubuntu:~/workspace/Gobot/gobot$ firebase deploy --only database,storage:gobot-dev

=== Deploying to 'gobot-dev'...

i  deploying database, storage
i  database: checking rules syntax...
✔  database: rules syntax for database gobot-dev is valid
i  storage: checking storageRules.rules for compilation errors...
✔  storage: rules file storageRules.rules compiled successfully
i  storage: uploading rules storageRules.rules...
i  database: releasing rules...
✔  database: rules for database gobot-dev released successfully
✔  storage: released rules storageRules.rules to firebase.storage/gobot-dev.appspot.com

✔  Deploy complete!

Project Console: https://console.firebase.google.com/project/gobot-dev/overview

As you can see the code snippet, I appended :projectID to the deploy command.

@google-oss-bot google-oss-bot added Needs: Attention and removed Needs: Author Feedback Issues awaiting author feedback labels May 24, 2019
@thechenky
Copy link
Contributor

Thanks for the reply @dreamhigh0822 it's still a bit odd to me that you had to do that. When you did not supply the project id the command still knew which project to deploy to. Do you have a lot of projects?

@thechenky thechenky added Needs: Author Feedback Issues awaiting author feedback and removed Needs: Attention labels May 24, 2019
@thechenky
Copy link
Contributor

@dreamhigh0822 can you attach a debug log as @bkendall suggested? It would help us figure out why adding :projectId makes the command succeed.

@top-talent0112
Copy link
Author

@thechenky No, I only have a project. So, I thought that if I used firebase usecommand, then it would use the project. But it didn't. Unless I didn't specify the id of the project explicitly, no matter what, it failed.
Sorry but for now I don't have the log file, since that I got my hand of that project.

@google-oss-bot google-oss-bot added Needs: Attention and removed Needs: Author Feedback Issues awaiting author feedback labels May 24, 2019
@thechenky
Copy link
Contributor

@dreamhigh0822 can you paste your .firebaserc here? I think it has your information there - the deploy without adding :projectId was still finding the project, so that's the part I'm confused about. If it was able to find the project, it should be able to deploy to it.

@thechenky thechenky added Needs: Author Feedback Issues awaiting author feedback and removed Needs: Attention labels May 24, 2019
@top-talent0112
Copy link
Author

@thechenky
I think you are right. The problem is this file configuration for the project.
There is already the default projectID in the file so that I have to provide my projectID to deploy it.
This is the .firebaserc content.

{
  "projects": {
    "default": "gobot-a5af4",
    "dev": "gobot-a5af4",
    "prod": "gobot-3e82e",
    "mu": "gobot-multiuser"
  }
}

Thanks.

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

No branches or pull requests

5 participants