Uploaded image for project: 'Appcelerator CLI'
  1. Appcelerator CLI
  2. CLI-1169

TypeError: Data must be a string or a buffer thrown when running commands if sid is undefined in config

    Details

    • Type: Bug
    • Status: Closed
    • Priority: None
    • Resolution: Fixed
    • Affects Version/s: Release 6.1.0
    • Fix Version/s: Release 6.2.0
    • Component/s: Core
    • Labels:
      None
    • Environment:

      OSX 10.11.6
      Node 6.9.5
      Appc

      {"NPM":"4.2.8","CLI":"6.1.0"}
    • Severity:
      Major
    • Story Points:
      1
    • Sprint:
      2017 Sprint 06 Tooling

      Description

      Description

      To fix this delete your appc-cli.json and login again, using preproduction not preprod

      When running commands I am seeing the following error get thrown TypeError: Data must be a string or a buffer thrown when running commands, full stacktrace below. The error is coming from this line

      The CLI is calling config.get('sid') which has somehow gone walkabouts from my config so it is undefined, I believe this is during the appc config set defaultEnvironment step below.

      2017-03-15T23:05:46.895Z | ERROR  | An uncaught exception was thrown!
      Data must be a string or a buffer
      2017-03-15T23:05:46.895Z | ERROR  | Data must be a string or a buffer
      2017-03-15T23:05:46.897Z | TRACE  | TypeError: Data must be a string or a buffer
          at TypeError (native)
          at Hash.update (crypto.js:74:16)
          at config (/Users/eharris/.appcelerator/install/6.1.0/package/lib/commands/config.js:158:13)
          at getSessionEntitlements (/Users/eharris/.appcelerator/install/6.1.0/package/lib/constants.js:221:51)
          at Object.setEnvironment (/Users/eharris/.appcelerator/install/6.1.0/package/lib/constants.js:326:42)
          at executeCommand (/Users/eharris/.appcelerator/install/6.1.0/package/lib/core.js:406:23)
          at Object.checkLogin (/Users/eharris/.appcelerator/install/6.1.0/package/lib/core.js:385:9)
          at Command.<anonymous> (/Users/eharris/.appcelerator/install/6.1.0/package/bin/commands/login.js:26:14)
          at Command.<anonymous> (/Users/eharris/.appcelerator/install/6.1.0/package/lib/commander.js:102:13)
          at Command.listener (/Users/eharris/.appcelerator/install/6.1.0/package/node_modules/commander/index.js:301:8)
      

      Steps to reproduce
      1. Switch to production appc logout && appc config set defaultEnvironment production && appc login
      2. Switch back to preproduction appc logout && appc config set defaultEnvironment preproduction && appc login
      3. appc config set defaultEnvironment preprod
      4. appc whoami/appc login
      Actual result

      Above error is thrown

      Expected result

      Error not thrown

        Attachments

          Activity

            People

            • Assignee:
              fmiao Feon Sua Xin Miao
              Reporter:
              eharris Ewan Harris
              Reviewer:
              Ewan Harris
            • Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Git Source Code