HDFGroup / h5serv

Reference service implementation of the HDF5 REST API
Other
168 stars 35 forks source link

h5serv crashes when visiting localhost:5000 on Windows 10 #108

Open jakehockey10 opened 7 years ago

jakehockey10 commented 7 years ago

I have successfully installed and made use of h5serv in an ubuntu environment, and now I'm testing my application on windows 10.

Since Windows caught it and asked if I wanted to close the program, I figured something would be in Event Viewer. It looks like GitHub won't accept .evtx uploads, so here are the pertinent events in chronological order:

Error
---
Faulting application name: python.exe, version: 0.0.0.0, time stamp: 0x5773f233
Faulting module name: ntdll.dll, version: 10.0.14986.1000, time stamp: 0xd8fc5bf5
Exception code: 0xc0000005
Fault offset: 0x0000000000027caf
Faulting process id: 0x6450
Faulting application start time: 0x01d292aeb264d5cd
Faulting application path: C:\Users\j.smith\AppData\Local\Continuum\Anaconda2\python.exe
Faulting module path: C:\WINDOWS\SYSTEM32\ntdll.dll
Report Id: 29cee647-4a48-4794-abcd-8a7ea791a2e0
Faulting package full name: 
Faulting package-relative application ID: 
Information
---
Fault bucket 129147852250, type 5
Event Name: FaultTolerantHeap
Response: Not available
Cab Id: 0

Problem signature:
P1: python.exe
P2: 0.0.0.0
P3: 5773F233
P4: ffffbaad
P5: 
P6: 
P7: 
P8: 
P9: 
P10: 

Attached files:
\\?\C:\WINDOWS\SERVIC~2\LOCALS~1\AppData\Local\Temp\FTH7487.tmp\fthempty.txt
\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER7488.tmp.WERInternalMetadata.xml
\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER7497.tmp.csv
\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER74A7.tmp.txt

These files may be available here:

Analysis symbol: 
Rechecking for solution: 0
Report Id: c2a87d5d-494d-49d3-9d30-848759bc0d78
Report Status: 268435456
Hashed bucket: bc2c91fa4239500bd33d0163641402ff
Information
---
Fault bucket 120692878930, type 4
Event Name: APPCRASH
Response: Not available
Cab Id: 120591702485

Problem signature:
P1: python.exe
P2: 0.0.0.0
P3: 5773f233
P4: ntdll.dll
P5: 10.0.14986.1000
P6: d8fc5bf5
P7: c0000005
P8: 0000000000027caf
P9: 
P10: 

Attached files:
\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER7562.tmp.WERInternalMetadata.xml
\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER7564.tmp.csv
\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER7584.tmp.txt
\\?\C:\Users\j.smith\AppData\Local\Temp\WER81A7.tmp.appcompat.txt
memory.hdmp

These files may be available here:
C:\ProgramData\Microsoft\Windows\WER\ReportArchive\AppCrash_python.exe_d656b191173b77222d523132734b1d6878e6da_46b01868_cab_5ac2a0a8

Analysis symbol: 
Rechecking for solution: 0
Report Id: 29cee647-4a48-4794-abcd-8a7ea791a2e0
Report Status: 268435464
Hashed bucket: bb86804631c5701c681dbfef86b7b806

Any and all help is appreciated. I'm trying to get something that will run on both environments because Ubuntu is pleasant when working, for me, but I'm trying get a lunch and learn together at my work (Windows shop).

jreadey commented 7 years ago

That's odd. Do you see any output in the server console window?

Please paste the result of running "Pip freeze" at the anaconda prompt.

BTW, I'm traveling this week, so likely won't be able to investigate further till next week.

jakehockey10 commented 7 years ago

@jreadey Thanks for the quick response :)

here is the entire anaconda prompt from running to crashing:

