ionic-cli icon indicating copy to clipboard operation
ionic-cli copied to clipboard

ionic upload 403 error

Open james-andrewsmith opened this issue 12 years ago • 70 comments

As described on the forum (http://forum.ionicframework.com/t/forbidden-upload-during-ionic-package/9712)

There appears to be an error with the upload process.

Not sure if it's relevant but I found the ionic.project file has a blank app_id (even when specified on start), judging by the code that could be causing the URL created to have some issues?

Not sure what a valid app_id looks like so I couldn't test a manual fix.

james-andrewsmith avatar Sep 22 '14 14:09 james-andrewsmith

Also getting this; furthermore, logging into the forums fails with 'Unknown Error', so I can't really report it there.

$ ionic upload

Uploading app...
Forbidden upload (403) (CLI v1.2.5)

chrisb avatar Sep 22 '14 22:09 chrisb

Digging into this a bit more, it appears the 403 is related to Django's CSRF protection.

The response contains:

  <h1>Forbidden <span>(403)</span></h1>
  <p>CSRF verification failed. Request aborted.</p>
  ...
  <p>Reason given for failure:</p>
    <pre>
    CSRF token missing or incorrect.
    </pre>

chrisb avatar Sep 22 '14 22:09 chrisb

Looking into this even further, the CLI script appears to reference the first cookie in the ~/.ionic/cookies.data cache which in my case was pointing to a CloudFlare cookie (__cfduid) instead of the csrfmiddlewaretoken cookie the script was expecting.

The same code appears in the package script as well.

Nuking the __cfduid cooke from the cache seemed to get me past the 403 error, but now the response is:

{"errors": ["\"'note'\""], "new_app": true}

chrisb avatar Sep 22 '14 23:09 chrisb

Adding "form.append('note', 'project note');" gets me past the note error. I am now getting { errors: [ 'null value in column "app_file" violates not-null constraint\nDETAI L: Failing row contains (690, null, 2014-09-28 00:57:34.076137+00, 2014-09-28 0 0:57:34.076167+00, Testingasdf23409asdf, 447ef0b1, 5433, testingasdf23409asdf).
n' ], new_app: true }

andymac4182 avatar Sep 28 '14 00:09 andymac4182

I get the same error:

$ ionic upload Uploading app... Forbidden upload (403) (CLI v1.2.5)

Also with clean install of app ($ ionic start ...)

yankustefan avatar Sep 29 '14 11:09 yankustefan

This was also reported on the forum: http://forum.ionicframework.com/t/forbidden-upload-during-ionic-package/9712/5

nhunsaker avatar Sep 29 '14 16:09 nhunsaker

Stay tuned, this is a hidden thing we pulled for the short term and will be relaunching soon!

On Mon, Sep 29, 2014 at 11:06 AM, nhunsaker [email protected] wrote:

This was also reported on the forum: http://forum.ionicframework.com/t/forbidden-upload-during-ionic-package/9712/5

— Reply to this email directly or view it on GitHub https://github.com/driftyco/ionic-cli/issues/115#issuecomment-57184612.

Max Lynch CEO and Co-founder http://ionicframework.com/

mlynch avatar Sep 29 '14 16:09 mlynch

@mlynch is there any ETA?

chrisb avatar Sep 29 '14 16:09 chrisb

How soon? I was looking to recommend this to replace Telerik Appbuilder for some of our applications and a good way to prototype internal apps.

andymac4182 avatar Sep 30 '14 09:09 andymac4182

Yes please how soon?, sorry for the presure :-)

querof avatar Sep 30 '14 19:09 querof

Yes please how soon?, sorry for the presure :-)

querof avatar Sep 30 '14 19:09 querof

We should have this fixed early next week, just finishing up some changes!

mathamoz avatar Oct 03 '14 22:10 mathamoz

Great news :) Can't wait to give it a go.

andymac4182 avatar Oct 03 '14 22:10 andymac4182

Got an update today…

At least the error has changed now…

Uploading app...
Error upload response: SyntaxError: Unexpected token < (CLI v1.2.7)

mmoscosa avatar Oct 04 '14 05:10 mmoscosa

Hey Martin,

We are putting the finishing touches on a ton of stuff right now, things will be working in the near future!

On Oct 4, 2014, at 12:13 AM, Martin Moscosa [email protected] wrote:

Got an update today…

At least the error has changed now…

Uploading app... Error upload response: SyntaxError: Unexpected token < (CLI v1.2.7) — Reply to this email directly or view it on GitHub.

mlynch avatar Oct 04 '14 05:10 mlynch

Hey @mlynch

I can see the progress and am becoming a big advocate of your product and always eager to see new features!

I am indeed much excited about this functionality working already

Kudos

mmoscosa avatar Oct 04 '14 05:10 mmoscosa

Seems to be working now :)

andymac4182 avatar Oct 11 '14 10:10 andymac4182

Still not working for me, I'm still getting : Forbidden upload (403) (CLI v1.2.7)

BarryReid avatar Oct 11 '14 23:10 BarryReid

New app is under review. We will announce when it's available for everyone

On Sat, Oct 11, 2014 at 4:58 PM, Barry Reid [email protected] wrote:

Still not working for me, I'm still getting : Forbidden upload (403) (CLI v1.2.7)

— Reply to this email directly or view it on GitHub https://github.com/driftyco/ionic-cli/issues/115#issuecomment-58768821.

Max Lynch CEO and Co-founder http://ionicframework.com/

mlynch avatar Oct 12 '14 00:10 mlynch

OK great, so I take it the Forbidden upload (403) message will go away once the app is released by apple and you turn the servers on on your end?

BarryReid avatar Oct 12 '14 00:10 BarryReid