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

Failed to build docker image for Defects4J benchmark #201

Open
brojackvn opened this issue Sep 27, 2024 · 12 comments
Open

Failed to build docker image for Defects4J benchmark #201

brojackvn opened this issue Sep 27, 2024 · 12 comments

Comments

@brojackvn
Copy link

brojackvn commented Sep 27, 2024

Hi @Marti2203 , I am trying to run an example to understand the flow of Cerberus. Here’s what I have done so far, step by step:

  1. Activated the source environment source activate
  2. Installed the required packages pip install -r requirements.txt in my environment.
  3. Ran the command: cerberus -task repair --tool=arja --benchmark=defects4j --bug-index=1.
    3.1. First, I received the following error message: "Could not get the submodule. Maybe the system asked for an SSH key, and it could not be provided." Instead of fixing this by adding an SSH key to GitHub, I traced the issue in the log file and ran git submodule update --init benchmark/defects4j manually, which resolved the error.
    3.2. Then, I encountered another error: "[error] Image was not built successfully. Please check whether the file builds outside of Cerberus." I am unsure why Cerberus cannot build the benchmark image. Here's the log output:
    [framework] loading benchmark defects4j Sep 27 22:54:49
    [framework] benchmark environment not found for defects4j-benchmark Sep 27 22:54:49
    [framework] building benchmark environment Sep 27 22:54:49
    [framework] building docker image defects4j-benchmark Sep 27 22:54:49
    Task repair failed Sep 27 22:55:38
    [error] Image was not built successfully. Please check whether the file builds outside of Cerberus Sep 27 22:55:38
    Error. Exiting... Sep 27 22:55:38
    Task repair failed Sep 27 22:55:38
    [error] unable to build image: unhandled exception Sep 27 22:55:38
    Runtime Error Sep 27 22:55:38
    Error. Exiting... Sep 27 22:55:38
    

Then I printed process of building image by adding a line of code "print(line["stream"])" at line 124 in container.py. I found an error here:

Get:129 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 software-properties-common all 0.99.9.12 [10.4 kB]
Get:130 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 unattended-upgrades all 2.3ubuntu0.3 [48.5 kB]
debconf: delaying package configuration, since apt-utils is not installed

Fetched 35.9 MB in 15s (2451 kB/s)
(Reading database ... 
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 4124 files and directories currently installed.)