(C:\Users\j.smith\AppData\Local\Continuum\Anaconda2) C:\Users\j.smith\Work\h5serv\server>python app.py
Warning! ***HDF5 library version mismatched error***
The HDF5 header files used to compile this application do not match
the version used by the HDF5 library to which this application is linked.
Data corruption or segmentation faults may occur if the application continues.
This can happen when an application was compiled by one version of HDF5 but
linked with a different version of static or shared HDF5 library.
You should recompile the application or check your shared library related
settings such as 'LD_LIBRARY_PATH'.
'HDF5_DISABLE_VERSION_CHECK' environment variable is set to 1, application will
continue at your own risk.
Headers are 1.8.15, library is 1.8.17
      SUMMARY OF THE HDF5 CONFIGURATION
      =================================

General Information:
-------------------
                   HDF5 Version: 1.8.17
                  Configured on: 2016-05-10
                  Configured by: Visual Studio 12 2013 Win64
                 Configure mode: CMAKE 3.4.0
                    Host system: Windows-6.1.7601
              Uname information: Windows
                       Byte sex: little-endian
                      Libraries:
             Installation point: C:/Program Files/HDF_Group/HDF5/1.8.17

Compiling Options:
------------------
               Compilation Mode: RelWithDebInfo
                     C Compiler: C:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin/x86_amd64/cl.exe
                         CFLAGS:  /DWIN32 /D_WINDOWS /W3
                      H5_CFLAGS:
                      AM_CFLAGS:
                       CPPFLAGS:
                    H5_CPPFLAGS:
                    AM_CPPFLAGS:
               Shared C Library: YES
               Static C Library: YES
  Statically Linked Executables: OFF
                        LDFLAGS:  /machine:x64
                     AM_LDFLAGS:
                Extra libraries: zlib-static;szip-static
                       Archiver:
                         Ranlib:
              Debugged Packages:
                    API Tracing: OFF

Languages:
----------
                        Fortran: ON
               Fortran Compiler: C:/Program Files (x86)/Intel/Composer XE 2015/bin/intel64/ifort.exe
          Fortran 2003 Compiler: ON
                  Fortran Flags:  /W1 /nologo /fpp /libs:dll /threads
               H5 Fortran Flags:
               AM Fortran Flags:
         Shared Fortran Library: YES
         Static Fortran Library: YES

                            C++: ON
                   C++ Compiler: C:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin/x86_amd64/cl.exe
                      C++ Flags:  /DWIN32 /D_WINDOWS /W3 /GR /EHsc
                   H5 C++ Flags:
                   AM C++ Flags:
             Shared C++ Library: YES
             Static C++ Library: YES

Features:
---------
                  Parallel HDF5: OFF
             High Level library: ON
                   Threadsafety: OFF
            Default API Mapping: v18
 With Deprecated Public Symbols: ON
         I/O filters (external):  DEFLATE DECODE ENCODE
                            MPE:
                     Direct VFD:
                        dmalloc:
Clear file buffers before write: ON
           Using memory checker: OFF
         Function Stack Tracing: OFF
      Strict File Format Checks: OFF
   Optimization Instrumentation:
('Using logfile: ', '../log/h5serv.log')
('password_uri config:', '../util/admin/passwd.h5')
Setting log level to: INFO
INFO:app.py:3217::log test
('dirname path:', '')
('favicon_path:', 'favicon.ico')
Static content in the path:../static will be displayed via the url: /views/(.*)
('isdebug:', True)
('domain:', 'hdfgroup.org')
('ssl_port:', 6050)
('Setting watchdog on: ', '../data/')
INFO:passwordUtil.py:56::getAuthClient
INFO:passwordUtil.py:58::password_uri:../util/admin/passwd.h5
INFO:authFile.py:36::AuthFile class init(../util/admin/passwd.h5)
INFO:app.py:3269::INITIALIZING...
INFO:app.py:3270::Starting event loop on port: 5000
Starting event loop on port: 5000
INFO:app.py:284::getFilePath: localhost:5000 checkExists: True
INFO:app.py:286::tocFilePath: ../data/.toc.h5
INFO:app.py:321::verifyFile: ../data/.toc.h5
INFO:fileUtil.py:266::verifyFile('../data/.toc.h5', False)
INFO:app.py:188::baseHandler, href: http://localhost:5000
INFO:app.py:194::REQ GET http://localhost:5000/ {remote_ip: ::1}
INFO:hdf5db.py:163::init -- filePath: ../data/.toc.h5 mode: r+
INFO:hdf5db.py:194::Hdf5db __enter
INFO:hdf5db.py:548::initializing file

