cs50/submit50

Submit50 can't connect to Github

Closed this issue · 19 comments

I managed to create a virtual environment on Ubuntu, which is inside my Windows 10 (using WSL). I installed everything I needed, finished my project and already logged in on my Github account and I can do git push and pull.

I installed submit50 to make it easier to submit, but it always gives me the following error:

(env) edumats@DESKTOP-U5KI5JG:/mnt/c/Users/ponei/OneDrive/Documentos/CS50/books/virtual-books/cs50-books$ submit50 web50/projects/2019/x/1
Connecting..........
Could not connect to GitHub, it seems you are offline. Submission cancelled.

same issue here, can't connect to Github

@edumats @Olfredos6 are you able to reach github.com from your terminal if you run ping github.com for example? What output do you get if you add --verbose to the submit50 command and try again?

Faaab commented

I have had the same issue using Ubuntu 18.04 on WSL.
When I ping github.com from the same environment, everything works fine with minimal lag (~30-50 ms delay).
Running submit50 --verbose ai50/projects/2020/x/degrees in my project repo resulted in the following output:

Connecting...                                                                                                           
Could not connect to GitHub, it seems you are offline.                                                                  
Traceback (most recent call last):                                                                                        
File "/home/fabian/.local/lib/python3.7/site-packages/lib50/_api.py", line 578, in _get_branches                          
    output = child.read().strip().split("\r\n")                                                                           
File "/home/fabian/.local/lib/python3.7/site-packages/pexpect/spawnbase.py", line 444, in read                            
    self.expect(self.delimiter)                                                                                           
File "/home/fabian/.local/lib/python3.7/site-packages/pexpect/spawnbase.py", line 344, in expect                          
    timeout, searchwindowsize, async_)                                                                                    
File "/home/fabian/.local/lib/python3.7/site-packages/pexpect/spawnbase.py", line 372, in expect_list                     
    return exp.expect_loop(timeout)                                                                                       
File "/home/fabian/.local/lib/python3.7/site-packages/pexpect/expect.py", line 181, in expect_loop                        
    return self.timeout(e)                                                                                                
File "/home/fabian/.local/lib/python3.7/site-packages/pexpect/expect.py", line 144, in timeout                            
    raise exc                                                                                                           

pexpect.exceptions.TIMEOUT: Timeout exceeded.                                                                           
<pexpect.pty_spawn.spawn object at 0x7f309040bba8>                                                                      
command: /usr/bin/git                                                                                                   
args: [b'/usr/bin/git', b'ls-remote', b'--heads', b'https://github.com/ai50/projects']                                  
buffer (last 100 chars): ''                                                                                             
before (last 100 chars): ''                                                                                             
after: <class 'pexpect.exceptions.TIMEOUT'>                                                                             
match: None                                                                                                             
match_index: None                                                                                                       
exitstatus: None                                                                                                        
flag_eof: False                                                                                                         
pid: 642                                                                                                                
child_fd: 7                                                                                                             
closed: False                                                                                                           
timeout: 3                                                                                                              
delimiter: <class 'pexpect.exceptions.EOF'>                                                                             
logfile: None                                                                                                           
logfile_read: <lib50._api._StreamToLogger object at 0x7f309040b6a0>                                                     
logfile_send: None                                                                                                      
maxread: 2000                                                                                                           
ignorecase: False                                                                                                       
searchwindowsize: None                                                                                                  
delaybeforesend: 0.05                                                                                                   
delayafterclose: 0.1                                                                                                    
delayafterterminate: 0.1                                                                                                
searcher: searcher_re:                                                                                                      
        0: EOF                                                                                                                                                                                                                                      

During handling of the above exception, another exception occurred:            
                                                                                                                                                                 
Traceback (most recent call last):                                                                                        
File "/home/fabian/.local/lib/python3.7/site-packages/lib50/_api.py", line 540, in __init__                               
    branches = self._get_branches()                                                                                      
File "/home/fabian/.local/lib/python3.7/site-packages/lib50/_api.py", line 583, in _get_branches                          
    raise TimeoutError(3)                                                                                               
lib50._errors.TimeoutError: 3                                                                                                                                                                                                                   

During handling of the above exception, another exception occurred:            
                                                                                                                                                                 
