Skip to content

Internal server error, how to diagnose/rectify? #27

@monocongo

Description

@monocongo

I have profiled some code using the command

$ python -m cProfile -o report.prof script.py

I then launch cprofilev like so

$ cprofilev -f report.prof

When I go to the URL localhost I see a 500 error:

Error: 500 Internal Server Error
Sorry, the requested URL 'http://127.0.0.1:4000/' caused an error:

Internal Server Error

When I look at the console where the cprofilev was launched I see this:

Traceback (most recent call last):
  File "/home/james/miniconda3/envs/climate_profile/bin/bottle.py", line 862, in _handle
    return route.call(**args)
  File "/home/james/miniconda3/envs/climate_profile/bin/bottle.py", line 1740, in wrapper
    rv = callback(*a, **ka)
  File "/home/james/miniconda3/envs/climate_profile/lib/python3.6/site-packages/cprofilev.py", line 154, in route_handler
    self.stats = Stats(self.profile)
  File "/home/james/miniconda3/envs/climate_profile/lib/python3.6/site-packages/cprofilev.py", line 75, in __init__
    self.stats = pstats.Stats(self.profile, stream=self.stream)
  File "/home/james/miniconda3/envs/climate_profile/lib/python3.6/pstats.py", line 72, in __init__
    self.init(arg)
  File "/home/james/miniconda3/envs/climate_profile/lib/python3.6/pstats.py", line 86, in init
    self.load_stats(arg)
  File "/home/james/miniconda3/envs/climate_profile/lib/python3.6/pstats.py", line 100, in load_stats
    self.stats = marshal.load(f)
ValueError: bad marshal data (unknown type code)

The cprofilev package was installed into an Anaconda environment running Python 3.6.3 using pip install.

Can anyone advise as to how I can get past this issue? Thanks in advance for any assistance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions