Crash of shepherd service, of GNU Artanis app, only happening in the server, not on my machine

  • Done
  • quality assurance status badge
Details
2 participants
  • Josep Bigorra
  • Ludovic Courtès
Owner
unassigned
Submitted by
Josep Bigorra
Severity
normal

Debbugs page

Josep Bigorra wrote 2 months ago
(address . bug-guix@gnu.org)
CAM_04A1QQFxJx0Sf8tkyXQbHeZXjHu0sdeTWfQ-AX=6auVLQdw@mail.gmail.com
Hey all , happy new year 🥳

I am very happy to announce that my Guile Scheme CI/CD project,
byggsteg (https://codeberg.org/jjba23/byggsteg)on SQLite + base64 +
Artanis is a reality, and it's got an amazing performance boost, all
also thanks to your contributions, help and hinting, and my hours 😄
Byggsteg works real nicely on all my computers.

I was having a bit of problems deploying the new version to my Guix
server (https://codeberg.org/jjba23/wolk-jjba),specially due to the
addition of guile-dbd and guile-dbi-sqlite but I have resolved this. I
also managed to now configure everything properly about hostnames and
redirections of HTTP to HTTPS.

Byggsteg almost works 100% on the server, but somehow the Shepherd
service crashes and restarts when i try to start a new job.

I was suspicious of threading capabilities of my server, but all works
as expected there, also checked from the Guix REPL, and hardware is
powerful and up to date enough. So now I suspect that my database
operations somehow are making things crash.

Could you please help me figure this out, I am at a loss cause there
is no useful error being displayed 😢

I attached the logs from my server, maybe they tell you more than they tell me.

The code where things go BOOM 💣 I think? is at
lib/byggsteg/job/pipeline.scm, also attached to this thread.

Find below also the Shepherd service definition I use (in byggsteg
readme as well)

Thank you in advance!

```
(define (wolk-jjba-byggsteg-service config)
(list (shepherd-service (documentation "Run byggsteg as a daemon")
(provision '(byggsteg))
(requirement '())
(start #~(make-forkexec-constructor
'("make" "production-server")
#:directory

"/var/log/byggsteg/job-clone/byggsteg/trunk"
#:environment-variables
(list

"GUILE_LOAD_PATH=/run/current-system/profile/share/guile/site/3.0"

"GUILE_DBD_PATH=/run/current-system/profile/lib"

"C_INCLUDE_PATH=/run/current-system/profile/include"

"GUILE_LOAD_COMPILED_PATH=/run/current-system/profile/lib/guile/3.0/site-ccache:/run/current-system/profile/share/guile/site/3.0"

"LIBRARY_PATH=/run/current-system/profile/lib"
"GIT_SSL_NO_VERIFY=1"
"LANG=nl_NL.UTF-8"
"GUILE_AUTO_COMPILE=0"

"PWD=/var/log/byggsteg/job-clone/byggsteg/trunk"

"PATH=/run/privileged/bin:/run/current-system/profile/bin:/run/current-system/profile/sbin")))
(stop #~(make-kill-destructor))
(auto-start? #t)
(respawn? #t))))

(define wolk-jjba-byggsteg-service-type
(service-type (name 'byggsteg)
(description "Run byggsteg as a daemon")
(extensions (list (service-extension
shepherd-root-service-type
wolk-jjba-byggsteg-service)))
(default-value '())))

```
Attachment: pipeline.scm
Josep Bigorra wrote 2 months ago
found the problem!
(address . 75269@debbugs.gnu.org)
CAM_04A2yRW3LpdTBx5hz9CtqSRveQqt1L-z-=a5stSOJdwtRXw@mail.gmail.com
So it turns out running Guile code as Shepherd service with
GUILE_AUTOCOMPILE=0 makes things crash real bad.. For future
reference, never use this in prod
Please close this ticket
Ludovic Courtès wrote 2 months ago
Re: bug#75269: Crash of shepherd service, of GNU Artanis app, only happening in the server, not on my machine
(name . Josep Bigorra)(address . jjbigorra@gmail.com)(address . 75269-done@debbugs.gnu.org)
87a5c1ya24.fsf@gnu.org
Hola,

Josep Bigorra <jjbigorra@gmail.com> skribis:

Toggle quote (3 lines)
> Jan 1 22:20:17 localhost shepherd[1]: make[911] ERROR: In procedure apply-smob/0:
> Jan 1 22:20:17 localhost shepherd[1]: make[911] In procedure dbi-close: Wrong type argument in position 1: #<finalized smob 7f80244f41b0>

For the record, this sounds like a memory management bug in guile-dbi:
‘dbi-close’ is passed a “SMOB” (a Scheme wrapper for a C object) that
has been freed in the meantime.

Closing!

Ludo’.
Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 75269@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 75269
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help