# Help! Stuck on Stage #RG2

**URL:** <https://forum.codecrafters.io/t/help-stuck-on-stage-rg2/176>\
**Category:** Challenges\
**Tags:** challenge:redis\
**Created:** [April 23, 2024, 8:07am UTC](https://forum.codecrafters.io/t/help-stuck-on-stage-rg2/176 "2024-04-23T08:07:24Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![shahfazz](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/shahfazz/32/155_2.png) [@shahfazz](https://forum.codecrafters.io/u/shahfazz)\
**Post date:** [April 23, 2024, 8:07am UTC](https://forum.codecrafters.io/t/help-stuck-on-stage-rg2/176/1 "2024-04-23T08:07:24Z")

</div>

I used the following code as shown in the video for Python.

```auto
# Uncomment this to pass the first stage
import socket

def main():
    # You can use print statements as follows for debugging, they'll be visible when running tests.
    print("Logs from your program will appear here!")

    pong = "+PONG\r\n"

    # Uncomment this to pass the first stage
    #
    server_socket = socket.create_server(("localhost", 6379), reuse_port=True)
    conn, addr = server_socket.accept() # wait for client

    with conn:
        conn.recv(1024)
        conn.send(pong.encode())

if __name__ == " __main__":
    main()

```

I get the following error:

```auto
remote: [stage-2] Running tests for Stage #2: Respond to PING
remote: [stage-2] $ ./spawn_redis_server.sh
remote: [your_program] Logs from your program will appear here!
remote: [stage-2] $ redis-cli ping
remote: [stage-2] Received: "" (no content received)
remote: [stage-2] ^ error
remote: [stage-2] Error: Expected start of a new RESP value (either +, -, :, $ or *)
remote: [stage-2] Test failed (try setting 'debug: true' in your codecrafters.yml to see more details)
remote: 
remote: Try our CLI to run tests faster without Git: https://codecrafters.io/cli
remote: 
remote: View stage instructions: https://app.codecrafters.io/courses/redis.
remote: 
To https://git.codecrafters.io/2ca2199afd4af9cb
   e751b5e..f9e6861 master -> master

```

---

<div class="post-metadata">

**Author:** ![rohitpaulk](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/rohitpaulk/32/6_2.png) [@rohitpaulk](https://forum.codecrafters.io/u/rohitpaulk)\
**Post date:** [April 23, 2024, 12:54pm UTC](https://forum.codecrafters.io/t/help-stuck-on-stage-rg2/176/2 "2024-04-23T12:54:36Z")

</div>

@shahfazz Is it possible that your changes aren’t committed before running git push? The code above looks fine to me 🤔

---

<div class="post-metadata">

**Author:** ![shahfazz](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/shahfazz/32/155_2.png) [@shahfazz](https://forum.codecrafters.io/u/shahfazz)\
**Post date:** [April 27, 2024, 8:08am UTC](https://forum.codecrafters.io/t/help-stuck-on-stage-rg2/176/3 "2024-04-27T08:08:02Z")

</div>

Thanks for the response @rohitpaulk

I ran the instruction again

> git add .  
> git commit --allow-empty -m “pass stage”  
> git push origin master

I get the following error-

> @shahfazz ➜ /workspaces/desktop-tutorial (main) $ git add .
> 
> git push origin master@shahfazz ➜ /workspaces/desktop-tutorial (main) $ git commit --allow-empty -m “pass stage”  
> [main 8be6864] pass stage  
> @shahfazz ➜ /workspaces/desktop-tutorial (main) $ git push origin master  
> error: src refspec master does not match any  
> error: failed to push some refs to ‘[https://github.com/shahfazz/desktop-tutorial](https://github.com/shahfazz/desktop-tutorial)’

---

<div class="post-metadata">

**Author:** ![rohitpaulk](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/rohitpaulk/32/6_2.png) [@rohitpaulk](https://forum.codecrafters.io/u/rohitpaulk)\
**Post date:** [April 27, 2024, 11:34pm UTC](https://forum.codecrafters.io/t/help-stuck-on-stage-rg2/176/4 "2024-04-27T23:34:47Z")

</div>

@shahfazz when you did the initial clone, you _should’ve_ gotten `master` as the branch. Looks like you’ve got `main` instead, based on your logs. Can you try switching to master?

Also, if you’re able to share how you ended up with `main` that’d be useful, maybe there’s a case we aren’t handling correctly.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/3X/7/0/700657133935c15703e22c7c8870394f6e6dc27d.svg) [@system](https://forum.codecrafters.io/u/system)\
**Post date:** [May 4, 2024, 1:18pm UTC](https://forum.codecrafters.io/t/help-stuck-on-stage-rg2/176/5 "2024-05-04T13:18:24Z")

</div>

Closed on May 4, 2024, 1:18pm UTC

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/3X/7/0/700657133935c15703e22c7c8870394f6e6dc27d.svg) [@system](https://forum.codecrafters.io/u/system)\
**Post date:** [June 4, 2024, 3:44am UTC](https://forum.codecrafters.io/t/help-stuck-on-stage-rg2/176/6 "2024-06-04T03:44:01Z")

</div>

Note: I’ve updated the title of this post to include the stage ID (#RG2). You can learn about the stages rename here: [Upcoming change: Stages overhaul](https://forum.codecrafters.io/t/upcoming-change-stages-overhaul/375).
