# Wrong characters after I restored my jenkins\_home

**URL:** <https://community.jenkins.io/t/wrong-characters-after-i-restored-my-jenkins-home/454>\
**Category:** Ask a question\
**Created:** [September 30, 2021, 4:56pm UTC](https://community.jenkins.io/t/wrong-characters-after-i-restored-my-jenkins-home/454 "2021-09-30T16:56:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![msgongora](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/msgongora/32/360_2.png) [@msgongora](https://community.jenkins.io/u/msgongora)\
**Post date:** [September 30, 2021, 4:56pm UTC](https://community.jenkins.io/t/wrong-characters-after-i-restored-my-jenkins-home/454/1 "2021-09-30T16:56:03Z")

</div>

Hi everyone,

I have exhausted the possible solutions I have found on internet before posting my issue here and I’m hoping someone has faced a similar problem or at least could offer me some idea of what could be happening here.  
In one of my declarative pipelines I have something like this:

````auto
def status = "Failed 🔴"
...
str = "#### terraform plan ${status}\n ${planResult}<details><summary>Show Output</summary>\n\n```hcl\n${output}\n```\n</details>\n\n*Dataset: `${ds}`, Working Directory: `${tfWorkingDir}`*"
def comment = pullRequest.comment(str)

````

previous code is supposed to write a pull request comment with the text from `str`. The pipeline was working as expected before I needed to extend the size of the disk/volume dedicated to my `jenkins_home`. After this event, my Jenkinsfile hasn’t changed in any way but now the pipeline is writing wrong characters on the Pull Request comments (`terraform plan failed ����`) where it should be writing `terraform plan failed 🔴` as before.

To give you more context. My jenkins infrastructure is deployed using official helm chart and recently changed the storageClass of the PV used for `jenkins_home`, for that reason I needed to back it up from the old volume and restore it on the new one. The backup process was manually executed and I basically have compressed the entire jenkins\_home using standard options of tar, provisioned the new PV and then uncompressed the backup on the new volume.

Internet search results have suggested this could be related to file encoding so I tried using `-Dfile.encoding=UTF8` without any positive result. I don’t really get what could be the issue here since jenkins is supposed to pull from my github repo the Jenkinsfile with the right encoding and characters.  
Thank you in advance

---

<div class="post-metadata">

**Author:** ![halkeye](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/halkeye/32/8_2.png) [@halkeye](https://community.jenkins.io/u/halkeye)\
**Post date:** [September 30, 2021, 5:00pm UTC](https://community.jenkins.io/t/wrong-characters-after-i-restored-my-jenkins-home/454/2 "2021-09-30T17:00:23Z")

</div>

> [@msgongora](#):
>
> I don’t really get what could be the issue here since jenkins is supposed to pull from my github repo the Jenkinsfile with the right encoding and characters.

if you echo the string to the console is it right? That would narrow it down from jenkins vs git vs apis etc

If your jenkinsfile hasn’t changed from before to after the restore, its possible that there’s a cache somewhere that broke. [Cleanup the /var/lib/jenkins/caches folder - Stack Overflow](https://stackoverflow.com/questions/58117637/cleanup-the-var-lib-jenkins-caches-folder) seems to be where i’d start for that problem.

---

<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:** [September 30, 2021, 11:03pm UTC](https://community.jenkins.io/t/wrong-characters-after-i-restored-my-jenkins-home/454/3 "2021-09-30T23:03:45Z")

</div>

There was an inadvertent change in Jenkins 2.303.1 that caused the locale of the Docker image for the Jenkins controller (`jenkins/jenkins:2.303.1`, `jenkins/jenkins:lts`, `jenkins/jenkins:lts-jdk8`, and `jenkins/jenkins:slim`) to be switched from the internationalized `C.UTF-8` to the US-ASCII `POSIX` locale. You might check “Manage Jenkins” → “System Information” to confirm the locale settings of your Jenkins controller allow international characters.

Look for the value of the environment variable `LANG`. Will be fixed in the 2.303.2 release next Wednesday, Oct 6, 2021.

---

<div class="post-metadata">

**Author:** ![msgongora](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/msgongora/32/360_2.png) [@msgongora](https://community.jenkins.io/u/msgongora)\
**Post date:** [October 1, 2021, 3:29pm UTC](https://community.jenkins.io/t/wrong-characters-after-i-restored-my-jenkins-home/454/4 "2021-10-01T15:29:38Z")

</div>

Cache was the issue. I thought I have excluded that directory but I didn’t. When you mentioned it @halkeye, I looked at the options I used excluding cache and it wasn’t right? Thank you for the suggestion. Also thank you @MarkEWaite to mention this issue.

```auto
tar -cpzf /mnt/backup-vol/ci-backup-$(date +%Y-%m-%d).tar jenkins_home/ \
   --exclude='jenkins_home/lost+found' \
   --exclude='jenkins_home/logs' \
   --exclude='jenkins_home/war' \
   --exclude='jenkins_home/*.bak' \
   --exclude='jenkins_home/*.cache'

```
