Unable to upload snapshot

I’ve recently upgraded ionic cli to latest version 3.4.0 and all of sudden the command ionic upload no longer working. It kept saying Authentication Failed even though I already logged on using ionic login so many time.

Not sure what is going on. Anyone experienced the same issue and how did you go to resolve it?

global packages:

    @ionic/cli-utils : 1.4.0
    Cordova CLI      : 7.0.1
    Ionic CLI        : 3.4.0

local packages:

    @ionic/app-scripts              : 1.3.7
    @ionic/cli-plugin-cordova       : 1.4.0
    @ionic/cli-plugin-ionic-angular : 1.3.1
    Cordova Platforms               : android 6.2.3
    Ionic Framework                 : ionic-angular 3.2.1

System:

    Node       : v6.9.1
    OS         : Windows 10
    Xcode      : not installed
    ios-deploy : not installed
    ios-sim    : not installed
    npm        : 5.0.3

Further note when I run ionic upload --note 'testing'

Further note when I run ionic upload --note 'testing'


Requesting snapshot upload - failed!
Request: POST https://api.ionic.io/deploy/snapshots
Response: 401
Body:
{ link: null,
  type: 'Unauthorized',
  message: 'Authentication failed' }

What is the output if you ionic login?

There is a file somewhere called .ionic or similar that contains a Cookie or Session or something from the login. Look for it and delete or clear it to reset. (Sorry that I can’t be more specific, don’t remember the details.)

Thanks @Sujan12 for your input. Here is my output

D:\workspace\property-tools>ionic login
[WARN] You are already logged in as xxxxxxxxxx ! Prompting for new credentials.
? Email: xxxxxxxxxxx
? Password: [hidden]
[OK] You are logged in!

I need to find that .ionic file and remove it then. It looks like it is being cached somewhere.
I’m surprised that there is not any ionic logout command

(For me it was a folder at C:\Users\username\.ionic with 3 files in it - removing them should reset everything to as new)

1 Like

@Sujan12 you’re a STAR !!! I found it and removed the file, then login again. It works perfectly now.

Many thanks for your help :heart_eyes:

1 Like

The solution was just to simply re-link the application with ionic link

1 Like