Preparing to unpack .../libsystemd0_245.4-4ubuntu3.24_amd64.deb ...
Unpacking libsystemd0:amd64 (245.4-4ubuntu3.24) over (245.4-4ubuntu3.23) ...
Setting up libsystemd0:amd64 (245.4-4ubuntu3.24) ...
Selecting previously unselected package libssl1.1:amd64.
(Reading database ... 
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 4124 files and directories currently installed.)
Preparing to unpack .../libssl1.1_1.1.1f-1ubuntu2.23_amd64.deb ...
Unpacking libssl1.1:amd64 (1.1.1f-1ubuntu2.23) ...
Selecting previously unselected package libpython3.8-minimal:amd64.
Preparing to unpack .../libpython3.8-minimal_3.8.10-0ubuntu1~20.04.12_amd64.deb ...
Unpacking libpython3.8-minimal:amd64 (3.8.10-0ubuntu1~20.04.12) ...
Selecting previously unselected package libexpat1:amd64.
Preparing to unpack .../libexpat1_2.2.9-1ubuntu0.7_amd64.deb ...
Unpacking libexpat1:amd64 (2.2.9-1ubuntu0.7) ...
Selecting previously unselected package python3.8-minimal.
Preparing to unpack .../python3.8-minimal_3.8.10-0ubuntu1~20.04.12_amd64.deb ...
Unpacking python3.8-minimal (3.8.10-0ubuntu1~20.04.12) ...
Setting up libssl1.1:amd64 (1.1.1f-1ubuntu2.23) ...
debconf: unable to initialize frontend: Dialog
debconf: (TERM is not set, so the dialog frontend is not usable.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (Can't locate Term/ReadLine.pm in @INC (you may need to install the Term::ReadLine module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.30.0 /usr/local/share/perl/5.30.0 /usr/lib/x86_64-linux-gnu/perl5/5.30 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.30 /usr/share/perl/5.30 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 7.)
debconf: falling back to frontend: Teletype
Setting up libpython3.8-minimal:amd64 (3.8.10-0ubuntu1~20.04.12) ...
Setting up libexpat1:amd64 (2.2.9-1ubuntu0.7) ...
Setting up python3.8-minimal (3.8.10-0ubuntu1~20.04.12) ...
dpkg: error processing package python3.8-minimal (--configure):
 installed python3.8-minimal package post-installation script subprocess was killed by signal (Killed)
Errors were encountered while processing:
 python3.8-minimal
E: Sub-process /usr/bin/dpkg returned an error code (1)

Could you help me figure out how to resolve this issue?

Originally posted by @brojackvn in #156 (comment)

@brojackvn
Copy link
Author

brojackvn commented Sep 27, 2024

Hi @Marti2203, I built the benchmark Docker image in cerberus/benchmark/defects4j manually using git checkout master and docker build -t defects4j-benchmark .. I needed to check out the master branch because the meta-data.json is not compatible with the current version of Cerberus, and it was built successfully. However, I’m not sure what the exact root cause of the issue is.

After building docker image for Defects4J benchmark, I ran the command again: cerberus -task repair --tool=arja --benchmark=defects4j --bug-index=1, and then I encountered another error:
Screenshot 2024-09-28 at 02 21 32

@Marti2203
Copy link
Collaborator

Hi @brojackvn, I saw the issue. In the last version we have started using groups to allow sharing of files between container and tool. I will push a fix tomorrow for this. Apologies

@Marti2203
Copy link
Collaborator

Marti2203 commented Oct 1, 2024

Should be fixed now on master, In relation to the defects4j bug, I have to examine the problem later this week

@brojackvn
Copy link
Author

Thank you so much for your support.

I have encountered another error. Could you help me resolve it? I think there is still a bug in using the group
Screenshot 2024-10-01 at 23 20 01

@Marti2203
Copy link
Collaborator

Marti2203 commented Oct 1, 2024

Yes, I thought that group 100 was not defined... can you change the value in task/image.py to 999 and I will push a fix if it works.

@brojackvn
Copy link
Author

brojackvn commented Oct 1, 2024

Yeah. That's right. But when I changed it, I ran the command again cerberus -task repair --tool=arja --benchmark=defects4j --bug-index=1, and it automatically changed that Dockerfile. Then, the error appears.

@Marti2203
Copy link
Collaborator

Oh nono, I meant modifying the cerberus source code. The Dockerfile is automatically rebuilt

@brojackvn
Copy link
Author

Thank you, it worked.

@brojackvn
Copy link
Author

brojackvn commented Oct 2, 2024

460958637_1915319848989732_8096480363596497960_n

I encountered an error when running the Cardumen tool on Chart-1 of Defects4J and wonders if it indicates that the repair tool cannot fix the bug.

@brojackvn
Copy link
Author

brojackvn commented Oct 3, 2024

`reported by test-runner.

Test [Manual]TestMethod=org.jfree.data.xy.junit.TableXYDatasetTests#testEquals result was not reported by test-runner.

Test [Manual]TestMethod=org.jfree.chart.axis.junit.LogarithmicAxisTests#testAdjustedLog10 result was not reported by test-runner.

Tests found: 751

Tests executed: 719

Failing test cases was not passed as argument: we use the results from running them[]

Executing time Fault localization: 65 sec

Setting up the max to 655740 milliseconds (655 sec)
Exception in thread "main" java.lang.IllegalStateException: No suspicious line detected by the fault localization

at fr.inria.main.evolution.AstorMain.createEngine(AstorMain.java:105)
at fr.inria.main.evolution.AstorMain.run(AstorMain.java:160)
at fr.inria.main.evolution.AstorMain.execute(AstorMain.java:222)
at fr.inria.main.evolution.AstorMain.main(AstorMain.java:193)

`
This is a log of the above errors, which shows that spectrum FL cannot detect the suspicious buggy line. I wonder if I need to add any configurations for this repair tool or how to use perfect FL for this tool. (I see on Defects4J that this bug can be fixed by this tool)

@brojackvn
Copy link
Author

I found the error, which was caused by an incorrect configuration when using the Astor tool. I fixed it, and now it works

@brojackvn
Copy link
Author

Hi @Marti2203 , I am trying to run an example to understand the flow of Cerberus. Here’s what I have done so far, step by step:

  1. Activated the source environment source activate
  2. Installed the required packages pip install -r requirements.txt in my environment.
  3. Ran the command: cerberus -task repair --tool=arja --benchmark=defects4j --bug-index=1.
    3.1. First, I received the following error message: "Could not get the submodule. Maybe the system asked for an SSH key, and it could not be provided." Instead of fixing this by adding an SSH key to GitHub, I traced the issue in the log file and ran git submodule update --init benchmark/defects4j manually, which resolved the error.
    3.2. Then, I encountered another error: "[error] Image was not built successfully. Please check whether the file builds outside of Cerberus." I am unsure why Cerberus cannot build the benchmark image. Here's the log output:
    [framework] loading benchmark defects4j Sep 27 22:54:49
    [framework] benchmark environment not found for defects4j-benchmark Sep 27 22:54:49
    [framework] building benchmark environment Sep 27 22:54:49
    [framework] building docker image defects4j-benchmark Sep 27 22:54:49
    Task repair failed Sep 27 22:55:38
    [error] Image was not built successfully. Please check whether the file builds outside of Cerberus Sep 27 22:55:38
    Error. Exiting... Sep 27 22:55:38
    Task repair failed Sep 27 22:55:38
    [error] unable to build image: unhandled exception Sep 27 22:55:38
    Runtime Error Sep 27 22:55:38
    Error. Exiting... Sep 27 22:55:38
    

Then I printed process of building image by adding a line of code "print(line["stream"])" at line 124 in container.py. I found an error here:

Get:129 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 software-properties-common all 0.99.9.12 [10.4 kB]
Get:130 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 unattended-upgrades all 2.3ubuntu0.3 [48.5 kB]
debconf: delaying package configuration, since apt-utils is not installed

Fetched 35.9 MB in 15s (2451 kB/s)
(Reading database ... 
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 4124 files and directories currently installed.)

Preparing to unpack .../libsystemd0_245.4-4ubuntu3.24_amd64.deb ...
Unpacking libsystemd0:amd64 (245.4-4ubuntu3.24) over (245.4-4ubuntu3.23) ...
Setting up libsystemd0:amd64 (245.4-4ubuntu3.24) ...
Selecting previously unselected package libssl1.1:amd64.
(Reading database ... 
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 4124 files and directories currently installed.)
Preparing to unpack .../libssl1.1_1.1.1f-1ubuntu2.23_amd64.deb ...
Unpacking libssl1.1:amd64 (1.1.1f-1ubuntu2.23) ...
Selecting previously unselected package libpython3.8-minimal:amd64.
Preparing to unpack .../libpython3.8-minimal_3.8.10-0ubuntu1~20.04.12_amd64.deb ...
Unpacking libpython3.8-minimal:amd64 (3.8.10-0ubuntu1~20.04.12) ...
Selecting previously unselected package libexpat1:amd64.
Preparing to unpack .../libexpat1_2.2.9-1ubuntu0.7_amd64.deb ...
Unpacking libexpat1:amd64 (2.2.9-1ubuntu0.7) ...
Selecting previously unselected package python3.8-minimal.
Preparing to unpack .../python3.8-minimal_3.8.10-0ubuntu1~20.04.12_amd64.deb ...
Unpacking python3.8-minimal (3.8.10-0ubuntu1~20.04.12) ...
Setting up libssl1.1:amd64 (1.1.1f-1ubuntu2.23) ...
debconf: unable to initialize frontend: Dialog
debconf: (TERM is not set, so the dialog frontend is not usable.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (Can't locate Term/ReadLine.pm in @INC (you may need to install the Term::ReadLine module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.30.0 /usr/local/share/perl/5.30.0 /usr/lib/x86_64-linux-gnu/perl5/5.30 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.30 /usr/share/perl/5.30 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 7.)
debconf: falling back to frontend: Teletype
Setting up libpython3.8-minimal:amd64 (3.8.10-0ubuntu1~20.04.12) ...
Setting up libexpat1:amd64 (2.2.9-1ubuntu0.7) ...
Setting up python3.8-minimal (3.8.10-0ubuntu1~20.04.12) ...
dpkg: error processing package python3.8-minimal (--configure):
 installed python3.8-minimal package post-installation script subprocess was killed by signal (Killed)
Errors were encountered while processing:
 python3.8-minimal
E: Sub-process /usr/bin/dpkg returned an error code (1)

Could you help me figure out how to resolve this issue?

Originally posted by @brojackvn in #156 (comment)

However, this error occurs when I run certain bugs in Defects4J

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants