tshatrov / ichiran

Linguistic tools for texts in Japanese language
MIT License
307 stars 35 forks source link

Error while running test on docker #53

Closed theUnrealSamurai closed 1 month ago

theUnrealSamurai commented 1 month ago

Error Log

mits-mac-001@adominisutoretanoMacBook-Pro ~ % docker exec -it ichiran-main-1 test-suite
This is SBCL 2.2.4, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://www.sbcl.org/>.

SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses.  See the CREDITS and COPYING files in the
distribution for more information.
fatal error encountered in SBCL pid 663 tid 663:
premature end of core file

Output from Docker compose up

WARN[0000] /Users/mits-mac-001/Code/ichiran/docker-compose.yml: the attribute `version` is obsolete, it will be ignored, please remove it to avoid potential confusion 
[+] Running 3/3
 ✔ Network ichiran_default   Created                                                                                          0.0s 
 ✔ Container ichiran-pg-1    Created                                                                                          0.1s 
 ✔ Container ichiran-main-1  Created                                                                                          0.1s 
Attaching to main-1, pg-1
main-1  | Checking postgres server status...
pg-1    | The files belonging to this database system will be owned by user "postgres".
pg-1    | This user must also own the server process.
pg-1    | 
pg-1    | The database cluster will be initialized with locale "en_US.utf8".
pg-1    | The default database encoding has accordingly been set to "UTF8".
pg-1    | The default text search configuration will be set to "english".
pg-1    | 
pg-1    | Data page checksums are disabled.
pg-1    | 
pg-1    | fixing permissions on existing directory /var/lib/postgresql/data/pgdata ... ok
pg-1    | creating subdirectories ... ok
pg-1    | selecting dynamic shared memory implementation ... posix
pg-1    | selecting default max_connections ... 100
pg-1    | selecting default shared_buffers ... 128MB
pg-1    | selecting default time zone ... Etc/UTC
pg-1    | creating configuration files ... ok
pg-1    | running bootstrap script ... ok
pg-1    | performing post-bootstrap initialization ... ok
pg-1    | initdb: warning: enabling "trust" authentication for local connections
pg-1    | initdb: hint: You can change this by editing pg_hba.conf or using the option -A, or --auth-local and --auth-host, the next time you run initdb.
pg-1    | syncing data to disk ... ok
pg-1    | 
pg-1    | 
pg-1    | Success. You can now start the database server using:
pg-1    | 
pg-1    |     pg_ctl -D /var/lib/postgresql/data/pgdata -l logfile start
pg-1    | 
pg-1    | waiting for server to start....2024-09-13 01:23:06.249 UTC [49] LOG:  starting PostgreSQL 16.4 (Debian 16.4-1.pgdg120+1) on aarch64-unknown-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit
pg-1    | 2024-09-13 01:23:06.250 UTC [49] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
pg-1    | 2024-09-13 01:23:06.253 UTC [52] LOG:  database system was shut down at 2024-09-13 01:23:06 UTC
pg-1    | 2024-09-13 01:23:06.256 UTC [49] LOG:  database system is ready to accept connections
pg-1    |  done
pg-1    | server started
pg-1    | 
pg-1    | /usr/local/bin/docker-entrypoint.sh: sourcing /docker-entrypoint-initdb.d/ichiran-db.sh
pg-1    | =========================
pg-1    | Starting ichiran DB init!
pg-1    | =========================
pg-1    | pg_restore: error: could not execute query: ERROR:  schema "public" already exists
pg-1    | Command was: CREATE SCHEMA public;
pg-1    | 
pg-1    | 
pg-1    | 2024-09-13 01:23:06.535 UTC [62] ERROR:  schema "public" already exists
pg-1    | 2024-09-13 01:23:06.535 UTC [62] STATEMENT:  CREATE SCHEMA public;
pg-1    |   
pg-1    |   
pg-1    |   
pg-1    | 2024-09-13 01:23:14.754 UTC [50] LOG:  checkpoints are occurring too frequently (8 seconds apart)

[trimmed some ouptut here]

main-1  | ffffb399b000-ffffb399d000 rw-p 00022000 00:3d 3277259                    /lib/aarch64-linux-gnu/ld-2.31.so
main-1  | ffffdd0bf000-ffffdd0e0000 rw-p 00000000 00:00 0                          [stack]
main-1  | fatal error encountered in SBCL pid 640 tid 640:
main-1  | remap_free_pages: page moved, 0x1000000000 ==> (nil)
main-1  | 
main-1  | All set, awaiting commands.