Traceback (most recent call last):                                                                                        
File "/home/fabian/.local/bin/submit50", line 8, in <module>                                                              
    sys.exit(main())                                                                                                      
File "/home/fabian/.local/lib/python3.7/site-packages/submit50/__main__.py", line 147, in main                            
    user_name, commit_hash, message = lib50.push("submit50", args.slug, CONFIG_LOADER, prompt=prompt)                     
File "/home/fabian/.local/lib/python3.7/site-packages/lib50/_api.py", line 66, in push                                    
    remote, (included, excluded) = connect(slug, config_loader)                                                           
File "/home/fabian/.local/lib/python3.7/site-packages/lib50/_api.py", line 221, in connect                                
    config_yaml = fetch_config(slug)                                                                                      
File "/home/fabian/.local/lib/python3.7/site-packages/lib50/_api.py", line 358, in fetch_config                           
    slug = Slug(slug)                                                                                                     
File "/home/fabian/.local/lib/python3.7/site-packages/lib50/_api.py", line 543, in __init__                               
    raise ConnectionError("Could not connect to GitHub, it seems you are offline.")                                     
lib50._errors.ConnectionError: Could not connect to GitHub, it seems you are offline.                                   
Submission cancelled.                      

Thanks a lot for the help!

I cannot access this branch on my git terminal

Hi, getting the same issue Could not connect to GitHub, it seems you are offline., with the same stack trace as above (TIMEOUT EXCEEDED after 3s) on Ubuntu 18.04 LTS (not WSL).

I am able to ping github.com and curl github.com, and moreover I am able to run git ls-remote --heads https://github.com/web50/projects (which is the command that fails to execute in the script); is there a way we can submit our homework by hand? I can't find instructions for pushing a solitary, non-repository folder to a remote git branch.

I'm unable to replicate this on WSL. What's the output of these commands:

pip3 show lib50 submit50
git --version

degrees

@oohmygaud you should be able to submit by pushing the required files to a branch with the same name as the identifier after submit50 in the spec. For example, hello in CS50x 2020 should be pushed to cs50/problems/2020/x/hello.

Sorry for the late reply. I posted this last year and I have forgot about it. At the time I manually submitted my project.

I have found that I wrongly created python's virtual environment inside my project folder. I didn't see this as a problem because I could use .gitignore to ignore it, but submit50 tries to submit all the files and folders that are inside the project folder. As the virtualenv folders contains a huge number of files, I think submit50 timeout and returns a offline error message. If i use the --verbose option, it shows all the files and submits.

I moved out the virtualenv folder and tried to submit50 just the project files, it worked perfectly.

I closed the issue, as I could send my files using submit50, but today I encountered the same problem again. I tried to ping a website (also github.com afterwards) and it keeps running, no packets are being received. But when I added the --verbose at the end, it submitted (!?) and I tried again without --verbose and now it submits. Very strange.

Here is my terminal:

edumats@DESKTOP-U5KI5JG:/mnt/c/Users/ponei/CS50AI/degrees$ submit50 ai50/projects/2020/x/degrees
Connecting..........
Could not connect to GitHub, it seems you are offline.
Submission cancelled.
edumats@DESKTOP-U5KI5JG:/mnt/c/Users/ponei/CS50AI/degrees$ ping uol.com.br
PING uol.com.br (200.147.35.149) 56(84) bytes of data.
^C
--- uol.com.br ping statistics ---
50 packets transmitted, 0 received, 100% packet loss, time 49651ms

