Justintime50 / github-archive

A powerful tool to concurrently clone, pull, or fork user and org repos and gists to create a GitHub archive.
MIT License
186 stars 48 forks source link

FileNotFoundError: [WinError 2] The system cannot find the file specified #47

Closed leptoid closed 2 years ago

leptoid commented 2 years ago

Getting errors while pulling labs from some ECCouncil content: What file would it be looking for? I installed via pip (today)

github-archive -o codered-by-ec-council --clone --https -v --log_level debug
# GitHub Archive started...

# Making API calls to GitHub for org repos...

codered-by-ec-council repos retrieved!
# Viewing org repos...

codered-by-ec-council/Black-Hat-Python-for-Pentesters
codered-by-ec-council/Micro-Degree-in-Python-Security
codered-by-ec-council/Hands-on-Android-Security
codered-by-ec-council/Ethical-Hacking---Capture-the-Flag-Walkthroughs---v1
codered-by-ec-council/Ethical-Hacking---Capture-the-Flag-Walkthroughs---v2
codered-by-ec-council/Introduction-to-Exploit-Zero-Day-Discovery-and-Development
codered-by-ec-council/Chrome-DevTools-Introduction-2020-Web-Developers-Guide
codered-by-ec-council/AZ-900_Microsoft_Azure_Fundamentals_Certification_2020
codered-by-ec-council/Buil-EU-GDPR-Data-Protection-Compliance-from-Scratch
codered-by-ec-council/Computer-Vision-Face-Recognition-Quick-Starter-in-Python
codered-by-ec-council/Windows-Penetration-Testing-Essentials
codered-by-ec-council/Secure-Full-Stack-MEAN-Developer
codered-by-ec-council/PowerShell-Security-Best-Practices
codered-by-ec-council/The-Comprehensive-Ethical-Hacking-Course
codered-by-ec-council/Secure-Programming-with-Go
codered-by-ec-council/Wireshark-for-Ethical-Hackers
codered-by-ec-council/The-Complete-Mobile-Ethical-Hacking
codered-by-ec-council/Shell-Scripting-with-Bash
codered-by-ec-council/Getting-Started-with-Blazor
codered-by-ec-council/AI-for-Finance
codered-by-ec-council/Data-Analysis-with-Python
codered-by-ec-council/Applied-Statistics-with-Python
codered-by-ec-council/Practical-Bug-Bounty-Hunting-for-Hackers-and-Pentesters
codered-by-ec-council/Python-and-Flask-Application-Development
codered-by-ec-council/Secure-Software-Architecture-and-Design-Patterns-in-Java-EE-Part-1
codered-by-ec-council/Computational-Mathematics-for-Data-Science
codered-by-ec-council/Beyond-the-Basics-Applied-Python-Part-One
codered-by-ec-council/Tunnels-in-Networking
codered-by-ec-council/Unleash-TensorFlow-2.0
codered-by-ec-council/Secure-and-Manage-Windows-Server-2016
codered-by-ec-council/Practical-Visit-to-Data-Mining
codered-by-ec-council/Practical-Applications-of-Machine-Learning
codered-by-ec-council/5G-Security-Deconstructed
codered-by-ec-council/Malware-Analysis-Fundamentals
codered-by-ec-council/Introduction-to-R-Programming
codered-by-ec-council/Ethical-Hacking-Capture-the-Flag-Walkthrough-V3
codered-by-ec-council/Digital-Forensics-for-Pentesters---Hands-on-Learning-
codered-by-ec-council/Microsoft-Security-Compliance-And-Identity-Fundamentals-Exam-Ref-SC-900
codered-by-ec-council/Practical-Spring-Security
codered-by-ec-council/Practical-Cyber-Threat-Intelligence
codered-by-ec-council/Applied-Threat-Hunting
codered-by-ec-council/Securing-Your-Data-Warehouse-with-Azure-Synapse-Analytics
codered-by-ec-council/Hands-on-SQL-for-Data-Science
codered-by-ec-council/Linux-32-bit-Reverse-Engineering
codered-by-ec-council/Installing-and-Mitigating-Linux-Rootkits
codered-by-ec-council/5G-Strategies-for-Businesses
codered-by-ec-council/Secure-Software-Architecture-and-Design-Patterns-in-Java-EE-Part-2
codered-by-ec-council/Cybersecurity-for-Telecom-Attack-and-Defend-Techniques-Tools-and-Frauds
codered-by-ec-council/Network-Automation-in-Python
codered-by-ec-council/Coding-with-Git
codered-by-ec-council/Enterprise-API-for-Advanced-Azure-Developers
codered-by-ec-council/Deep-Learning-Masked-Face-Detection-Recognition
codered-by-ec-council/The-Comprehensive-SQL-Course-2021
codered-by-ec-council/The-Advanced-SQL-Course-2021
codered-by-ec-council/Security-Information-and-Event-Management
codered-by-ec-council/Pattern-Recognition-in-Python
codered-by-ec-council/React-and-Secure-Your-Applications
codered-by-ec-council/Machine-Learning-Using-Python
codered-by-ec-council/Microsoft-Cybersecurity-Pro-Track-Threat-Detection
codered-by-ec-council/ASP.NET-Security
codered-by-ec-council/Data-Analysis-With-R-Masterclass
codered-by-ec-council/Introduction-to-Erlang-Programming
codered-by-ec-council/Secure-Programming-in-Golang
codered-by-ec-council/Digital-Twins-for-Cybersecurity
codered-by-ec-council/Data-Anonymization-Demystified
codered-by-ec-council/Advanced-Deep-Learning-Part-1
codered-by-ec-council/Advanced-Deep-Learning-Part-2
codered-by-ec-council/Hands-on-Python-Web-Scrapping-from-Scratch
codered-by-ec-council/Build-Security-Incident-Response-for-GDPR-Data-Protection
codered-by-ec-council/Ethical-Hacking-Capture-the-Flag-Walkthroughs-v1
codered-by-ec-council/Ethical-Hacking-Capture-the-Flag-Walkthroughs-v2
codered-by-ec-council/Ethical-Hacking-Capture-the-Flag-Walkthroughs-v3
codered-by-ec-council/Manage-Nano-Server-in-Hyper-V
codered-by-ec-council/Learn-Jmeter-from-Scratch-Web-Development
codered-by-ec-council/Microsoft-Cybersecurity-Pro-Track-Security-in-Office-365
codered-by-ec-council/GDPR-Privacy-Data-Protection-CASE-STUDIES-Explained
codered-by-ec-council/Cryptography-Demystified
codered-by-ec-council/Hands-on-Zero-Day-Exploit
codered-by-ec-council/Hands-on-JavaScript-for-Ethical-Hacking
codered-by-ec-council/Learn-Power-BI---Part-1
codered-by-ec-council/Self-Sovereign-Identity-SSI-the-Future-of-Trusted-Transactions
codered-by-ec-council/Big-Data-Analytics-for-Cybersecurity
codered-by-ec-council/Reverse-Engineering
codered-by-ec-council/Hands-on-TinyML
codered-by-ec-council/Entity-Fundamentals-Using-.NET-6
codered-by-ec-council/Digital-Forensics-for-Pentesters-Hands-on-Learning
codered-by-ec-council/Developing-IoT-Solutions-With-Azure-Suite
codered-by-ec-council/OSINT---Open-source-Intelligence
codered-by-ec-council/Applied-Python-for-Professionals
codered-by-ec-council/Hands-on-React-Native
codered-by-ec-council/Hands-on-Binary-Analysis-in-Linux-Part-1
codered-by-ec-council/Linux-Server-Administration-Made-Easy-with-Hands-on-Training
codered-by-ec-council/Applied-Data-Loss-Prevention
codered-by-ec-council/Practical-Introduction-to-Mainframe
codered-by-ec-council/Linux-Administration-With-Ansible
codered-by-ec-council/Mobile-Penetration-Testing-with-Kali-NetHunter
# Cloning missing org repos...