Also the output from du -h -d0 docker/pgdata

mits-mac-001@adominisutoretanoMacBook-Pro ichiran % du -h -d0 docker/pgdata
4.4G    docker/pgdata

I cloned the repository, ran the commands docker compose build and after execution ran the command docker compose up inside the repo directory. Once the text "All set, awaiting commands" appeared, in a different terminal I ran the docker exec -it ichiran-main-1 test-suite And ended up with the above error. Am I doing something wrong? how do I fix this?

Let me know if any other log is required I'll get it.

tshatrov commented 1 month ago

Could be some bug with SBCL. What version is it? I currently have ichiran running on 2.3.2 and 2.1.0. Also what other logs from SBCL are there (not from database initialization)?

theUnrealSamurai commented 1 month ago

If you are talking about the SBCL Version, I think it is SBCL 2.2.4. The Ichiran version, It's the current master branch. I didn't see any other errors except for the database part. Also at the end of the docker compose up, There was this main-1 | fatal error encountered in SBCL pid 640 tid 640: main-1 | remap_free_pages: page moved, 0x1000000000 ==> (nil)

I attached the log files for the docker compose up.

docker_compose_up (release).txt This file is the docker log for the source code from the release page. the latest one.

docker_compose_up.txt (master branch) this one is ran on the master branch

JDRanpariya commented 1 month ago

I have the same issue!

image

tshatrov commented 1 month ago

Have you tried to use an older version of SBCL container? I don't use docker myself (this feature was a contribution from a user) so I have no way to test this right now.

https://hub.docker.com/r/clfoundation/sbcl/tags

theUnrealSamurai commented 1 month ago

image I think it's the error with the SBCL. I managed to run Ichiran by installing the entire project locally (The current master branch). with SBCL 2.3.2 And it ran successfully.

While running the tests all the tests ran successfully but there was one error that was thrown should I be bothered about that?

Was there any reason why the SBCL was updated to the latest one? I have a requirement to build a docker for my use case. I might revert to SBCL 2.3.2, If it's okay with you let me know I'll try to send a pull request updating the docker version to 2.3.2.

tshatrov commented 1 month ago

It seems clfoundation docker hasn't been updated in forever. Can you try this one instead? https://hub.docker.com/r/fukamachi/sbcl/tags . It should have 2.3.2 or you can try to use latest (2.4.8)

This is the part that needs to be updated: https://github.com/tshatrov/ichiran/blob/master/docker/sbcl-dockerfile#L1

theUnrealSamurai commented 1 month ago

I tried running it from the container that you specified. It gave me this error.

------                                                                                                                                                           
 > [main 16/16] RUN     sbcl --non-interactive --eval "(ql:quickload :ichiran)":
