Skip to content

TypeError: Cannot read property 'toString' of null #72

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ceefour opened this issue Aug 29, 2017 · 3 comments
Closed

TypeError: Cannot read property 'toString' of null #72

ceefour opened this issue Aug 29, 2017 · 3 comments

Comments

@ceefour
Copy link

ceefour commented Aug 29, 2017

sls deploy -v

Serverless: Parsing Python requirements.txt
Serverless: Installing required Python packages for runtime python3.6...

  Type Error ---------------------------------------------

  Cannot read property 'toString' of null

     For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.

  Stack Trace --------------------------------------------

TypeError: Cannot read property 'toString' of null
    at BbPromise (C:\Users\ceefour\git\node_modules\serverless-python-requirements\index.js:98:30)
    at ServerlessPythonRequirements.installRequirements (C:\Users\ceefour\git\node_modules\serverless-python-requirements\index.js:
86:12)
    at ServerlessPythonRequirements.packRequirements (C:\Users\ceefour\git\node_modules\serverless-python-requirements\index.js:135
:17)
From previous event:
    at PluginManager.invoke (C:\Users\ceefour\AppData\Roaming\npm\node_modules\serverless\lib\classes\PluginManager.js:242:22)
    at PluginManager.spawn (C:\Users\ceefour\AppData\Roaming\npm\node_modules\serverless\lib\classes\PluginManager.js:254:17)
    at Deploy.BbPromise.bind.then.then (C:\Users\ceefour\AppData\Roaming\npm\node_modules\serverless\lib\plugins\deploy\deploy.js:1
01:50)
From previous event:
    at Object.before:deploy:deploy [as hook] (C:\Users\ceefour\AppData\Roaming\npm\node_modules\serverless\lib\plugins\deploy\deplo
y.js:99:10)
    at BbPromise.reduce (C:\Users\ceefour\AppData\Roaming\npm\node_modules\serverless\lib\classes\PluginManager.js:242:55)
From previous event:
    at PluginManager.invoke (C:\Users\ceefour\AppData\Roaming\npm\node_modules\serverless\lib\classes\PluginManager.js:242:22)
    at PluginManager.run (C:\Users\ceefour\AppData\Roaming\npm\node_modules\serverless\lib\classes\PluginManager.js:261:17)
    at variables.populateService.then (C:\Users\ceefour\AppData\Roaming\npm\node_modules\serverless\lib\Serverless.js:99:33)
    at runCallback (timers.js:672:20)
    at tryOnImmediate (timers.js:645:5)
    at processImmediate [as _immediateCallback] (timers.js:617:5)
From previous event:
    at Serverless.run (C:\Users\ceefour\AppData\Roaming\npm\node_modules\serverless\lib\Serverless.js:86:74)
    at serverless.init.then (C:\Users\ceefour\AppData\Roaming\npm\node_modules\serverless\bin\serverless:39:50)

  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Forums:        forum.serverless.com
     Chat:          gitter.im/serverless/serverless

  Your Environment Information -----------------------------
     OS:                     win32
     Node Version:           6.11.2
     Serverless Version:     1.20.2

requirements.txt:

psycopg2 #no-deploy
requests
-e git+https://github.com/mobolic/facebook-sdk.git#egg=facebook-sdk
pyjwt
@dschep
Copy link
Contributor

dschep commented Aug 29, 2017

Could you try 3.0.0-beta.2? It has better error handling around calling pip and allows you to specify a python binary which I think is required for this plugin to work on windows (IIRC there isn't a python3.6.exe in the windows install of Python).

@candlerb
Copy link

candlerb commented Sep 3, 2017

I got the same error Cannot read property 'toString' of null with ubuntu 16.04, which has python3 and python3.5 but no python3.6

Upgraded like this:

npm install https://github.com/UnitedIncome/serverless-python-requirements/tarball/v3.0.0-beta.3

Next attempt:

$ SLS_DEBUG=1 serverless deploy -v
Serverless: Installing required Python packages for runtime python3.6...

  Error --------------------------------------------------

  python3.6 not found! Try the pythonBin option.

OK, at least that's clear, so I added

custom:
  pythonRequirements:
    pythonBin: /usr/bin/python3

Next error:

$ SLS_DEBUG=1 serverless deploy -v
Serverless: Installing required Python packages for runtime python3.6...

  Error --------------------------------------------------

  /usr/bin/python3: No module named pip

Solution: sudo apt-get install python3-pip --no-install-recommends

After that it's happy. So I think the beta is good, thank you!

@Mortinke
Copy link

Mortinke commented Sep 11, 2017

I got the same error. After I installed v3.0.0-beta.4 it works.

Your Environment Information -----------------------------
     OS:                     win32
     Node Version:           6.10.3
     Serverless Version:     1.17.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants