AOSP repo sync - shutil Error [Errno 13] Permission denied - android-source

I decided to start the creation of a custom ROM from the android source code.
I followed the steps at the docs:
Installed the Repo launcher
Initialized the AOSP repo
repo init -u https://android.googlesource.com/platform/manifest
Your identity is: personal-info myCoolEmail#somewhere.com...
repo has been initialized in /mnt/e/MyCustomROM/source
This successfully creates the .repo directory, but the issue comes right when executing repo sync:
Fetching: 0% (0/1075) warming uperror: Cannot fetch platform/art (Error: [(<DirEntry 'heads'>, '/mnt/e/MyCustomROM/source/.repo/projects/art.git/refs/heads', "[Errno 13] Permission denied: '/mnt/e/MyCustomROM/source/.repo/projects/art.git/refs/heads'"), (<DirEntry 'tags'>, '/mnt/e/MyCustomROM/source/.repo/projects/art.git/refs/tags', "[Errno 13] Permission denied: '/mnt/e/MyCustomROM/source/.repo/projects/art.git/refs/tags'"), ('/mnt/e/MyCustomROM/source/.repo/project-objects/platform/art.git/refs', '/mnt/e/MyCustomROM/source/.repo/projects/art.git/refs', "[Errno 13] Permission denied: '/mnt/e/MyCustomROM/source/.repo/projects/art.git/refs'")])
error: Cannot fetch platform/build/bazel (Error: [(<DirEntry 'heads'>, '/mnt/e/MyCustomROM/source/.repo/projects/build/bazel.git/refs/heads', "[Errno 13] Permission denied: '/mnt/e/MyCustomROM/source/.repo/projects/build/bazel.git/refs/heads'"), (<DirEntry 'tags'>, '/mnt/e/MyCustomROM/source/.repo/projects/build/bazel.git/refs/tags', "[Errno 13] Permission denied: '/mnt/e/MyCustomROM/source/.repo/projects/build/bazel.git/refs/tags'"), ('/mnt/e/MyCustomROM/source/.repo/project-objects/platform/build/bazel.git/refs', '/mnt/e/MyCustomROM/source/.repo/projects/build/bazel.git/refs', "[Errno 13] Permission denied: '/mnt/e/MyCustomROM/source/.repo/projects/build/bazel.git/refs'")])
error: Cannot fetch platform/build/pesto (Error: [(<DirEntry 'heads'>, '/mnt/e/MyCustomROM/source/.repo/projects/build/pesto.git/refs/heads', "[Errno 13] Permission denied: '/mnt/e/MyCustomROM/source/.repo/projects/build/pesto.git/refs/heads'"), (<DirEntry 'tags'>, '/mnt/e/MyCustomROM/source/.repo/projects/build/pesto.git/refs/tags', "[Errno 13] Permission denied: '/mnt/e/MyCustomROM/source/.repo/projects/build/pesto.git/refs/tags'"), ('/mnt/e/MyCustomROM/source/.repo/project-objects/platform/build/pesto.git/refs', '/mnt/e/MyCustomROM/source/.repo/projects/build/pesto.git/refs', "[Errno 13] Permission denied: '/mnt/e/MyCustomROM/source/.repo/projects/build/pesto.git/refs'")])
Traceback (most recent call last):
File "/mnt/e/MyCustomROM/source/.repo/repo/main.py", line 651, in <module>
_Main(sys.argv[1:])
File "/mnt/e/MyCustomROM/source/.repo/repo/main.py", line 627, in _Main
result = run()
File "/mnt/e/MyCustomROM/source/.repo/repo/main.py", line 620, in <lambda>
run = lambda: repo._Run(name, gopts, argv) or 0
File "/mnt/e/MyCustomROM/source/.repo/repo/main.py", line 286, in _Run
result = cmd.Execute(copts, cargs)
File "/mnt/e/MyCustomROM/source/.repo/repo/subcmds/sync.py", line 1027, in Execute
all_projects = self._FetchMain(opt, args, all_projects, err_event,
File "/mnt/e/MyCustomROM/source/.repo/repo/subcmds/sync.py", line 499, in _FetchMain
success, fetched = self._Fetch(to_fetch, opt, err_event, ssh_proxy)
File "/mnt/e/MyCustomROM/source/.repo/repo/subcmds/sync.py", line 457, in _Fetch
if not _ProcessResults(results):
File "/mnt/e/MyCustomROM/source/.repo/repo/subcmds/sync.py", line 410, in _ProcessResults
for results in results_sets:
File "/usr/lib/python3.8/multiprocessing/pool.py", line 448, in <genexpr>
return (item for chunk in result for item in chunk)
File "/usr/lib/python3.8/multiprocessing/pool.py", line 868, in next
raise value
multiprocessing.pool.MaybeEncodingError: Error sending result: '<multiprocessing.pool.ExceptionWithTraceback object at 0x7f1f1ab32f10>'. Reason: 'TypeError("cannot pickle 'posix.DirEntry' object")'
For more (hopefully) useful info:
I'm running Ubuntu 20.04.3 LTS as a Windows subsystem (that's the
reason the path where I located the project is in /mnt/e/...)
Also using Python 3.8.10 (and of course did this: sudo ln -s /usr/bin/python3 /usr/bin/python)
Thanks in advance!!

I met the same issue, and I fixed it by change the folder security of Windows.
Give the folder full control permissions to group Users or your own user
See this picture:
Folder Permissions

Related

Overwrite anaconda3 unsuccessful installation

I deleted the anaconda directory under the home and bashrc configurations.
Now, I need to install it again, but it occurs a problem evenif overwrites unsuccessful installation on Linux.
Should I delete some additional config files? How can I handle this?
sh Downloads/Anaconda3-2022.10-Linux-x86_64.sh -u -p /home/user/anaconda3/
PREFIX=/home/user/anaconda3
Unpacking payload ...
concurrent.futures.process._RemoteTraceback:
'''
Traceback (most recent call last):
File "concurrent/futures/process.py", line 384, in wait_result_broken_or_wakeup
File "multiprocessing/connection.py", line 256, in recv
TypeError: __init__() missing 1 required positional argument: 'msg'
'''
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "entry_point.py", line 69, in <module>
File "concurrent/futures/process.py", line 559, in _chain_from_iterable_of_lists
File "concurrent/futures/_base.py", line 608, in result_iterator
File "concurrent/futures/_base.py", line 445, in the result
File "concurrent/futures/_base.py", line 390, in __get_result
concurrent.futures.process.BrokenProcessPool: A process in the process pool was terminated abruptly while the future was running or pending.
[8382] Failed to execute script entry_point
Make sure deleted .conda directory under home and have enough disk space.
No need to delete .cache or any bin libraries.

Why am I getting a read-only file system from github and an error when trying to install apache airflow?

I am working on VirtualBox 6.0 with Python 3.5. I am trying to install airflow from github using the requirements-python3.5.txt file (https://raw.githubusercontent.com/apache/airflow/v1-10-stable/requirements/requirements-python3.5.txt). However, when I try to download this file from the command line, I get a read-only file system:
vagrant#learnairflow:~$ source .sandbox/bin/activate
(.sandbox) vagrant#learnairflow:~$ wget https://raw.githubusercontent.com/apache/airflow/v1-10-stable/requirements/requirements-python3.5.txt
--2020-06-13 15:47:54-- https://raw.githubusercontent.com/apache/airflow/v1-10-stable/requirements/requirements-python3.5.txt
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 199.232.48.133
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|199.232.48.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 6210 (6.1K) [text/plain]
requirements-python3.5.txt: Read-only file system
Cannot write to ‘requirements-python3.5.txt’ (Success).
Subsequently, when I try to install airflow I get the following error:
(.sandbox) vagrant#learnairflow:~$ pip install "apache-airflow[celery, crypto, mysql, rabbitmq, redis]"==1.10.10 --constraint requirements-python3.5.txt
WARNING: The directory '/home/vagrant/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
ERROR: Exception:
Traceback (most recent call last):
File "/home/vagrant/.sandbox/lib/python3.5/site-packages/pip/_internal/cli/base_command.py", line 188, in _main
status = self.run(options, args)
File "/home/vagrant/.sandbox/lib/python3.5/site-packages/pip/_internal/cli/req_command.py", line 185, in wrapper
return func(self, options, args)
File "/home/vagrant/.sandbox/lib/python3.5/site-packages/pip/_internal/commands/install.py", line 288, in run
wheel_cache = WheelCache(options.cache_dir, options.format_control)
File "/home/vagrant/.sandbox/lib/python3.5/site-packages/pip/_internal/cache.py", line 296, in __init__
self._ephem_cache = EphemWheelCache(format_control)
File "/home/vagrant/.sandbox/lib/python3.5/site-packages/pip/_internal/cache.py", line 265, in __init__
globally_managed=True,
File "/home/vagrant/.sandbox/lib/python3.5/site-packages/pip/_internal/utils/temp_dir.py", line 137, in __init__
path = self._create(kind)
File "/home/vagrant/.sandbox/lib/python3.5/site-packages/pip/_internal/utils/temp_dir.py", line 185, in _create
tempfile.mkdtemp(prefix="pip-{}-".format(kind))
File "/usr/local/lib/python3.5/tempfile.py", line 358, in mkdtemp
prefix, suffix, dir, output_type = _sanitize_params(prefix, suffix, dir)
File "/usr/local/lib/python3.5/tempfile.py", line 130, in _sanitize_params
dir = gettempdir()
File "/usr/local/lib/python3.5/tempfile.py", line 296, in gettempdir
tempdir = _get_default_tempdir()
File "/usr/local/lib/python3.5/tempfile.py", line 231, in _get_default_tempdir
dirlist)
FileNotFoundError: [Errno 2] No usable temporary directory found in ['/tmp', '/var/tmp', '/usr/tmp', '/home/vagrant']
I've tried using the sudo command but it doesn't work either. Do you have any idea of what might be causing this error and how to fix it? Thank you in advance!

Running supervisord on a read only filesystem

I'm trying to run supervisord on a read only filesystem.
I have tried to stop supervisord from writing log and pid files using the following configuration:
[supervisord]
nodaemon=true
user=root
logfile=/dev/stdout
logfile_maxbytes=0
pidfile=/dev/null
However, when I attempt to start, I still receive the following error:
Traceback (most recent call last):
File "/usr/bin/supervisord", line 11, in <module>
load_entry_point('supervisor==3.3.4', 'console_scripts', 'supervisord')()
File "/usr/lib/python2.7/site-packages/supervisor/supervisord.py", line 349, in main
options = ServerOptions()
File "/usr/lib/python2.7/site-packages/supervisor/options.py", line 428, in __init__
existing_directory, default=tempfile.gettempdir())
File "/usr/lib/python2.7/tempfile.py", line 275, in gettempdir
tempdir = _get_default_tempdir()
File "/usr/lib/python2.7/tempfile.py", line 217, in _get_default_tempdir
("No usable temporary directory found in %s" % dirlist))
IOError: [Errno 2] No usable temporary directory found in ['/tmp', '/var/tmp', '/usr/tmp', '/']
Is it possible to start/run supervisord on a read only filesystem?
Set the TEMPDIR environment variable to a rw volume mount.

Creating virtualenv inside veracypt error

I'm setting up a project inside veracrypt and it's throwing this error when I try to setup the environment.
admin#kali:/media/veracrypt1$ virtualenv --python=python3 venv
Already using interpreter /usr/bin/python3
Using base prefix '/usr'
New python executable in /media/veracrypt1/venv/bin/python3
Also creating executable in /media/veracrypt1/venv/bin/python
Traceback (most recent call last):
File "/usr/local/bin/virtualenv", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.7/dist-packages/virtualenv.py", line 870, in main
symlink=options.symlink,
File "/usr/local/lib/python3.7/dist-packages/virtualenv.py", line 1162, in create_environment
install_python(home_dir, lib_dir, inc_dir, bin_dir, site_packages=site_packages, clear=clear, symlink=symlink)
File "/usr/local/lib/python3.7/dist-packages/virtualenv.py", line 1672, in install_python
os.symlink(py_executable_base, full_pth)
PermissionError: [Errno 1] Operation not permitted: 'python3' -> '/media/veracrypt1/venv/bin/python'
I've tried to look for the source of the issue and it seems it's related to how it's a virtualdrive with limited rights
admin#kali:/media/veracrypt1$ ln -s testfile
ln: failed to create symbolic link './testfile': Operation not permitted
Looks like you are running this in an environment with limited permissions.
Some report this behavior when running on Linux,
but in a folder that is mounted to a "FAT32" partition -
see Chris Lope's blog-post:
permissionerror: [errno 1] operation not permitted
I have experienced this behavior while running in an Ubuntu VM
in a folder that was mounted to the host-OS (Windows-NTFS) as type 'vboxsf'.
Solved it by moving to work in a partition that is native Unix.

Operator framework ansible install psycopg2-binary

How do I install psycopg2-binary in Operator Framework Ansible? I've tried adding a RUN pip3 install psycopg2-binary to the Dockerfile but that returns:
Installing collected packages: psycopg2-binary
Exception:
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/usr/lib/python3.6/site-packages/pip/commands/install.py", line 365, in run
strip_file_prefix=options.strip_file_prefix,
File "/usr/lib/python3.6/site-packages/pip/req/req_set.py", line 789, in install
**kwargs
File "/usr/lib/python3.6/site-packages/pip/req/req_install.py", line 854, in install
strip_file_prefix=strip_file_prefix
File "/usr/lib/python3.6/site-packages/pip/req/req_install.py", line 1069, in move_wheel_files
strip_file_prefix=strip_file_prefix,
File "/usr/lib/python3.6/site-packages/pip/wheel.py", line 345, in move_wheel_files
clobber(source, lib_dir, True)
File "/usr/lib/python3.6/site-packages/pip/wheel.py", line 316, in clobber
ensure_dir(destdir)
File "/usr/lib/python3.6/site-packages/pip/utils/__init__.py", line 83, in ensure_dir
os.makedirs(path)
File "/usr/lib64/python3.6/os.py", line 220, in makedirs
mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/usr/local/lib64/python3.6/site-packages/psycopg2'
PS. I couldn't add Operator-Framework tag because I need 130 more points to be able to ;)
I've found the origin of the Dockerfile and that helped me come up with this:
COPY requirements.txt ${HOME}/requirements.txt
USER root
RUN pip3 install -r ${HOME}/requirements.txt
USER ${USER_UID}