Skip to content

Real-time collaboration not working - infinite loading #7

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

Open
tcarreira opened this issue Mar 18, 2021 · 55 comments
Open

Real-time collaboration not working - infinite loading #7

tcarreira opened this issue Mar 18, 2021 · 55 comments

Comments

@tcarreira
Copy link

Problem

When real-time collaboration is Off, everything seems to be working.
But after turning real-time collaboration On, after opening a file, the vscode just keeps loading indefinitely, showing that blue line at the top:

Screenshot_20210317_210750

More information

The logs don't seem to be relevant (for my eyes).
But the browser network tab is showing lots of 404 connecting firebase (real database removed):

Request URL: https://<DATABASE_NAME>.appspot.com/.lp?start=t&ser=38874610&cb=5&v=5&ns=<DATABASE_NAME>
Request Method: GET
Status Code: 404 

You may have noticed that https://<DATABASE_NAME>.appspot.com does not match the README (firebase-databaseURL: 'https://<DATABASE_NAME>.firebaseio.com').
I changed it because with the original I would get an error launching code-server :

[2021-03-18T00:29:29.934Z]  @firebase/database: FIREBASE WARNING: Firebase error. Please ensure that you spelled the name of your Firebase correctly (https://<DATABASE_NAME>.firebaseio.com) 

I got the "correct" server name from the Firebase console (storageBucket).

Am i missing any config?
Is this a bug or incomplete documentation?
I also read Firepad documentation which seems to say the same as you did.

Tested scenario

  • Web Browser: Firefox / Brave / Chromium
  • Local OS: Ubuntu 20.04.1 LTS
  • Remote OS: Ubuntu 20.04.1 LTS
  • Remote Architecture: amd64
  • code-server --version: 3.8.0 39fc66bd58ce4c9b5934a91caf5eaa0774706a3d
@tcarreira tcarreira changed the title Real-time collaboration - infinite loading Real-time collaboration not working - infinite loading Mar 18, 2021
@PxBCPG
Copy link

PxBCPG commented May 18, 2021

Got the same issue

@archiso7
Copy link

I also have the same issue...

@tcarreira
Copy link
Author

I would love to try to fix this myself, but I have no clue what to search for.
Any suggestions?

@archiso7
Copy link

@tcarreira I would think it might be the program looping between users.

@PxBCPG
Copy link

PxBCPG commented May 26, 2021

By the same issue, I think it is a problem with the database :
In the docs it is written:

firebase-authDomain: '<DATABASE_NAME>.firebaseapp.com'
firebase-databaseURL: 'https://<DATABASE_NAME>.firebaseio.com'

While Google Firebase gives you the same authDomain but you don't have .firebaseio.com for the databaseURL

@archiso7
Copy link

@PxBCPG if you make a database you will have a .firebaseio.com. I cant find a .firebaseapp.com though.

@archiso7
Copy link

@tcarreira I know what your problem is. the is the name of the database you create here:
image

@PxBCPG
Copy link

PxBCPG commented May 26, 2021

@PxBCPG if you make a database you will have a .firebaseio.com. I cant find a .firebaseapp.com though.

Not for me, got a .appspot.com instead of .firebaseio.com

@PxBCPG
Copy link

PxBCPG commented May 26, 2021

@tcarreira I know what your problem is. the is the name of the database you create here:
image

@archiso7 I don't have the same UI at all :
Screenshot 2021-05-26 at 18 47 46

@archiso7
Copy link

@tcarreira you have to click on build on the left side.

@archiso7
Copy link

@PxBCPG if you make a database you will have a .firebaseio.com. I cant find a .firebaseapp.com though.

Not for me, got a .appspot.com instead of .firebaseio.com

how did you get that?

@PxBCPG
Copy link

PxBCPG commented May 26, 2021

🤔

@PxBCPG
Copy link

PxBCPG commented May 26, 2021

I created a project, and then an app I think

@PxBCPG
Copy link

PxBCPG commented May 26, 2021

a web app, and then firebase gives me the configuration to apply, with this:

// For Firebase JS SDK v7.20.0 and later, measurementId is optional
const firebaseConfig = {
  apiKey: "",
  authDomain: "<DOMAIN>.firebaseapp.com",
  databaseURL: "https://<DOMAIN>.firebasedatabase.app",
  projectId: "<NAME>",
  storageBucket: "<DOMAIN>.appspot.com",
  messagingSenderId: "<>",
  appId: "1:<>:web:<>",
  measurementId: "<>"
};

@archiso7
Copy link

a web app, and then firebase gives me the configuration to apply, with this:

// For Firebase JS SDK v7.20.0 and later, measurementId is optional
const firebaseConfig = {
  apiKey: "",
  authDomain: "<DOMAIN>.firebaseapp.com",
  databaseURL: "https://<DOMAIN>.firebasedatabase.app",
  projectId: "<NAME>",
  storageBucket: "<DOMAIN>.appspot.com",
  messagingSenderId: "<>",
  appId: "1:<>:web:<>",
  measurementId: "<>"
};

ok, I will try this.

@archiso7
Copy link

archiso7 commented May 26, 2021

@PxBCPG do you set up firebase hosting for it as well or no?
Edit: I got the .firebaseapp.com. It still doesn't work :(

@PxBCPG
Copy link

PxBCPG commented May 26, 2021

Do you also get the .appspot.com as I ?

@archiso7
Copy link

archiso7 commented May 26, 2021

Do you also get the .appspot.com as I ?

@PxBCPG yes i do.
Edit: Sorry I read your comment wrong, I do get one but it is under storageBucket not databaseURL or domain.

@tcarreira
Copy link
Author

@tcarreira I know what your problem is. the is the name of the database you create here:
image

OMFG! That was it! thank you!!!!!
It works now (tested only locally)

I'll test it more when I get some time for that.

Thank you @archiso7

I will not close this issue yet.
Let me find out what did I do and check if there is some missing information on the README file

@archiso7
Copy link

@tcarreira I know what your problem is. the is the name of the database you create here:
image

OMFG! That was it! thank you!!!!!
It works now (tested only locally)

I'll test it more when I get some time for that.

Thank you @archiso7

I will not close this issue yet.
Let me find out what did I do and check if there is some missing information on the README file

That’s good, I still haven’t got it to work yet :(

@PxBCPG
Copy link

PxBCPG commented May 27, 2021

I didn't understand how did you fix the issue.
Can you help me ?

@tcarreira
Copy link
Author

tcarreira commented May 27, 2021

I didn't understand how did you fix the issue.
Can you help me ?

@PxBCPG

On https://console.firebase.google.com/, go to "Realtime database" and then create one, like this:
Screenshot_20210527_135414

I copied that string (shadowed with a red rectangle) and pasted in the config.yaml:

...
firebase-apiKey: '<FIREBASE_API_KEY>'
firebase-authDomain: '<FIREBASE_DATABASE_NAME>.firebaseapp.com'
firebase-databaseURL: 'https://<FIREBASE_DATABASE_NAME>.firebaseio.com'
firebase-ref: '<RANDOM_STRING>'
...

I used the same "red rectangle string" as FIREBASE_DATABASE_NAME (ie: I pasted it twice inside my config.yaml)

I can't fully remember how I got the FIREBASE_API_KEY but it should be in "Project Settings" > "Service accounts"

Let me know if that helps

@archiso7
Copy link

archiso7 commented May 27, 2021

I didn't understand how did you fix the issue.
Can you help me ?

@PxBCPG

On https://console.firebase.google.com/, go to "Realtime database" and then create one, like this:
Screenshot_20210527_135414

I copied that string (shadowed with a red rectangle) and pasted in the config.yaml:

...
firebase-apiKey: '<FIREBASE_API_KEY>'
firebase-authDomain: '<FIREBASE_DATABASE_NAME>.firebaseapp.com'
firebase-databaseURL: 'https://<FIREBASE_DATABASE_NAME>.firebaseio.com'
firebase-ref: '<RANDOM_STRING>'
...

I used the same "red rectangle string" as FIREBASE_DATABASE_NAME (ie: I pasted it twice inside my config.yaml)

I can't fully remember how I got the FIREBASE_API_KEY but it should be in "Project Settings" > "Service accounts"

Let me know if that helps

@tcarreira This is what I did but It didn't work.
Edit: I just checked again and still get the infinite loading.

@PxBCPG
Copy link

PxBCPG commented May 27, 2021

I didn't understand how did you fix the issue.
Can you help me ?

@PxBCPG

On https://console.firebase.google.com/, go to "Realtime database" and then create one, like this:
Screenshot_20210527_135414

I copied that string (shadowed with a red rectangle) and pasted in the config.yaml:

...
firebase-apiKey: '<FIREBASE_API_KEY>'
firebase-authDomain: '<FIREBASE_DATABASE_NAME>.firebaseapp.com'
firebase-databaseURL: 'https://<FIREBASE_DATABASE_NAME>.firebaseio.com'
firebase-ref: '<RANDOM_STRING>'
...

I used the same "red rectangle string" as FIREBASE_DATABASE_NAME (ie: I pasted it twice inside my config.yaml)

I can't fully remember how I got the FIREBASE_API_KEY but it should be in "Project Settings" > "Service accounts"

Let me know if that helps

I don't have the same thing at all:

Screen Shot 2021-05-27 at 17 41 03

@PxBCPG
Copy link

PxBCPG commented May 27, 2021

I don't have this firebaseio.com, but .firebasedatabase.app

@PxBCPG
Copy link

PxBCPG commented May 27, 2021

Used this :

firebase-apiKey: ''
firebase-authDomain: '.firebaseapp.com'
firebase-databaseURL: 'https://.firebasedatabase.app/'
firebase-ref: ‘’

And got this:
Screen Shot 2021-05-27 at 17 53 17

@archiso7
Copy link

@PxBCPG you should just be able to use the first part of the url and change the other parts to .firebaseio.com. Maybe.

@PxBCPG
Copy link

PxBCPG commented May 27, 2021

okay, let me try

@PxBCPG
Copy link

PxBCPG commented May 27, 2021

Get back to my previous state: I checked the logs, and here is what I get:

@firebase/database: FIREBASE WARNING: set at /‘<RANDOM_STRING’ failed: permission_denied

@archiso7
Copy link

Get back to my previous state: I checked the logs, and here is what I get:

@firebase/database: FIREBASE WARNING: set at /‘<RANDOM_STRING’ failed: permission_denied

Maybe an APIkey problem?

@PxBCPG
Copy link

PxBCPG commented May 27, 2021

Let me double-check !

@PxBCPG
Copy link

PxBCPG commented May 27, 2021

You find the APIkey in the project overview, under the settings, don't you ?

@PxBCPG
Copy link

PxBCPG commented May 27, 2021

Here is where I take most of my config:

Screen Shot 2021-05-27 at 18 22 44

@archiso7
Copy link

Here is where I take most of my config:

Screen Shot 2021-05-27 at 18 22 44

@PxBCPG You should be using the authDomain and databaseURL.

@archiso7
Copy link

@tcarreira did you create a child under your database?

@PxBCPG
Copy link

PxBCPG commented May 27, 2021

Here is where I take most of my config:
Screen Shot 2021-05-27 at 18 22 44

@PxBCPG You should be using the authDomain and databaseURL.

And the API key ?

@archiso7
Copy link

Here is where I take most of my config:
Screen Shot 2021-05-27 at 18 22 44

@PxBCPG You should be using the authDomain and databaseURL.

And the API key ?

yes

@archiso7
Copy link

@PxBCPG I just found this on the docs:
image

@PxBCPG
Copy link

PxBCPG commented May 27, 2021

Nice !
Then where is my error ?

@PxBCPG
Copy link

PxBCPG commented May 27, 2021

Okay, let me re-do everything from scratch

@archiso7
Copy link

@PxBCPG I DID IT.
you just have to make a child under your database!!

@archiso7
Copy link

never mind...
real time colab was disabled.

@PxBCPG
Copy link

PxBCPG commented May 27, 2021

Okay, got some progress here:

I edited some database rule which said read: false and write: false to true

But I still got the same error (Unable to open 'test.py': FIREBASE FATAL ERROR: Cannot parse Firebase url. Please use https://.firebaseio.com .)

@PxBCPG
Copy link

PxBCPG commented May 27, 2021

And it worked !

@PxBCPG
Copy link

PxBCPG commented May 27, 2021

Okay, let me understand what I did, and I get back to you in a few moment

@archiso7
Copy link

NICE

@PxBCPG
Copy link

PxBCPG commented May 27, 2021

Screenshot 2021-05-27 at 18 59 29

@archiso7
Copy link

YESS IT WORKED.(I checked to make sure colab was enabled this time :) )

@PxBCPG
Copy link

PxBCPG commented May 27, 2021

It is really necessary to update the README

@archiso7
Copy link

yep
I will and a pull request in a couple minutes.

@tcarreira
Copy link
Author

I'm glad you made it!!!
I was going crazy because yesterday I got it working, but now it wasn't anymore.

But I think it's working now :D

I'm creating a docker image for this, it's easier for me :)
I'll share it later

@archiso7
Copy link

I'm glad you made it!!!
I was going crazy because yesterday I got it working, but now it wasn't anymore.

But I think it's working now :D

I'm creating a docker image for this, it's easier for me :)
I'll share it later

Ok cool, I think you can close this issue now :)

@tcarreira
Copy link
Author

I could rename the issue to "Incomplete instructions for Firebase integration".
What do you think?

@archiso7
Copy link

archiso7 commented May 27, 2021

I could rename the issue to "Incomplete instructions for Firebase integration".
What do you think?

@tcarreira Sure, I'm currently working on a pull request to fix the readme

@Jerry080801
Copy link

I could rename the issue to "Incomplete instructions for Firebase integration".
What do you think?

@tcarreira Sure, I'm currently working on a pull request to fix the readme

Do we have the adapted version for latest code-server?

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

No branches or pull requests

4 participants