lindell / lindell/JsBarcode

Docker instance crashes when creating a JsBarcode push to Canvas (Error code 139)

Open
#417 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
5.9k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

` "jsbarcode": "^3.11.5",`

I am getting an error when trying to create a new bar code and save it.
The below code works perfectly when running it outside of a docker container.

You can check out the Docker Hub container mannequinbanshee/pointofsale:latest for reference to the setup:

[link to docker](https://hub.docker.com/r/mannequinbanshee/pointofsale/tags)

```
const CreateSingleBarcode = async (req,h) => {

var BarcodeCanvas = createCanvas();
var guid = uuid.v1().substring(0,8);
try{
**JsBarcode(BarcodeCanvas,guid);** ## code crashes here with exited with code 139
var CreatedBarcode = await Barcode.create({"name": guid});
var canvasData = BarcodeCanvas.toBuffer("image/png");
var ServerSidePath = Path.join(__dirname,"../../../../static/public/assets/images/Barcodes");
if(fs.existsSync(ServerSidePath)){
var success = await fs.writeFile(`${ServerSidePath}/${guid}.png`,canvasData,(error) => {
if(error){
winston.error(error.message);
}
});
}
}
catch(e){
winston.error(e.message);
}

return guid;
}
```
The Below image shows the new button which is linked to the above.

![image](https://user-images.githubusercontent.com/94390134/193007804-1871f4eb-9b0b-4ee7-a3bf-984ad9de5c6b.png)

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the Docker Hub mannequinbanshee/pointofsale:latest setup and trace the CreateSingleBarcode entry point, especially the JsBarcode(BarcodeCanvas, guid) call that exits with code 139. Compare the container and non-container runtimes and dependencies; done means barcode creation and PNG saving complete successfully inside Docker.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, javascript, node.js
Domain
backend, devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.