(C:\Users\j.smith\AppData\Local\Continuum\Anaconda2) C:\Users\j.smith\Work\h5serv\server>

Here is the result of pip freeze:

(C:\Users\j.smith\AppData\Local\Continuum\Anaconda2) C:\Users\j.smith\Work\h5serv\server>pip freeze
alabaster==0.7.9
anaconda-clean==1.0
anaconda-client==1.5.1
anaconda-navigator==1.3.1
argcomplete==1.0.0
argh==0.26.2
astroid==1.4.7
astropy==1.2.1
Babel==2.3.4
backports-abc==0.4
backports.shutil-get-terminal-size==1.0.0
backports.ssl-match-hostname==3.4.0.2
beautifulsoup4==4.5.1
bitarray==0.8.1
blaze==0.10.1
bokeh==0.12.2
boto==2.42.0
Bottleneck==1.1.0
cdecimal==2.3
cffi==1.7.0
chest==0.2.3
click==6.6
cloudpickle==0.2.1
clyent==1.2.2
colorama==0.3.7
comtypes==1.1.2
conda==4.2.9
conda-build==2.0.2
configobj==5.0.6
configparser==3.5.0
contextlib2==0.5.3
cryptography==1.5
cycler==0.10.0
Cython==0.24.1
cytoolz==0.8.0
dask==0.11.0
datashape==0.5.2
decorator==4.0.10
dill==0.2.5
docutils==0.12
enum34==1.1.6
et-xmlfile==1.0.1
fastcache==1.0.2
filelock==2.0.6
Flask==0.11.1
Flask-Cors==2.1.2
funcsigs==1.0.2
functools32==3.2.3.post2
futures==3.0.5
gevent==1.1.2
greenlet==0.4.10
grin==1.2.1
h5json==1.1.0
h5py==2.6.0
h5serv==1.2.0
HeapDict==1.0.0
idna==2.1
imagesize==0.7.1
ipaddress==1.0.16
ipykernel==4.5.0
ipython==5.1.0
ipython-genutils==0.1.0
ipywidgets==5.2.2
itsdangerous==0.24
jdcal==1.2
jedi==0.9.0
Jinja2==2.8
jsonschema==2.5.1
jupyter==1.0.0
jupyter-client==4.4.0
jupyter-console==5.0.0
jupyter-core==4.2.0
lazy-object-proxy==1.2.1
llvmlite==0.13.0
locket==0.2.0
lxml==3.6.4
MarkupSafe==0.23
matplotlib==1.5.3
menuinst==1.4.1
mistune==0.7.3
mpmath==0.19
multipledispatch==0.4.8
nb-anacondacloud==1.2.0
nb-conda==2.0.0
nb-conda-kernels==2.0.0
nbconvert==4.2.0
nbformat==4.1.0
nbpresent==3.0.2
networkx==1.11
nltk==3.2.1
nose==1.3.7
notebook==4.2.3
numba==0.28.1+0.gfe99fbc.dirty
numexpr==2.6.1
numpy==1.11.1
odo==0.5.0
openpyxl==2.3.2
pandas==0.18.1
partd==0.3.6
path.py==0.0.0
pathlib2==2.1.0
pathtools==0.1.2
patsy==0.4.1
pep8==1.7.0
pickleshare==0.7.4
Pillow==3.3.1
pkginfo==1.3.2
ply==3.9
prompt-toolkit==1.0.3
psutil==4.3.1
py==1.4.31
pyasn1==0.1.9
pycosat==0.6.1
pycparser==2.14
pycrypto==2.6.1
pycurl==7.43.0
pyflakes==1.3.0
Pygments==2.1.3
pylint==1.5.4
pyOpenSSL==16.0.0
pyparsing==2.1.4
pytest==2.9.2
python-dateutil==2.5.3
pytz==2016.6.1
pywin32==220
PyYAML==3.12
pyzmq==15.4.0
QtAwesome==0.3.3
qtconsole==4.2.1
QtPy==1.1.2
requests==2.11.1
rope==0.9.4
ruamel-yaml===-VERSION
scikit-image==0.12.3
scikit-learn==0.17.1
scipy==0.18.1
simplegeneric==0.8.1
singledispatch==3.4.0.3
six==1.10.0
snowballstemmer==1.2.1
sockjs-tornado==1.0.3
sphinx==1.4.6
spyder==3.0.0
SQLAlchemy==1.0.13
statsmodels==0.6.1
sympy==1.0
tables==3.2.2
toolz==0.8.0
tornado==4.4.1
traitlets==4.3.0
unicodecsv==0.14.1
watchdog==0.8.3
wcwidth==0.1.7
Werkzeug==0.11.11
widgetsnbextension==1.2.6
win-unicode-console==0.5
wrapt==1.10.6
xlrd==1.0.0
XlsxWriter==0.9.3
xlwings==0.10.0
xlwt==1.1.2
You are using pip version 8.1.2, however version 9.0.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

(C:\Users\j.smith\AppData\Local\Continuum\Anaconda2) C:\Users\j.smith\Work\h5serv\server>

Also, that warning at the bottom is something I can't seem to get rid of. I run the upgrade command and it tells me I can't upgrade any further but then continues warning me about being outdated for pip. Unrelated, I'm assuming, though.

jreadey commented 7 years ago

The HDF5 library version mismatch looks a little concerning. It seems you are picking up a different version of the HDF5 lib that is installed by Anaconda.

Can you do an install on a clean Windows 10 system?

jakehockey10 commented 7 years ago

I can try to do that soon. Will try to find the time/resources to do that as soon as possible. I'm sorry if this is a silly question, but I wasn't able to understand which version was coming from where. Is h5serv the one using the newer version?

jreadey commented 7 years ago

h5serv will use whatever hdf5lib h5py is using. If you installed h5py via Anaconda, typically the HDF5 library binary will go to something like ~/anaconda/envs/h5srv/lib/.

If h5py got built (by the good folks at Continuum) with a different library version than your system is seeing, there will be problems.

jakehockey10 commented 7 years ago

@jreadey another silly question coming your way: where would the version that my system is seeing come from? I didn't think HDF5 was an installation. What are some ways to understand what different versions my environment is "aware of" and where those versions are living on my filesystem?

By the way, a clean Windows 10 VM using Anaconda all the way through to install all the dependent modules has resulted in me not having this issue on that machine. One thing I noted was that the first time I visited localhost:5000 on the vm after starting the server was that Windows popped up that dialog that asks for permission to do something. This VM is up in Azure, but when I try it on my local machine, I'm wondering if my IT group has yet another hoop for me to jump through to get my work done.... the reason I went to installing all this stuff manually was to 1) learn and 2) avoid a similar issue I was having with the Docker installation. Docker would start, but anytime I made a request, it would explode.

Any idea how I can determine what's killing these processes if nothing obvious is showing in Event Viewer?

jreadey commented 7 years ago

@jakehockey10 On Windows I think it is just the PATH environment variable that is used for the library search. So if after you do that Anaconda activate, if there is any dll in your PATH before the directory with the h5py-installed version of hdf5lib, that will get picked up (this most be where the phrase "DLL Hell" originated!). One thing I've started to do is to run apps and service via docker whenever possible. Of course if you are trying to make things easy for others, Docker setup will be another hurdle to go through.

I'm not sure what you can do for diagnostics other than capturing whatever the server puts out before it crashes. H5serv does write to a log file ("h5serv.log"), you can find it in the log directory of the h5serv project.

jakehockey10 commented 7 years ago

@jreadey I will double check my Path variable. I've had this workstation for years, so I likely have a pretty "muddy" environment in terms of how large my Path variable is.

I really like the convenience of the docker solution, but the crash happens in docker for me too.

Here is the content of the log file immediately after the crash (doesn't seem to know what happened):

2017-03-02 10:55:07,030:INFO:app.py:3217::log test
2017-03-02 10:55:07,059:INFO:passwordUtil.py:56::getAuthClient
2017-03-02 10:55:07,059:INFO:passwordUtil.py:58::password_uri:../util/admin/passwd.h5
2017-03-02 10:55:07,062:INFO:authFile.py:36::AuthFile class init(../util/admin/passwd.h5)
2017-03-02 10:55:07,062:INFO:app.py:3269::INITIALIZING...
2017-03-02 10:55:07,063:INFO:app.py:3270::Starting event loop on port: 5000
2017-03-02 10:55:12,335:INFO:app.py:284::getFilePath: localhost:5000 checkExists: True
2017-03-02 10:55:12,335:INFO:app.py:286::tocFilePath: ../data/.toc.h5
2017-03-02 10:55:12,338:INFO:app.py:321::verifyFile: ../data/.toc.h5
2017-03-02 10:55:12,338:INFO:fileUtil.py:266::verifyFile('../data/.toc.h5', False)
2017-03-02 10:55:12,338:INFO:app.py:188::baseHandler, href: http://localhost:5000
2017-03-02 10:55:12,339:INFO:app.py:194::REQ GET http://localhost:5000/ {remote_ip: ::1}
2017-03-02 10:55:12,339:INFO:hdf5db.py:163::init -- filePath: ../data/.toc.h5 mode: r+
2017-03-02 10:55:12,345:INFO:hdf5db.py:194::Hdf5db __enter
2017-03-02 10:55:12,348:INFO:hdf5db.py:548::initializing file
2017-03-02 13:35:03,556:INFO:app.py:3217::log test
2017-03-02 13:35:03,578:INFO:passwordUtil.py:56::getAuthClient
2017-03-02 13:35:03,578:INFO:passwordUtil.py:58::password_uri:../util/admin/passwd.h5
2017-03-02 13:35:03,579:INFO:authFile.py:36::AuthFile class init(../util/admin/passwd.h5)
2017-03-02 13:35:03,581:INFO:app.py:3269::INITIALIZING...
2017-03-02 13:35:03,581:INFO:app.py:3270::Starting event loop on port: 5000
2017-03-02 13:35:10,042:INFO:app.py:284::getFilePath: localhost:5000 checkExists: True
2017-03-02 13:35:10,042:INFO:app.py:286::tocFilePath: ../data/.toc.h5
2017-03-02 13:35:10,046:INFO:app.py:321::verifyFile: ../data/.toc.h5
2017-03-02 13:35:10,048:INFO:fileUtil.py:266::verifyFile('../data/.toc.h5', False)
2017-03-02 13:35:10,048:INFO:app.py:188::baseHandler, href: http://localhost:5000
2017-03-02 13:35:10,049:INFO:app.py:194::REQ GET http://localhost:5000/ {remote_ip: ::1}
2017-03-02 13:35:10,049:INFO:hdf5db.py:163::init -- filePath: ../data/.toc.h5 mode: r+
2017-03-02 13:35:10,059:INFO:hdf5db.py:194::Hdf5db __enter
2017-03-02 13:35:10,063:INFO:hdf5db.py:548::initializing file