I found what appears to a problem when Stata 13.1 (both Windows and Linux) installs directly from Github (where I have a personal package repository). FYI you can do this with Stata >=13 by specifying
. net install <package>, from (https://raw.githubusercontent.com/<user>/<repo>/master/<folder of package>/)
Whenever a toc or pkg file was initially below 105 bytes then Stata would throw "r(1)" errors. Stata had no problems when these files were served from a simple personal webserver (normal http). I'm not sure if it's https that causes the problem or something with Github. Oddly, after make one of the files larger, I could then reduce its size to below the threshold and install again. Thankfully, this problem is easy to work around, just be more verbose in your toc/pkg files.
. net install <package>, from (https://raw.githubusercontent.com/<user>/<repo>/master/<folder of package>/)
Whenever a toc or pkg file was initially below 105 bytes then Stata would throw "r(1)" errors. Stata had no problems when these files were served from a simple personal webserver (normal http). I'm not sure if it's https that causes the problem or something with Github. Oddly, after make one of the files larger, I could then reduce its size to below the threshold and install again. Thankfully, this problem is easy to work around, just be more verbose in your toc/pkg files.