Traceback (most recent call last):
  File "C:\ProgramData\Anaconda3\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\ProgramData\Anaconda3\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\ProgramData\Anaconda3\Scripts\github-archive.exe\__main__.py", line 7, in <module>
  File "C:\ProgramData\Anaconda3\lib\site-packages\github_archive\cli.py", line 186, in main
    GithubArchiveCli().run()
  File "C:\ProgramData\Anaconda3\lib\site-packages\github_archive\cli.py", line 182, in run
    github_archive.run()
  File "C:\ProgramData\Anaconda3\lib\site-packages\github_archive\archive.py", line 133, in run
    failed_repos = self.iterate_repos_to_archive(org_repos, CLONE_OPERATION)
  File "C:\ProgramData\Anaconda3\lib\site-packages\github_archive\archive.py", line 306, in iterate_repos_to_archive
    failed_repos = [repo.result() for repo in thread_list if repo.result()]
  File "C:\ProgramData\Anaconda3\lib\site-packages\github_archive\archive.py", line 306, in <listcomp>
    failed_repos = [repo.result() for repo in thread_list if repo.result()]
  File "C:\ProgramData\Anaconda3\lib\concurrent\futures\_base.py", line 438, in result
    return self.__get_result()
  File "C:\ProgramData\Anaconda3\lib\concurrent\futures\_base.py", line 390, in __get_result
    raise self._exception
  File "C:\ProgramData\Anaconda3\lib\concurrent\futures\thread.py", line 52, in run
    result = self.fn(*self.args, **self.kwargs)
  File "C:\ProgramData\Anaconda3\lib\site-packages\github_archive\archive.py", line 373, in archive_repo
    subprocess.run(
  File "C:\ProgramData\Anaconda3\lib\subprocess.py", line 505, in run
    with Popen(*popenargs, **kwargs) as process:
  File "C:\ProgramData\Anaconda3\lib\subprocess.py", line 951, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "C:\ProgramData\Anaconda3\lib\subprocess.py", line 1420, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified
Justintime50 commented 2 years ago

This is most likely due to how Windows handles the subprocess command via Python:

I'll try to reproduce this on Windows in the next couple of days and put up a patch if possible (I develop on macOS and the lib is tested on CI against Linux) so this wasn't discovered earlier. I'll keep you posted with what I find.

leptoid commented 2 years ago

Interesting. That is windows for you. I will test it on my Linux box (no MacOS for this guy). :) Thanks!

leptoid commented 2 years ago

I did consider this was because I was using Anaconda in Windows and not true Python.

Justintime50 commented 2 years ago

Ah, interesting. Are you able to try with normal Python? I have tested the script on windows before when fixing another windows specific bug and didn't come across this which was why this initially took me by surprise, though I was using Python which could explain the error here.

leptoid commented 2 years ago

Since i will have to install it, what version would you recommend?

Justintime50 commented 2 years ago

The app is compatible with Python 3.7 and newer so any of those should do.

leptoid commented 2 years ago

Hey... update: Removed Anaconda (my friend always says it sucks)... installed Python 3.10 and now it works fine.
I thought there was an issue as I expected it to save data in the folder I was in at the CLI... it saved data... somewhere. Once I specified location, I was all set. Lesson: Anaconda may be neat but sometimes it just doesn't work out.

So the problem isn't really a problem... it is just a quirk with Anaconda. Thanks for looking into this with me.

Justintime50 commented 2 years ago

Glad you got it working! Thanks for all the info.