Heroku ZipImportError: bad local file header - heroku

I keep running into this strange Heroku build error. If I mess around with the ordering of my requirements.txt then the package that fails to build will change, but the build always ends with the exceptions:
ZipImportError: bad local file header in /app/.heroku/python/lib/python2.7/site-packages/setuptools-2.1-py2.7.egg
And
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 38: ordinal not in range(128)
You can see a full build log here: http://pastebin.com/BYw3Xp6u
Anyone know what's going on here?

I was facing the same problem (bad local file header), it seems they have an issue with the new python buildpack.
So you can use the previous version of the buildpack by adding a config var :
heroku config:set BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-python.git#5f96190eb5ccd05b90947f9a77d7ef0881816ef8
It should temporarily solve the problem.

Related

How to get a more relevant stacktrace (file name and line number) for hhvm fatal error?

I have a legacy hhvm restful api.
I made some changes to its code base and now my local server throws:
Syntax only allowed in Hack files (<?hh) or with -v
Eval.EnableHipHopSyntax=true
My current hhvm specific setting inside my php.ini is:
; hhvm specific
hhvm.log.level = Warning
hhvm.log.always_log_unhandled_exceptions = true
hhvm.log.runtime_error_reporting_level = 8191
hhvm.mysql.typed_results = false
date.timezone="Europe/Berlin"
hhvm.libxml.ext_entity_whitelist = file,http
I checked the log at
cat /var/log/hhvm/error.log
Yet it is empty.
I do not want to allow hack file syntax but I do want more relevant information on where the error is occurring.
I want to at least know in which file I created the error. Nice to have would be in which line and at which character position within that line occurs. The api is internal, so I do not mind to expose that information for now.
Right now I am going through the git diff, and that is not a very effective way of finding the offending code.
This won't expose the error to the server response but check your sandbox settings.
The error log may be in your hhvm sandbox, not inside the main hhvm folder:
/var/log/hhvm/sandbox/error.log
There you will find the relevant information with the error's context:
[Mon May 13 15:40:32 2019] [hphp] [25:7fe693fff700:413:000001] [] \nFatal error: Syntax only allowed in Hack files (<?hh) or with -v Eval.EnableHipHopSyntax=true in /var/www/service/src/Dreamlines/BookingService/Bundle/OperatorBundle/Soap/Call/CallBuilderFactory.php on line 177

Accessing VIM in Digital Ocean cuts off part of file

I tried running grunt to run a MEAN web app and received an ILLEGAL TOKEN in lodash.js, a file which has ~4000 lines. I went to debug the error on line 2220 and received a different syntax error on line 2238, but the VIM editor in Digital Ocean says that the file is only 2228 lines, and even using 'G' to get to the end of the file takes me to 2228. How do I access the rest of the file to debug when the editor thinks that the file is only 2228 lines?
Bug was related to some dependencies not being resolved in npm install. Issue resolved by increasing RAM of droplet.

compiling error when using community golang buildpack on bluemix

One of my bluemix application worked for weeks but it start to report parse error with Buildpack compilation step failed when pushing app to bluemix:
-----> Downloaded app package (556K)
Cloning into '/tmp/buildpacks/buildpack-go'...
Submodule 'compile-extensions' (https://github.com/cloudfoundry-incubator/compile-extensions.git) registered for path 'compile-extensions'
Cloning into 'compile-extensions'...
Submodule path 'compile-extensions': checked out 'f752ecf4b27d2f31bb082dfe7a47c76fefc769d7'
-------> Buildpack version 1.4.0
parse error: Expected separator between values at line 32, column 3
Staging failed: Buildpack compilation step failed
Here's my manifest.yml file:
---
applications:
- name: joystick
memory: 128M
path: .
buildpack: https://github.com/cloudfoundry/buildpack-go.git
Update: I carefully read the error message and figured out it is application space problem caused by Godeps.json parsing error caused by code merging where one comma is missed. I can not reproduce this locally because I checked in _workspace directory where it never parse Godeps.json.
I created issue 86 to improve this buildpack to provide more information for such kind of error message.
The error message parse error: Expected separator between values at line 32, column 3 comes from jq command within buildpack code, where it tries to read import path from Godeps/Godeps.json by assuming it's a valid JSON file. see line #64 of /bin/compile.
It will stop buildpack if the Godeps.json is not json.
I created issue 86 to improve this buildpack to provide more information for such kind of error message.
Thanks for everyone who spent time on this problem.
Update: issue 86 was fixed in heroku golang buildpack by adding new step to checking Godeps.json format.

Compilation failed with java.lang.StackOverflowError

Probably due to the following bug - https://play.lighthouseapp.com/projects/82401/tickets/613-stack-overflow-exception-while-trying-to-compile Play 2 project failed to compile when route file becomes larger.
There is the workaround to increase default thread stack size. But this does not work on Heroku. I do not know is it possible to inrease stack size used on Heroku to something that is more than 512k, change of JAVA_OPTS and SBT_OPTS to -Xss2m does not help.
Compilation failed with exception java.lang.StackOverflowError.
Maybe anyone can suggest a workaround to resolve this issue?
Ok. The solution is found.
Stack size should be changed not in config params but in buildpack instead.
To anyone having the same exception on Heroku: just fork buildpack and change line 95 adding +Xss2m to it

After porting some php and web app related files from my friend's windows computer to my mac I'm getting some errors

This is for a facebook app being run on heroku, but heroku is probably not the issue. The issue is either some kind of cache related thing, os porting, or I'm thinking it might be a carriage return issue.
In any case I'm getting a couple errors at the top and bottom respectively:
Warning: Unknown:
Warning: session_start(): open(C:\ProgramData\Jcx.Software\VS.Php\2.10.6970.0\temp/sess_i4ood4poc11ebsgth000g1nm74, O_RDWR) failed: No such file or directory (2) in /app/www/sdk/src/facebook.php on line 37
Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /app/www/sdk/src/facebook.php:37) in /app/www/sdk/src/facebook.php on line 37
open(C:\ProgramData\Jcx.Software\VS.Php\2.10.6970.0\temp/sess_i4ood4poc11ebsgth000g1nm74, O_RDWR) failed: No such file or directory (2) in Unknown on line 0 Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (C:\ProgramData\Jcx.Software\VS.Php\2.10.6970.0\temp) in Unknown on line 0
Essentially I have tried the whole "making sure session is at the top thing," but I don't have that session piece of code in any of the files. I have tried the whole making sure "?>" is on a new line as well to no effect.
update
I have discovered something called:
zend_extension_ts="C:\Program Files (x86)\Jcx.Software\VS.Php\2010\php 5.2\ext\php_xdebug.dll"
within a file called php.ini which even after I tried to get rid of didn't seem to change anything. So, I'm thinking this has something to do with some previous files that I pushed and then removed with extensions like puo, intellisense.cache, projphp, etc.
I don't know if those are auto-generated or not, but in any case according to my errors:
There is some session data in a file called temp. I have no file named temp.
zend_extension_ts supposedly gets referenced somewhere, but it isn't visible in my code.
I apparently need to resend session cache limiter again through session_start() which is not visible in my code.
Is not the session , I'm sure. But there is directory path included in your code but that directory does not exist! Just refactor that part of the code first!
As a tip you should use realpath() and check if path exist before attempting to use it.
Hope this helps!

Resources