How to fix node's "IOError: CRC check failed" error when installing Open edX ginkgo.1 release

During the installation process of Open edX ginkgo.1 release (native), you may encounter this error:

{"changed": true, "cmd": "/edx/app/edxapp/venvs/edxapp/bin/nodeenv /edx/app/edxapp/nodeenvs/edxapp --node=6.11.1 --prebuilt --force", "delta": "0:09:19.500992", "end": "2017-09-27 06:20:43.488592", "failed": true, "rc": 1, "start": "2017-09-27 06:11:23.987600", "stderr": " * Install prebuilt node (6.11.1) ..Traceback (most recent call last):\n  File \"/edx/app/edxapp/venvs/edxapp/bin/nodeenv\", line 11, in <module>\n    sys.exit(main())\n  File \"/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/nodeenv.py\", line 1010, in main\n    create_environment(env_dir, opt)\n  File \"/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/nodeenv.py\", line 843, in create_environment\n    install_node(env_dir, src_dir, opt)\n  File \"/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/nodeenv.py\", line 658, in install_node\n    download_node_src(node_url, src_dir, opt, prefix)\n  File \"/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/nodeenv.py\", line 541, in download_node_src\n    member_list = tarfile_obj.getmembers()\n  File \"/usr/lib/python2.7/tarfile.py\", line 1836, in getmembers\n    self._load()        # all members, we first have to\n  File \"/usr/lib/python2.7/tarfile.py\", line 2417, in _load\n    tarinfo = self.next()\n  File \"/usr/lib/python2.7/tarfile.py\", line 2348, in next\n    self.fileobj.seek(self.offset - 1)\n  File \"/usr/lib/python2.7/gzip.py\", line 443, in seek\n    self.read(1024)\n  File \"/usr/lib/python2.7/gzip.py\", line 268, in read\n    self._read(readsize)\n  File \"/usr/lib/python2.7/gzip.py\", line 315, in _read\n    self._read_eof()\n  File \"/usr/lib/python2.7/gzip.py\", line 354, in _read_eof\n    hex(self.crc)))\nIOError: CRC check failed 0x434b8799 != 0xb03aeb4L", "stderr_lines": [" * Install prebuilt node (6.11.1) ..Traceback (most recent call last):", "  File \"/edx/app/edxapp/venvs/edxapp/bin/nodeenv\", line 11, in <module>", "    sys.exit(main())", "  File \"/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/nodeenv.py\", line 1010, in main", "    create_environment(env_dir, opt)", "  File \"/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/nodeenv.py\", line 843, in create_environment", "    install_node(env_dir, src_dir, opt)", "  File \"/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/nodeenv.py\", line 658, in install_node", "    download_node_src(node_url, src_dir, opt, prefix)", "  File \"/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/nodeenv.py\", line 541, in download_node_src", "    member_list = tarfile_obj.getmembers()", "  File \"/usr/lib/python2.7/tarfile.py\", line 1836, in getmembers", "    self._load()        # all members, we first have to", "  File \"/usr/lib/python2.7/tarfile.py\", line 2417, in _load", "    tarinfo = self.next()", "  File \"/usr/lib/python2.7/tarfile.py\", line 2348, in next", "    self.fileobj.seek(self.offset - 1)", "  File \"/usr/lib/python2.7/gzip.py\", line 443, in seek", "    self.read(1024)", "  File \"/usr/lib/python2.7/gzip.py\", line 268, in read", "    self._read(readsize)", "  File \"/usr/lib/python2.7/gzip.py\", line 315, in _read", "    self._read_eof()", "  File \"/usr/lib/python2.7/gzip.py\", line 354, in _read_eof", "    hex(self.crc)))", "IOError: CRC check failed 0x434b8799 != 0xb03aeb4L"], "stdout": "", "stdout_lines": []}

Don't panic, it just means that there's something wrong with the node prebuilt installation. And here are what you can do to fix it:

1. Clean up the node prebuilt directories:

$ sudo rm -rf /edx/app/edxapp/nodeenvs/edxapp/*

2. Install the node prebuilt manually:

$ sudo /edx/app/edxapp/venvs/edxapp/bin/nodeenv /edx/app/edxapp/nodeenvs/edxapp --node=6.11.1 --prebuilt --force

3. Re-run the installation script (e.g. this) and don't forget to append the --limit parameter:

...
cd /var/tmp/configuration/playbooks && sudo -E ansible-playbook -c local ./edx_sandbox.yml -i "localhost," $EXTRA_VARS "$@" --limit @/var/tmp/configuration/playbooks/edx_sanbox.retry

4. Enjoy

Comments