crash due to git in a strange state after a preceding crash
the following is probably due to one of the other crashes (#2 (closed) #3 (closed)):
seems we could improve the situation if something crashed... maybe it would make sense to completely reset the local repo every time?
what do you think @jeanggi90
production_pinder-butler | '2019-06-06 11:26:49,979:INFO:#-#-#-#-#-#-#-#-#-#-#
production_pinder-butler | Script Started'
production_pinder-butler | '2019-06-06 11:26:49,979:INFO:Preparing bot...'
production_pinder-butler | '2019-06-06 11:26:49,979:DEBUG:Popen(['git', 'clone', '-v', 'https://gitlab-ci-token:************@git.violoncello.ch/pinder/4am.git', '/bot/repo'], cwd=/bot, universal_newlines=True, shell=None)'
production_pinder-butler | '2019-06-06 11:26:49,982:DEBUG:Cmd(['git', 'clone', '-v', 'https://gitlab-ci-token:*************@git.violoncello.ch/pinder/4am.git', '/bot/repo'])'s unused stdout: '
production_pinder-butler | '2019-06-06 11:26:49,983:DEBUG:AutoInterrupt wait stderr: b"fatal: destination path '/bot/repo' already exists and is not an empty directory.\n"'
production_pinder-butler | '2019-06-06 11:26:49,984:DEBUG:Popen(['git', 'fetch', '-v', 'origin'], cwd=/bot/repo, universal_newlines=True, shell=None)'
production_pinder-butler | '2019-06-06 11:26:50,148:INFO:Bot ready'
production_pinder-butler | '2019-06-06 11:26:50,148:INFO:Processing queue /bot/watchDir/files.que'
production_pinder-butler | '2019-06-06 11:26:50,148:DEBUG:Attempting to acquire lock 140661637454088 on /bot/watchDir/files.que.lock'
production_pinder-butler | '2019-06-06 11:26:50,148:INFO:Lock 140661637454088 acquired on /bot/watchDir/files.que.lock'
production_pinder-butler | '2019-06-06 11:26:50,148:DEBUG:Attempting to release lock 140661637454088 on /bot/watchDir/files.que.lock'
production_pinder-butler | '2019-06-06 11:26:50,149:INFO:Lock 140661637454088 released on /bot/watchDir/files.que.lock'
production_pinder-butler | '2019-06-06 11:26:50,149:DEBUG:Contentfile ['/app/data/1559820285.pro']'
production_pinder-butler | '2019-06-06 11:26:50,149:INFO:Processing new content /bot/watchDir/1559820285.pro'
production_pinder-butler | '2019-06-06 11:26:50,149:DEBUG:Merging /bot/watchDir/1559820285.pro into /bot/repo/content.js file'
production_pinder-butler | '2019-06-06 11:26:50,149:DEBUG:Looking for corresponding images'
production_pinder-butler | '2019-06-06 11:26:50,150:DEBUG:Images ['/static/imgs/1559820285.pro.jpeg']'
production_pinder-butler | '2019-06-06 11:26:50,150:DEBUG:processing image: /static/imgs/1559820285.pro.jpeg'
production_pinder-butler | '2019-06-06 11:26:50,150:DEBUG:New changes to commit'
production_pinder-butler | '2019-06-06 11:26:50,150:DEBUG:Popen(['git', 'fetch', '-v', 'origin'], cwd=/bot/repo, universal_newlines=True, shell=None)'
production_pinder-butler | '2019-06-06 11:26:50,289:DEBUG:Popen(['git', 'cat-file', '--batch-check'], cwd=/bot/repo, universal_newlines=False, shell=None)'
production_pinder-butler | '2019-06-06 11:26:50,293:DEBUG:Popen(['git', 'checkout', '1559820285.pro'], cwd=/bot/repo, universal_newlines=False, shell=None)'
production_pinder-butler | '2019-06-06 11:26:50,298:DEBUG:Popen(['git', 'pull', 'origin', 'master'], cwd=/bot/repo, universal_newlines=False, shell=None)'
production_pinder-butler | Traceback (most recent call last):
production_pinder-butler | File "/bot/src/main.py", line 59, in <module>
production_pinder-butler | processQueue()
production_pinder-butler | File "/bot/src/main.py", line 38, in processQueue
production_pinder-butler | if pinderButler.processNewContent(filePath, lambda success: success):
production_pinder-butler | File "/bot/src/PinderButler.py", line 99, in processNewContent
production_pinder-butler | return self.doCommitAndPush(self.newFileName, self.filesToCommit, lambda status: self.statusHandler(status, mainCompletionHandler))
production_pinder-butler | File "/bot/src/PinderButler.py", line 118, in doCommitAndPush
production_pinder-butler | self.repo.git.pull('origin', master)
production_pinder-butler | File "/usr/local/lib/python3.6/dist-packages/git/cmd.py", line 548, in <lambda>
production_pinder-butler | return lambda *args, **kwargs: self._call_process(name, *args, **kwargs)
production_pinder-butler | File "/usr/local/lib/python3.6/dist-packages/git/cmd.py", line 1014, in _call_process
production_pinder-butler | return self.execute(call, **exec_kwargs)
production_pinder-butler | File "/usr/local/lib/python3.6/dist-packages/git/cmd.py", line 825, in execute
production_pinder-butler | raise GitCommandError(command, status, stderr_value, stdout_value)
production_pinder-butler | git.exc.GitCommandError: Cmd('git') failed due to: exit code(1)
production_pinder-butler | cmdline: git pull origin master
production_pinder-butler | stdout: 'Updating 652f5f0..baec2eb'
production_pinder-butler | stderr: 'From https://git.violoncello.ch/pinder/4am
production_pinder-butler | * branch master -> FETCH_HEAD
production_pinder-butler | error: Your local changes to the following files would be overwritten by merge:
production_pinder-butler | content.js
production_pinder-butler | Please commit your changes or stash them before you merge.
production_pinder-butler | Aborting'