edumats@DESKTOP-U5KI5JG:/mnt/c/Users/ponei/CS50AI/degrees$ submit50 ai50/projects/2020/x/degrees --verbose
Connecting...
Authenticating...
INFO:lib50._api:git credential fill
GitHub username:
GitHub password:
INFO:lib50._api:git -c credentialcache.ignoresighup=true credential approve
Verifying...
INFO:lib50._api:git clone --bare https://edumats@github.com/me50/edumats .git
Preparing...
INFO:lib50._api:git config --bool core.bare false
INFO:lib50._api:git config --path core.worktree /tmp/tmp8kqiptss
INFO:lib50._api:git checkout --force ai50/projects/2020/x/degrees .gitattributes
INFO:lib50._api:git config user.email edumats@users.noreply.github.com
INFO:lib50._api:git config user.name edumats
INFO:lib50._api:git symbolic-ref HEAD refs/heads/ai50/projects/2020/x/degrees
INFO:lib50._api:git add -f util.py degrees.py
Files that will be submitted:
./util.py
./degrees.py
Files that won't be submitted:
./small/stars.csv
./pycache/util.cpython-37.pyc
./small/favicon.png
./large/people.csv
./small/movies.csv
./small/people.csv
./pycache/util.cpython-36.pyc
./large/stars.csv
./large/movies.csv
Keeping in mind the course's policy on academic honesty, are you sure you want to submit these files (yes/no)? yes
Uploading...
INFO:lib50._api:git commit -m 'automated commit by submit50 ' --allow-empty
INFO:lib50._api:git push origin ai50/projects/2020/x/degrees
INFO:lib50._api:git rev-parse HEAD
Go to https://submit.cs50.io/users/edumats/ai50/projects/2020/x/degrees to see your results.
edumats@DESKTOP-U5KI5JG:/mnt/c/Users/ponei/CS50AI/degrees$ submit50 ai50/projects/2020/x/degrees
Connecting.......
Authenticating.....
Verifying....................................
Preparing......
Files that will be submitted:
./degrees.py
./util.py
Files that won't be submitted:
./small/movies.csv
./large/stars.csv
./pycache/util.cpython-36.pyc
./small/favicon.png
./large/movies.csv
./small/people.csv
./pycache/util.cpython-37.pyc
./small/stars.csv
./large/people.csv
Keeping in mind the course's policy on academic honesty, are you sure you want to submit these files (yes/no)?

Since it had been a very long time, I had the same issue, and writing --verbose also worked.

--verbose also is not working for me

--verbose also is not working for me

Please try running submit50 --log-level=debug SUBMISSION_SLUG where you would replace SUBMISSION_SLUG with the actual submission slug for a problem set.

I'm having issues with check50 and submit50 both initally returning
Could not connect to GitHub, it seems you are offline. and
Could not connect to GitHub, it seems you are offline.
Submission cancelled.

ping github.com
31 packets transmitted, 31 received, 0% packet loss, time 34132ms
rtt min/avg/max/mdev = 30.919/33.736/75.563/7.789 ms

any ideas?

I'm having issues with check50 and submit50 both initally returning Could not connect to GitHub, it seems you are offline. and Could not connect to GitHub, it seems you are offline. Submission cancelled.

ping github.com 31 packets transmitted, 31 received, 0% packet loss, time 34132ms rtt min/avg/max/mdev = 30.919/33.736/75.563/7.789 ms

any ideas?

On what platform did you run submit50? Please email sysadmins@cs50.harvard.edu regarding this issue.

I am on ubuntu 22.04 LTS using vscode.
I'll email sysadmins@cs50.harvard.edu!
thanks for your help!!

oh no, I am having the same problem here:
"""
...% submit50 ai50/projects/2023/x/knights
Connecting..........
Could not connect to GitHub, it seems you are offline.
Submission cancelled.
"""

I had done two submissions before, using the same method. It always stucks here... but I can't remember how I solve this problem before...
I did this:

  1. Just refresh the browser to make sure I stay "logged in" on GitHub...
  2. Maybe at some point, VSCode or my Mac do realize it has been "connected to GitHub" ...
  3. Try submit50 + code again
  4. Loop 1 - 2 - 3 again... until done

Uhhhhh its so stupid. I am now having this problme AGAIN... Anyone can help?

the 3rd submission done,
now, update my solving process:

  1. in VSCode terminal board, cd to the project directory, run 'pip3 install --upgrade submit50'
    (even though i know i'll have many lines of "Requirement already satisfied:xxx")
  2. run "cd [my project directory]" again (maybe no need but just make me feel safe)
  3. run "submit50 + slug code " again
  4. it works

Hi am duffour have tried submiting test but i am not able to send my work on submit.cs50.io, how do i go about it any help?

Hi am duffour have tried submiting test but i am not able to send my work on submit.cs50.io, how do i go about it any help?

Best to ask questions in any of https://cs50.harvard.edu/x/communities/!