MastodonToTwitter icon indicating copy to clipboard operation
MastodonToTwitter copied to clipboard

Docker-Compose crashed because git is not available

Open grisu48 opened this issue 4 years ago • 5 comments

Hi,

I wanted to start using this, but when building the docker image it crashes because in one of the images git seems to be missing

Step 6/7 : RUN pip3 install --no-cache-dir -r requirements.txt &&     touch mtt_mastodon_client.secret           mtt_mastodon_user.secret           mtt_mastodon_server.secret           mtt_twitter.secret
 ---> Running in 8d9fcc8209ae
Collecting git+https://github.com/bear/python-twitter.git (from -r requirements.txt (line 6))
  Cloning https://github.com/bear/python-twitter.git to /tmp/pip-req-build-9f2_012x
  Running command git clone -q https://github.com/bear/python-twitter.git /tmp/pip-req-build-9f2_012x
  ERROR: Error [Errno 2] No such file or directory: 'git': 'git' while executing command git clone -q https://github.com/bear/python-twitter.git /tmp/pip-req-build-9f2_012x
ERROR: Cannot find command 'git' - do you have 'git' installed and in your PATH?

I'm using openSUSE Leap 15.1. Find attached the full docker-compose log

I really like this project btw :-)

docker-compose-log.txt

grisu48 avatar Feb 10 '20 20:02 grisu48

Hello, Did you check ? https://github.com/AmauryCarrade/MastodonToTwitter/pull/58

MaximeMichaud avatar Feb 13 '20 05:02 MaximeMichaud

Cool! Looks good but I run into a different problem:

Successfully built 933201d28f33
Successfully tagged mastodontotwitter:latest
WARNING: Image for service mtt was built because it did not already exist. To rebuild this image you must use `docker-compose build` or `docker-compose up --build`.
[13/02/2020 09:30:01] [MainThread] Everything looks good; starting…
[13/02/2020 09:30:02] [Mastodon -> Twitter] Tweeting any toot after toot 103650078255624221                                                  
[13/02/2020 09:30:02] [Twitter -> Mastodon] Tooting any tweet after tweet 1227551321974284293                                                
[13/02/2020 09:30:02] [Twitter -> Mastodon] Listening for tweets…
[13/02/2020 09:30:02] [Mastodon -> Twitter] Updated expected short URL length - it is now 24 characters.                                     
[13/02/2020 09:30:02] [Mastodon -> Twitter] Listening for toots…
Exception in thread Mastodon -> Twitter:
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/threading.py", line 916, in _bootstrap_inner                                                                
    self.run()
  File "/usr/src/app/mtt/mastodon_to_twitter.py", line 228, in run
    self.mastodon_api.stream_user(TootsListener(self), async=False)
TypeError: stream_user() got an unexpected keyword argument 'async'

I'm gonna check when I have some time.

grisu48 avatar Feb 13 '20 09:02 grisu48

Chiming in here: That's a problem with the newest version of Mastodon.py, I had to rename the parameter from "async" to "run_async". This change was unfortunately necessary, since python 3.5 made "async" a keyword (so it can't be used as a variable name anymore). If you replace "async" with "run_async" in the stream_user call, things should work as before.

halcy avatar Feb 13 '20 09:02 halcy

Thanks, that did the job! Now the container is running

grisu48 avatar Feb 13 '20 10:02 grisu48

I'm also getting the error reported by OP Tried the Dockerfile/docker-compose.yml and also pushing to a CapRover server. I don't see any resolution in https://github.com/AmauryCarrade/MastodonToTwitter/issues/67#issuecomment-585564515 or how to implement https://github.com/AmauryCarrade/MastodonToTwitter/issues/67#issuecomment-585638687.

Is there some fix for this ?

slfhstr avatar Sep 22 '21 19:09 slfhstr