Code Monkey home page Code Monkey logo

Comments (10)

jamiees2 avatar jamiees2 commented on July 29, 2024

Have you run ./ctftool database create-tables?

from coldcore.

noraj avatar noraj commented on July 29, 2024

Added to the README : #23

from coldcore.

noraj avatar noraj commented on July 29, 2024

But now:

./ctftool challenges add problem.yml
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/peewee.py", line 3768, in execute_sql
    cursor.execute(sql, params or ())
sqlite3.IntegrityError: NOT NULL constraint failed: challenge.flag

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./ctftool", line 248, in <module>
    main()
  File "./ctftool", line 244, in main
    args.func(args)
  File "./ctftool", line 140, in add_challenge
    chal = Challenge.create(**yaml.load(f))
  File "/usr/lib/python3.6/site-packages/peewee.py", line 4915, in create
    inst.save(force_insert=True)
  File "/usr/lib/python3.6/site-packages/peewee.py", line 5108, in save
    pk_from_cursor = self.insert(**field_dict).execute()
  File "/usr/lib/python3.6/site-packages/peewee.py", line 3526, in execute
    cursor = self._execute()
  File "/usr/lib/python3.6/site-packages/peewee.py", line 2912, in _execute
    return self.database.execute_sql(sql, params, self.require_commit)
  File "/usr/lib/python3.6/site-packages/peewee.py", line 3775, in execute_sql
    self.commit()
  File "/usr/lib/python3.6/site-packages/peewee.py", line 3598, in __exit__
    reraise(new_type, new_type(*exc_args), traceback)
  File "/usr/lib/python3.6/site-packages/peewee.py", line 135, in reraise
    raise value.with_traceback(tb)
  File "/usr/lib/python3.6/site-packages/peewee.py", line 3768, in execute_sql
    cursor.execute(sql, params or ())
peewee.IntegrityError: NOT NULL constraint failed: challenge.flag

from coldcore.

jamiees2 avatar jamiees2 commented on July 29, 2024

sounds like you made a problem with an empty flag :(

from coldcore.

jamiees2 avatar jamiees2 commented on July 29, 2024

Ah, the sample problem.yml should be flag: not flags:

from coldcore.

noraj avatar noraj commented on July 29, 2024

#26

from coldcore.

noraj avatar noraj commented on July 29, 2024

@jamiees2

I changed flags: to flag: and that doesn't seem enough

$ ./ctftool challenges add problem.yml                                                                                                                                            shark@dev
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/peewee.py", line 3768, in execute_sql
    cursor.execute(sql, params or ())
sqlite3.IntegrityError: NOT NULL constraint failed: challenge.stage_id

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./ctftool", line 248, in <module>
    main()
  File "./ctftool", line 244, in main
    args.func(args)
  File "./ctftool", line 140, in add_challenge
    chal = Challenge.create(**yaml.load(f))
  File "/usr/lib/python3.6/site-packages/peewee.py", line 4915, in create
    inst.save(force_insert=True)
  File "/usr/lib/python3.6/site-packages/peewee.py", line 5108, in save
    pk_from_cursor = self.insert(**field_dict).execute()
  File "/usr/lib/python3.6/site-packages/peewee.py", line 3526, in execute
    cursor = self._execute()
  File "/usr/lib/python3.6/site-packages/peewee.py", line 2912, in _execute
    return self.database.execute_sql(sql, params, self.require_commit)
  File "/usr/lib/python3.6/site-packages/peewee.py", line 3775, in execute_sql
    self.commit()
  File "/usr/lib/python3.6/site-packages/peewee.py", line 3598, in __exit__
    reraise(new_type, new_type(*exc_args), traceback)
  File "/usr/lib/python3.6/site-packages/peewee.py", line 135, in reraise
    raise value.with_traceback(tb)
  File "/usr/lib/python3.6/site-packages/peewee.py", line 3768, in execute_sql
    cursor.execute(sql, params or ())
peewee.IntegrityError: NOT NULL constraint failed: challenge.stage_id

from coldcore.

jamiees2 avatar jamiees2 commented on July 29, 2024

Ok yes, so the problem there is that we added stages to the platform, which allow you to group problems together in a group, for example for a beginner stage.

You need to create a stage.yml like this:

name: Test stage
alias: test
description: 

and then add at the end of problem.yml

stage: test

from coldcore.

jamiees2 avatar jamiees2 commented on July 29, 2024

stage.yml can be in the same folder as the problem.yml or in the above structure, for IceCTF 2016 we used the following structure:

stages/
  stage1/
    stage.yml
    problem1/
      problem.yml
      ....
    problem2/
      problem.yml
      ....
  stage2/
    stage.yml
    ....

Then run ./ctftool challenges scan stages

from coldcore.

jamiees2 avatar jamiees2 commented on July 29, 2024

I apologize for the bad docs, this was all done in a bit of a hurry.

from coldcore.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.