Open tashrifbillah opened 1 month ago
grep -B34 urllib3.exceptions.MaxRetryError /tmp/errors.txt | grep .csv
This gives only csv file names.
cd /data/predict1/utility/bsub/ ../parse_redcap_error.py "*err" | grep -B34 urllib3.exceptions.MaxRetryError | grep .csv
This gives only csv file names.
Put this within rpms_to_redcap.sh
:
FORCE=1
for form in $(cat ~/failed.csv)
do
pushd . > /dev/null
subject=${form:0:7}
site=${form:0:2}
cd /data/predict1/data_from_nda/Prescient/PHOENIX/PROTECTED/Prescient${site}/raw/${subject}/surveys/
echo $form
/data/predict1/utility/rpms_to_redcap.py $form $redcap_dict $API_TOKEN $FORCE
popd > /dev/null
sleep 10
done
Another idea is catch this error within request and set its hash to zero.
Special characters are making it hard to streamline:
^[[0;31m ME01326_speech_sampling_run_sheet.csv ^[[0m
As an improvement, we removed special characters around $form
:
https://github.com/AMP-SCZ/utility/blob/4f55fb8284b626989c8390082d074bb1e186271a/rpms_to_redcap.lsf#L46
We shall actually have to run the whole pipeline for those selected cases. So two ideas:
(i)
(ii)
or, write an rpms_records.txt
and rerun the whole RPMS pipeline for upload, clean, down shift
(ii)
seems like a big task. So we should just follow (i)
and wait for the next run.
We decided to simply retry upload after 180 seconds interval.
Reference: https://stackoverflow.com/questions/15431044/can-i-set-max-retries-for-requests-request https://requests.readthedocs.io/en/latest/user/advanced/#transport-adapters https://requests.readthedocs.io/en/latest/api/ https://urllib3.readthedocs.io/en/latest/reference/urllib3.util.html#module-urllib3.util.retry
If this scheme is successful, we should deploy this on import_records_all.py
too.
urllib3.exceptions.MaxRetryError
``` CP00102_daily_activity_and_saliva_sample_collection.csv Traceback (most recent call last): File "/data/predict1/miniconda3/lib/python3.10/site-packages/urllib3/connection.py", line 174, in _new_conn conn = connection.create_connection( File "/data/predict1/miniconda3/lib/python3.10/site-packages/urllib3/util/connection.py", line 72, in create_connection for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): File "/data/predict1/miniconda3/lib/python3.10/socket.py", line 955, in getaddrinfo for res in _socket.getaddrinfo(host, port, family, type, proto, flags): socket.gaierror: [Errno -2] Name or service not known During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/data/predict1/miniconda3/lib/python3.10/site-packages/urllib3/connectionpool.py", line 703, in urlopen httplib_response = self._make_request( File "/data/predict1/miniconda3/lib/python3.10/site-packages/urllib3/connectionpool.py", line 386, in _make_request self._validate_conn(conn) File "/data/predict1/miniconda3/lib/python3.10/site-packages/urllib3/connectionpool.py", line 1042, in _validate_conn conn.connect() File "/data/predict1/miniconda3/lib/python3.10/site-packages/urllib3/connection.py", line 358, in connect self.sock = conn = self._new_conn() File "/data/predict1/miniconda3/lib/python3.10/site-packages/urllib3/connection.py", line 186, in _new_conn raise NewConnectionError( urllib3.exceptions.NewConnectionError:urllib3.exceptions.ProtocolError
``` CP00102_missing_data.csv Traceback (most recent call last): File "/data/predict1/miniconda3/lib/python3.10/site-packages/urllib3/connectionpool.py", line 703, in urlopen httplib_response = self._make_request( File "/data/predict1/miniconda3/lib/python3.10/site-packages/urllib3/connectionpool.py", line 449, in _make_request six.raise_from(e, None) File "urllib3.exceptions.NewConnectionError
``` CP00102_family_interview_for_genetic_studies_figs.csv.flat Traceback (most recent call last): File "/data/predict1/miniconda3/lib/python3.10/site-packages/urllib3/connection.py", line 174, in _new_conn conn = connection.create_connection( File "/data/predict1/miniconda3/lib/python3.10/site-packages/urllib3/util/connection.py", line 72, in create_connection for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): File "/data/predict1/miniconda3/lib/python3.10/socket.py", line 955, in getaddrinfo for res in _socket.getaddrinfo(host, port, family, type, proto, flags): socket.gaierror: [Errno -2] Name or service not known During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/data/predict1/miniconda3/lib/python3.10/site-packages/urllib3/connectionpool.py", line 703, in urlopen httplib_response = self._make_request( File "/data/predict1/miniconda3/lib/python3.10/site-packages/urllib3/connectionpool.py", line 386, in _make_request self._validate_conn(conn) File "/data/predict1/miniconda3/lib/python3.10/site-packages/urllib3/connectionpool.py", line 1042, in _validate_conn conn.connect() File "/data/predict1/miniconda3/lib/python3.10/site-packages/urllib3/connection.py", line 358, in connect self.sock = conn = self._new_conn() File "/data/predict1/miniconda3/lib/python3.10/site-packages/urllib3/connection.py", line 186, in _new_conn raise NewConnectionError( urllib3.exceptions.NewConnectionError:The easiest solution may be to:
bsub/
directory forurllib3.exceptions.MaxRetryError
string*err
files that has it, obtain subject ID