cs50 / ide-issues

1 stars 1 forks source link

All new files are gone #2

Closed magedrifaat closed 5 years ago

magedrifaat commented 5 years ago

What symptom did you see (attaching screenshots as necessary)?

All my files disappeared, the file tree became empty as new.

When date and time (UTC) did the problem happen?

January, 19, 2019, 08:44 PM

What steps did you follow to reproduce the problem?

I am not able reproduce the problem but here is what happened exactly: I had a couple of C files saved and compiled, I was working on a file which wasn't saved since it was created. I deleted everything in the file to start over but my internet went down and the IDE started trying to reconnect. I pressed reconnect a couple of times and then refreshed and noticed that the internet is down. After connecting again I refreshed and I got to a page with a button to login using GitHub (the page I first got when i started beta testing) and when i clicked it the IDE loaded with the welcome page open and no files at all in the file tree.

Which web browser did you use (including version number)?

Google Chrome Version 71.0.3578.98 (Official Build) (64-bit)

Which operating system did you use (including version number)?

Windows 10 pro Version: 1803, OS build: 17134.472

Did you log in to CS50 IDE using the same GitHub account you used to create this issue?

Yes

09jlardinois commented 5 years ago

Reporting same issue.

magedrifaat commented 5 years ago

So after some time I opened the IDE again and got to the same page of "sign in using GitHub" and now the files are back. Also i can reach the commands i entered in the terminal before the incident so it seems the IDE is at the same state it was before all of that happened. There are two weird things though, After the problem happened i created a file and now it is not there (I don't care about it just stating the facts). The other thing is, when the files were gone I found a FAQ on cloud9 website saying that i can restore files using a file named collab.db under a folder named with a number specific for the IDE. I found that file and it was of no help. But the weird thing is that now, there is two folders of this description each has its own string number which implies there is two different signatures for the IDE. But this is just a guess and I thought it might help.

kzidane commented 5 years ago

Thanks for reporting the issue, @magedrifaat and @09jlardinois! I just looked at the logs and I didn't notice anything that might have caused this problem but I just ran into it and when I looked closely at what was going on I found out that it may be a Docker issue whereby even though my user data volume seemed to be mounted into the container, it wasn't.

$ docker inspect -f '{{ .Mounts }}' `docker ps -qn1`
[{bind  /mnt/usrvol /home/ubuntu   true rprivate}]
$ ls /mnt/usrvol/
bar  baz  foo
$ docker exec `docker ps -qn1` ls /home/ubuntu
quuux

I will need to do more investigation before I know for sure and to see if there are any workarounds. In the meantime, please let me know if you run into it again or managed to find a way to replicate. I'll keep you posted here.

Thank you!

magedrifaat commented 5 years ago

It ran into it again but shortly after that the files were back. I think these folders are increasing, is this normal? capture

kzidane commented 5 years ago

Okay, I think I may have found the cause of the problem. It seems that there's a race condition somewhere and /mnt/usrvol/ is actually mounted into the container before the user's volume is mounted to /mnt/usrvol/. I'll deploy a fix later today or tomorrow and let you know.

Thanks!

kzidane commented 5 years ago

PS, tbh I'm not quite sure yet whether it's okay to have more than one of these. Ideally you should have just one but they belong to Cloud9 and they would have a better idea of whether this might have any downsides. I'll reach out to them and let you know.

kzidane commented 5 years ago

I just deployed an update that should hopefully fix this issue. Please let us know or leave a comment if you run into it again.