# Strange jna.LastErrorException repeated over and over in jenkins logs

**URL:** <https://community.jenkins.io/t/strange-jna-lasterrorexception-repeated-over-and-over-in-jenkins-logs/2015>\
**Category:** Ask a question\
**Created:** [April 4, 2022, 11:19am UTC](https://community.jenkins.io/t/strange-jna-lasterrorexception-repeated-over-and-over-in-jenkins-logs/2015 "2022-04-04T11:19:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![shadycuz](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/shadycuz/32/196_2.png) [@shadycuz](https://community.jenkins.io/u/shadycuz)\
**Post date:** [April 4, 2022, 11:19am UTC](https://community.jenkins.io/t/strange-jna-lasterrorexception-repeated-over-and-over-in-jenkins-logs/2015/1 "2022-04-04T11:19:50Z")

</div>

Starting Jenkins 2.332.1 on AmazonLinux2 (java 11) results it the following exception repeatedly throw in the log. Jenkins does start and work correctly.

```auto
Apr 04 11:01:10 jenkins jenkins[21709]: 2022-04-04 11:01:10.868+0000 [id=31] INFO jenkins.InitReactorRunner$1#onAttained: Augmented all extensions
Apr 04 11:01:11 jenkins jenkins[21709]: 2022-04-04 11:01:11.693+0000 [id=32] WARNING h.lifecycle.SystemdLifecycle#notify
Apr 04 11:01:11 jenkins jenkins[21709]: com.sun.jna.LastErrorException: [1] Operation not permitted
Apr 04 11:01:11 jenkins jenkins[21709]: at com.sun.jna.Native.invokeInt(Native Method)
Apr 04 11:01:11 jenkins jenkins[21709]: at com.sun.jna.Function.invoke(Function.java:426)
Apr 04 11:01:11 jenkins jenkins[21709]: at com.sun.jna.Function.invoke(Function.java:361)
Apr 04 11:01:11 jenkins jenkins[21709]: at com.sun.jna.Library$Handler.invoke(Library.java:265)
Apr 04 11:01:11 jenkins jenkins[21709]: at hudson.lifecycle.$Proxy21.sd_notify(Unknown Source)
Apr 04 11:01:11 jenkins jenkins[21709]: at hudson.lifecycle.SystemdLifecycle.notify(SystemdLifecycle.java:64)
Apr 04 11:01:11 jenkins jenkins[21709]: at hudson.lifecycle.SystemdLifecycle.onExtendTimeout(SystemdLifecycle.java:53)
Apr 04 11:01:11 jenkins jenkins[21709]: at jenkins.model.Jenkins$6.onInitMilestoneAttained(Jenkins.java:1184)
Apr 04 11:01:11 jenkins jenkins[21709]: at jenkins.InitReactorRunner$1.onAttained(InitReactorRunner.java:88)
Apr 04 11:01:11 jenkins jenkins[21709]: at org.jvnet.hudson.reactor.ReactorListener$Aggregator.lambda$onAttained$3(ReactorListener.java:108)
Apr 04 11:01:11 jenkins jenkins[21709]: at org.jvnet.hudson.reactor.ReactorListener$Aggregator.run(ReactorListener.java:115)
Apr 04 11:01:11 jenkins jenkins[21709]: at org.jvnet.hudson.reactor.ReactorListener$Aggregator.onAttained(ReactorListener.java:108)
Apr 04 11:01:11 jenkins jenkins[21709]: at org.jvnet.hudson.reactor.Reactor$1.run(Reactor.java:183)
Apr 04 11:01:11 jenkins jenkins[21709]: at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:121)
Apr 04 11:01:11 jenkins jenkins[21709]: at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:68)
Apr 04 11:01:11 jenkins jenkins[21709]: at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
Apr 04 11:01:11 jenkins jenkins[21709]: at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
Apr 04 11:01:11 jenkins jenkins[21709]: at java.base/java.lang.Thread.run(Thread.java:829)
Apr 04 11:01:11 jenkins jenkins[21709]: 2022-04-04 11:01:11.694+0000 [id=32] INFO jenkins.InitReactorRunner$1#onAttained: System config loaded
Apr 04 11:01:11 jenkins jenkins[21709]: 2022-04-04 11:01:11.696+0000 [id=32] WARNING h.lifecycle.SystemdLifecycle#notify
Apr 04 11:01:11 jenkins jenkins[21709]: com.sun.jna.LastErrorException: [1] Operation not permitted
Apr 04 11:01:11 jenkins jenkins[21709]: at com.sun.jna.Native.invokeInt(Native Method)
Apr 04 11:01:11 jenkins jenkins[21709]: at com.sun.jna.Function.invoke(Function.java:426)
Apr 04 11:01:11 jenkins jenkins[21709]: at com.sun.jna.Function.invoke(Function.java:361)
Apr 04 11:01:11 jenkins jenkins[21709]: at com.sun.jna.Library$Handler.invoke(Library.java:265)
Apr 04 11:01:11 jenkins jenkins[21709]: at hudson.lifecycle.$Proxy21.sd_notify(Unknown Source)
Apr 04 11:01:11 jenkins jenkins[21709]: at hudson.lifecycle.SystemdLifecycle.notify(SystemdLifecycle.java:64)
Apr 04 11:01:11 jenkins jenkins[21709]: at hudson.lifecycle.SystemdLifecycle.onExtendTimeout(SystemdLifecycle.java:53)
Apr 04 11:01:11 jenkins jenkins[21709]: at jenkins.model.Jenkins$6.onInitMilestoneAttained(Jenkins.java:1184)
Apr 04 11:01:11 jenkins jenkins[21709]: at jenkins.InitReactorRunner$1.onAttained(InitReactorRunner.java:88)
Apr 04 11:01:11 jenkins jenkins[21709]: at org.jvnet.hudson.reactor.ReactorListener$Aggregator.lambda$onAttained$3(ReactorListener.java:108)
lines 13071-13106/13213 99%

```

---

<div class="post-metadata">

**Author:** ![shadycuz](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/shadycuz/32/196_2.png) [@shadycuz](https://community.jenkins.io/u/shadycuz)\
**Post date:** [April 4, 2022, 11:40am UTC](https://community.jenkins.io/t/strange-jna-lasterrorexception-repeated-over-and-over-in-jenkins-logs/2015/2 "2022-04-04T11:40:11Z")

</div>

also we lost logging to `/var/log/jenkins/jenkins.log` is there a way we can get that back?

I found a docs page that said to edit the service file to add an environment variable, is there a non interactive way?

---

<div class="post-metadata">

**Author:** ![MarkEWaite](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/markewaite/32/20_2.png) [@MarkEWaite](https://community.jenkins.io/u/MarkEWaite)\
**Post date:** [April 4, 2022, 1:53pm UTC](https://community.jenkins.io/t/strange-jna-lasterrorexception-repeated-over-and-over-in-jenkins-logs/2015/3 "2022-04-04T13:53:35Z")

</div>

> [@shadycuz](#):
>
> Starting Jenkins 2.332.1 on AmazonLinux2 (java 11) results it the following exception repeatedly throw in the log.

That will be fixed in 2.332.2 to be released this Wednesday. It is described in [JENKINS-67995 - SystemdLifecycle logging “Operation not permitted” calling sd\_notify(3) during startup](https://issues.jenkins.io/browse/JENKINS-67995)

You can read the changelog entry for it in the [2.332.2 changelog](https://github.com/jenkins-infra/jenkins.io/pull/5045).

---

<div class="post-metadata">

**Author:** ![MarkEWaite](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/markewaite/32/20_2.png) [@MarkEWaite](https://community.jenkins.io/u/MarkEWaite)\
**Post date:** [April 5, 2022, 1:22pm UTC](https://community.jenkins.io/t/strange-jna-lasterrorexception-repeated-over-and-over-in-jenkins-logs/2015/4 "2022-04-05T13:22:31Z")

</div>

> [@shadycuz](#):
>
> also we lost logging to `/var/log/jenkins/jenkins.log` is there a way we can get that back?
> 
> I found a docs page that said to edit the service file to add an environment variable, is there a non interactive way?

Yes, though that means you’re fighting against the way that systemd manages logs for the rest of your system. Using `systemd` to manage the log files will allow you to manage space used by the log files with systemd.

The `override.conf` file can be edited by any text editor. If it is edited by a process that is not aware of systemd, then a call needs to be made to `systemclt daemon-reload`.
