codesandbox-client icon indicating copy to clipboard operation
codesandbox-client copied to clipboard

Cannot create Github repo from a Sandbox `Not able to push sandbox to a remote repository`

Open guillempuche opened this issue 1 year ago • 15 comments

🐛 bug report

Preflight Checklist

  • [x] I have read the Contributing Guidelines for this project.
  • [x] I agree to follow the Code of Conduct that this project adheres to.
  • [x] I have searched the issue tracker for an issue that matches the one I want to file, without success.

Description of the problem

Signin via Github.

I create a project in CodeSandbox then try to create a repo on Github on my personal account.

The UI shows this error "Not able to push sandbox to a remote repository"

I debug the error on the browser console and get the following error.

ConvertToRepositoryForm.tsx:140 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'owner')
    at ConvertToRepositoryForm.tsx:140:28
    at s (runtime.js:63:40)
    at Generator._invoke (runtime.js:294:22)
    at Generator.next (runtime.js:119:21)
    at r (asyncToGenerator.js:3:20)
    at s (asyncToGenerator.js:25:9)
(anonymous) @ ConvertToRepositoryForm.tsx:140
s @ runtime.js:63
(anonymous) @ runtime.js:294
(anonymous) @ runtime.js:119
r @ asyncToGenerator.js:3
s @ asyncToGenerator.js:25
Promise.then (async)
r @ asyncToGenerator.js:13
s @ asyncToGenerator.js:25
(anonymous) @ asyncToGenerator.js:32
(anonymous) @ asyncToGenerator.js:21
(anonymous) @ ConvertToRepositoryForm.tsx:126
We @ react-dom.production.min.js:52
Ke @ react-dom.production.min.js:52
(anonymous) @ react-dom.production.min.js:53
Er @ react-dom.production.min.js:100
Pr @ react-dom.production.min.js:101
(anonymous) @ react-dom.production.min.js:113
je @ react-dom.production.min.js:292
(anonymous) @ react-dom.production.min.js:50
Mr @ react-dom.production.min.js:105
Jt @ react-dom.production.min.js:75
Zt @ react-dom.production.min.js:74
t.unstable_runWithPriority @ scheduler.production.min.js:18
Wa @ react-dom.production.min.js:122
Ie @ react-dom.production.min.js:292
Xt @ react-dom.production.min.js:73

At the end create a Github repo here, but without any file of the project. Only a Codesandbox template.

How has this issue affected you? What are you trying to accomplish?

Create a repo in Github from a project in CodeDandbox

To Reproduce

I try setting public, private, different repo names, but not luck.

I think is related to the system doesn't select the default Github organization or CodeSandbox workspace.

Captura de pantalla 2023-03-06 a les 19 08 11

Error line in the code: image

Link to sandbox: link (optional)

Your Environment

Software Name/Version
Сodesandbox c64c763
Browser Chrome
Operating System Macos

guillempuche avatar Mar 06 '23 18:03 guillempuche

I'm having this too

h5gq3 avatar Mar 08 '23 17:03 h5gq3

same here

ogheneovo12 avatar May 13 '23 18:05 ogheneovo12

I was able to create a repo one or two times from codesandbox's angular project a few days ago but after that I have been encountering this issue as well. After creating a codesandbox project and following through with "create repository" in codesandbox, the UI shows this error "Not able to push sandbox to a remote repository" and my github repo list shows that the repo was made but the code isn't there. just a readme. Browser: Chrome, OS: Win10, using the web codesandbox.

edit: noticed when selecting "Angular" (cloud) in codesandbox, it seems I can create github repo from codesandbox but the "Angular CLI" (cloud) I can't. I wanted an angular 15 project and not a 16 which the "Angular" (cloud) is by default and push the project to github but it seems I cannot until the issue is resolved.

ysk3a avatar May 27 '23 19:05 ysk3a

Have you solve it?

guillempuche avatar Nov 06 '23 16:11 guillempuche

Has anyone solved it ?

Sharan1617 avatar Nov 10 '23 23:11 Sharan1617

Same here today.

I get this on CodeSandbox:

image

And here's the generated empty project in my Github: https://github.com/samuelpath/json-candidates-ranker-marvin

samuelpath avatar Nov 30 '23 18:11 samuelpath

Got the exact same screen as samuelpath above

matt-scott avatar Dec 12 '23 17:12 matt-scott

Hello all,

I'm sorry to hear about the trouble you've been having trying to connect your Sandbox to a repository.

Please could you all go to your dashboard > Settings > Integrations and then remove and re-add your Github credentials?

This should refresh the relevant token and resolve the problem

JamesACS avatar Dec 13 '23 12:12 JamesACS

Thanks for the suggestion, James.

I removed and re-added my GitHub credentials but this did not resolve the issue. I still get the "Not able to push sandbox to remote repository" error. And an empty repository of the name I typed in is created in my GitHub account.

matt-scott avatar Dec 13 '23 17:12 matt-scott

Thanks @matt-scott -

Please could you contact us at [email protected] from the email associated with your account?

If you could also let us know whether you're trying to import a private or public repository in that email. That would be fantastic!

JamesACS avatar Dec 13 '23 18:12 JamesACS

Thank you everyone for your patience regarding this issue,

I've now been able to reproduce and find a work around on our end while we work on a longer term solution.

This only seems to happen when trying to link a Sandbox directly to a repository, if you use the 'Convert to Devbox' prompt in the top right and then connect the project to a repository, it will connect as expected.

Because our repositories run in the same type of environment as Devboxes, there is no change in the final result. This is just an extra step for the moment.

JamesACS avatar Dec 22 '23 12:12 JamesACS

This resolves the issue. Thanks James!

matt-scott avatar Jan 02 '24 17:01 matt-scott

Convert to Devbox

where is this option?

ndhola avatar Jan 06 '24 08:01 ndhola

i tried doing this, the repository is created but nothing is visible on browser

Snehal-Salunke2003 avatar Jan 25 '24 07:01 Snehal-Salunke2003

@Lakshyaultimate Please contact us at [email protected] with a link to the environment in question

JamesACS avatar Jan 25 '24 14:01 JamesACS