mdavis-xyz / paragraphiser_bot_aws

a reimplementation of my reddit bot with AWS Lambda functions
18 stars 4 forks source link

ran python deploy.py -s dev unsuccessfully #4

Open XPMai opened 5 years ago

XPMai commented 5 years ago

I don't understand what is going on, but I think I've managed to do all earlier steps successfully.

ubuntu@ip-172-31-25-128:~/HomeworkHelpBot$ python3 deploy.py -s dev
deploying dev
About to build lambdas
   Building env for lambda failer
   Building env for lambda poll
   Building env for lambda checkOldOne
   Building env for lambda errorHandler
   Building env for lambda checkForNew

####################

Traceback (most recent call last):
  File "/home/ubuntu/HomeworkHelpBot/tooling/lam/main.py", line 136, in safe_fail
    ret = func(name)
  File "/home/ubuntu/HomeworkHelpBot/tooling/lam/main.py", line 165, in build_one
    bufsize=1)
  File "/usr/lib/python3.5/subprocess.py", line 693, in run
    with Popen(*popenargs, **kwargs) as process:
TypeError: __init__() got an unexpected keyword argument 'encoding'

####################

Unable to build the following lambdas:
   failer
   checkForNew
   poll
   checkOldOne
   errorHandler
Output for build of lambda failer shown above
mdavis-xyz commented 5 years ago

Hmm, odd.

The bit that's failing is:

            # https://stackoverflow.com/a/4760517
            result = subprocess.run([makefile_long, self.data_dir],
                                    stdout=subprocess.PIPE,
                                    stderr=subprocess.PIPE,
                                    cwd=this_lambda_dir,
                                    encoding='utf-8',
                                    bufsize=1)

Try running it with python 2? (I thought I did it with python 3, but maybe I'm remembering wrong.) Or python 3.6?

Have you added any custom code yet? Anything specific to your bot? Or just cloned and deployed?

Maybe try removing encoding='utf-8' from the bit above?

What are you deploying from? Ubuntu, Amazon Linux, Windows?

XPMai commented 5 years ago

Hmm, odd.

The bit that's failing is:

            # https://stackoverflow.com/a/4760517
            result = subprocess.run([makefile_long, self.data_dir],
                                    stdout=subprocess.PIPE,
                                    stderr=subprocess.PIPE,
                                    cwd=this_lambda_dir,
                                    encoding='utf-8',
                                    bufsize=1)

Try running it with python 2? (I thought I did it with python 3, but maybe I'm remembering wrong.) Or python 3.6?

Have you added any custom code yet? Anything specific to your bot? Or just cloned and deployed?

Maybe try removing encoding='utf-8' from the bit above?

What are you deploying from? Ubuntu, Amazon Linux, Windows?

Ubuntu 16.04 Xenial. I've updated to python 3.5 from 3.6 and set it as by default following online guides but some errors come up ://

ubuntu@ip-172-31-25-128:~/HomeworkHelpBot$ python deploy.py -s dev
Traceback (most recent call last):
  File "/usr/lib/python3.6/dbm/gnu.py", line 4, in <module>
    from _gdbm import *
ModuleNotFoundError: No module named '_gdbm'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/CommandNotFound/CommandNotFound.py", line 7, in <module>
    import dbm.gnu as gdbm
  File "/usr/lib/python3.6/dbm/gnu.py", line 6, in <module>
    raise ImportError(str(msg) + ', please install the python3-gdbm package')
ImportError: No module named '_gdbm', please install the python3-gdbm package

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/command-not-found", line 27, in <module>
    from CommandNotFound.util import crash_guard
  File "/usr/lib/python3/dist-packages/CommandNotFound/__init__.py", line 3, in <module>
    from CommandNotFound.CommandNotFound import CommandNotFound
  File "/usr/lib/python3/dist-packages/CommandNotFound/CommandNotFound.py", line 9, in <module>
    import gdbm
ModuleNotFoundError: No module named 'gdbm'
mdavis-xyz commented 5 years ago

Hmm, odd. I haven't heard of gdbm before.

Maybe I have some standard python modules installed which you don't.

Try pip3 install gdbm --user, or sudo apt install python3-gdbm.