0.321 Unhandled QUICKLISP-CLIENT:SYSTEM-NOT-FOUND in thread #<SB-THREAD:THREAD tid=7 "main thread" RUNNING
0.321                                                          {1004C60503}>:
0.321   System "ichiran" not found
0.321 
0.321 Backtrace for: #<SB-THREAD:THREAD tid=7 "main thread" RUNNING {1004C60503}>
0.321 0: (SB-DEBUG::DEBUGGER-DISABLED-HOOK #<QUICKLISP-CLIENT:SYSTEM-NOT-FOUND {10038BE4A3}> #<unused argument> :QUIT T)
0.321 1: (SB-DEBUG::RUN-HOOK *INVOKE-DEBUGGER-HOOK* #<QUICKLISP-CLIENT:SYSTEM-NOT-FOUND {10038BE4A3}>)
0.321 2: (INVOKE-DEBUGGER #<QUICKLISP-CLIENT:SYSTEM-NOT-FOUND {10038BE4A3}>)
0.321 3: (CERROR "Try again" QUICKLISP-CLIENT:SYSTEM-NOT-FOUND :NAME "ichiran")
0.321 4: ((LABELS QUICKLISP-CLIENT::RECURSE :IN QUICKLISP-CLIENT::COMPUTE-LOAD-STRATEGY) "ichiran")
0.321 5: (QL-DIST::CALL-WITH-CONSISTENT-DISTS #<FUNCTION (LAMBDA NIL :IN QUICKLISP-CLIENT::COMPUTE-LOAD-STRATEGY) {10038B8D3B}>)
0.321 6: (QUICKLISP-CLIENT::COMPUTE-LOAD-STRATEGY "ichiran")
0.321 7: (QUICKLISP-CLIENT::AUTOLOAD-SYSTEM-AND-DEPENDENCIES "ichiran" :PROMPT NIL)
0.321 8: ((:METHOD QL-IMPL-UTIL::%CALL-WITH-QUIET-COMPILATION (T T)) #<unused argument> #<FUNCTION (FLET QUICKLISP-CLIENT::QL :IN QUICKLISP-CLIENT:QUICKLOAD) {10038B8C0B}>) [fast-method]
0.321 9: ((:METHOD QL-IMPL-UTIL::%CALL-WITH-QUIET-COMPILATION :AROUND (QL-IMPL:SBCL T)) #<QL-IMPL:SBCL {1005274143}> #<FUNCTION (FLET QUICKLISP-CLIENT::QL :IN QUICKLISP-CLIENT:QUICKLOAD) {10038B8C0B}>) [fast-method]
0.321 10: ((:METHOD QUICKLISP-CLIENT:QUICKLOAD (T)) :ICHIRAN :PROMPT NIL :SILENT NIL :VERBOSE NIL) [fast-method]
0.321 11: (QL-DIST::CALL-WITH-CONSISTENT-DISTS #<FUNCTION (LAMBDA NIL :IN QUICKLISP-CLIENT:QUICKLOAD) {10038B3F9B}>)
0.322 12: (SB-INT:SIMPLE-EVAL-IN-LEXENV (QUICKLISP-CLIENT:QUICKLOAD :ICHIRAN) #<NULL-LEXENV>)
0.322 13: (EVAL (QUICKLISP-CLIENT:QUICKLOAD :ICHIRAN))
0.322 14: (SB-IMPL::PROCESS-EVAL/LOAD-OPTIONS ((:EVAL . "(progn #-ros.init(cl:load \"/usr/local/etc/roswell/init.lisp\"))") (:EVAL . "(ros:run '((:eval\"(ros:quicklisp)\")))") (:EVAL . "(ql:quickload :ichiran)") (:QUIT)))
0.322 15: (SB-IMPL::TOPLEVEL-INIT)
0.322 16: ((FLET SB-UNIX::BODY :IN SB-IMPL::START-LISP))
0.322 17: ((FLET "WITHOUT-INTERRUPTS-BODY-3" :IN SB-IMPL::START-LISP))
0.322 18: (SB-IMPL::%START-LISP)
0.322 
0.322 unhandled condition in --disable-debugger mode, quitting
------
failed to solve: process "/bin/sh -c sbcl --non-interactive --eval \"(ql:quickload :ichiran)\"" did not complete successfully: exit code: 1

Then I moved ichiran from local-projects to common-lisp directory. Modified this part in the docker.

image

And Ichiran did seem to initialize but I ended up with this error after that

main-1  | ..........................
main-1  | compressed 65536 bytes into 2052 at level 9
main-1  | compressed 106430464 bytes into 15597481 at level 9
main-1  | compressed 22413312 bytes into 5583638 at level 9
main-1  | compressed 0 bytes into 9 at level 9
main-1  | fatal error encountered in SBCL pid 26 tid 26:
main-1  | more than one core file specified
main-1  | 
main-1  | All set, awaiting commands.

I tried debugging it but no luck I'm not familiar with lisp. Is there anything that I could do to get this fixed?

Also Along with this I did try to run it with other versions of SBCL, No luck there either. It all ended up with the same error as the first error I posted here. For every container it was something similar to this.

main-1  | fatal error encountered in SBCL pid 640 tid 640:
main-1  | remap_free_pages: page moved, 0x1000000000 ==> (nil)
tshatrov commented 1 month ago

Ok I wasn't sure if that container was compatible, seems it is not. In that case the only thing left is to try earlier versions from https://hub.docker.com/r/clfoundation/sbcl/tags

If that doesn't work maybe there's something wrong with your machine like not enough memory or something, because it definitely used to work in the past.

theUnrealSamurai commented 1 month ago

I already tried the other older versions from clfoundation. It didn't work for me.

I am currently testing it on 2 devices Mac M2-16GB and Ubuntu i5 9th gen-16GB. And I am running into the same error in both the devices.

Can you give me the version of docker that you used when you ran it successfully? I like to test that before I try other things.

theUnrealSamurai commented 1 month ago

This turned out to be a problem with docker. When tested on a windows machine things worked out of the box perfectly. Tested it on Ubuntu 24.04, Pop OS 22.04 and Macbook M2 Sequoia 15.0.1 the same error persisted not really sure what caused it and what the issue was. Installing the SBCL itself and running Ichiran worked in linux.