Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DBException: database or disk is full - Should stop the scan #5343

Closed
6 tasks done
1d3df9903ad opened this issue Sep 28, 2014 · 0 comments
Closed
6 tasks done

DBException: database or disk is full - Should stop the scan #5343

1d3df9903ad opened this issue Sep 28, 2014 · 0 comments

Comments

@1d3df9903ad
Copy link

Goals

  • The scan should stop without crashing
  • A message should be shown to the user explaining that he has no disk space left

Tasks

  • Add a global free disk space check that's triggered when there is 50mb of disk space left on the partition where the HTTP cache and DB is saved. Note that I said "global", this means that it's not tied to the DBMS.
  • The check should run once every N requests
  • When it fails it should raise a IOError and end up in w3afCore.py error handling for no disk space left:
        except IOError as (error_id, error_msg):
            # https://github.com/andresriancho/w3af/issues/9653
            # IOError: [Errno 28] No space left on device
            if error_id == errno.ENOSPC:
                msg = ('The w3af scan will stop because the file system'
                       ' is running low on free space. Check the "%s" directory'
                       ' size, overall disk usage and start the scan again.')
                msg %= get_home_dir()

                print(msg)
                om.out.error(msg)
            else:
                raise
  • Verify that the fix prevents the current issue (note that it's on the GUI!)

Version Information

  Python version: 2.7.3 (default, Mar 14 2014, 17:55:54) [GCC 4.6.3]
  GTK version: 2.24.10
  PyGTK version: 2.24.0
  w3af version:
    w3af - Web Application Attack and Audit Framework
    Version: 1.6.0.5
    Revision: 880379b54b - 26 Sep 2014 18:32
    Branch: master
    Local changes: No
    Author: Andres Riancho and the w3af team.

Traceback

Traceback (most recent call last):
  File "/home/user/w3af/w3af/core/ui/gui/tabs/log/graph.py", line 88, in draw_handler
    reset = self._redraw_gen.next()
  File "/home/user/w3af/w3af/core/ui/gui/tabs/log/graph.py", line 119, in _redraw_all
    if len(self.all_messages) < 2:
  File "/home/user/w3af/w3af/core/data/db/disk_list.py", line 247, in __len__
    r = self.db.select_one(query)
  File "/home/user/w3af/w3af/core/data/db/dbms.py", line 51, in inner_verify_started
    return meth(self, *args, **kwds)
  File "/home/user/w3af/w3af/core/data/db/dbms.py", line 119, in select_one
    return self.select(query, parameters)[0]
  File "/home/user/w3af/w3af/core/data/db/dbms.py", line 51, in inner_verify_started
    return meth(self, *args, **kwds)
  File "/home/user/w3af/w3af/core/data/db/dbms.py", line 110, in select
    return future.result()
  File "/usr/lib/pymodules/python2.7/concurrent/futures/_base.py", line 405, in result
    return self.__get_result()
  File "/usr/lib/pymodules/python2.7/concurrent/futures/_base.py", line 357, in __get_result
    raise self._exception
DBException: database or disk is full
@andresriancho andresriancho changed the title [Auto-Generated] Bug Report - DBException: database or disk is full DBException: database or disk is full - Should stop the scan Sep 28, 2014
@andresriancho andresriancho added this to the 1.6.1 - Bug fixing after 1.6 milestone Sep 28, 2014
@andresriancho andresriancho self-assigned this Mar 4, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants