crytic / crytic/slither

[Bug-Candidate]: slither . doesn't work on Docker image with error message KeyError: 'ast'

Open
#1,391 1 comment 0 reactions 0 assignees View on GitHub
bug-candidate Need more info
Dominant language
Python
Stars
6.4k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

### Describe the issue:

I ran
```bash
docker run -it -v :/share trailofbits/eth-security-toolbox
```

then within the container, in the ```/share``` folder I ran
```slither .```

I got the following error message

```
Traceback (most recent call last):
File "/home/ethsec/.local/lib/python3.6/site-packages/slither/__main__.py", line 744, in main_impl
) = process_all(filename, args, detector_classes, printer_classes)
File "/home/ethsec/.local/lib/python3.6/site-packages/slither/__main__.py", line 76, in process_all
compilations = compile_all(target, **vars(args))
File "/home/ethsec/.local/lib/python3.6/site-packages/crytic_compile/crytic_compile.py", line 637, in compile_all
compilations.append(CryticCompile(target, **kwargs))
File "/home/ethsec/.local/lib/python3.6/site-packages/crytic_compile/crytic_compile.py", line 117, in __init__
self._compile(**kwargs)
File "/home/ethsec/.local/lib/python3.6/site-packages/crytic_compile/crytic_compile.py", line 548, in _compile
self._platform.compile(self, **kwargs)
File "/home/ethsec/.local/lib/python3.6/site-packages/crytic_compile/platform/hardhat.py", line 177, in compile
compilation_unit.asts[path.absolute] = info["ast"]
KeyError: 'ast'
None
Error in .
Traceback (most recent call last):
File "/home/ethsec/.local/lib/python3.6/site-packages/slither/__main__.py", line 744, in main_impl
) = process_all(filename, args, detector_classes, printer_classes)
File "/home/ethsec/.local/lib/python3.6/site-packages/slither/__main__.py", line 76, in process_all
compilations = compile_all(target, **vars(args))
File "/home/ethsec/.local/lib/python3.6/site-packages/crytic_compile/crytic_compile.py", line 637, in compile_all
compilations.append(CryticCompile(target, **kwargs))
File "/home/ethsec/.local/lib/python3.6/site-packages/crytic_compile/crytic_compile.py", line 117, in __init__
self._compile(**kwargs)
File "/home/ethsec/.local/lib/python3.6/site-packages/crytic_compile/crytic_compile.py", line 548, in _compile
self._platform.compile(self, **kwargs)
File "/home/ethsec/.local/lib/python3.6/site-packages/crytic_compile/platform/hardhat.py", line 177, in compile
compilation_unit.asts[path.absolute] = info["ast"]
KeyError: 'ast'
```

I was able to replicate this by pip3 install and run on my local machine instead.

### Code example to reproduce the issue:

```bash
slither .
```

### Version:

0.8.3

### Relevant log output:

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.