# Material Lot used or cannot be found

**URL:** <https://forum.inductiveautomation.com/t/material-lot-used-or-cannot-be-found/22792>\
**Category:** Ignition\
**Created:** [February 22, 2019, 12:35am UTC](https://forum.inductiveautomation.com/t/material-lot-used-or-cannot-be-found/22792 "2019-02-22T00:35:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nar](https://avatars.discourse-cdn.com/v4/letter/n/a87d85/32.png) [@nar](https://forum.inductiveautomation.com/u/nar)\
**Post date:** [February 22, 2019, 12:35am UTC](https://forum.inductiveautomation.com/t/material-lot-used-or-cannot-be-found/22792/1 "2019-02-22T00:35:25Z")

</div>

I am getting an error while trying to run a process segment using the Track and Trace module. Here is the code (with the segment name removed):

When I check the material lot 000000289, it lists its status as Complete and that it is Available as well.

Here is what the console shows when I get the Material lot and the core properties:

```auto
>>> 
MaterialLot (25667638-b8eb-40f4-ac70-d00574ca9eee, 0000000289, 0 parents, 0 children, 1 custom properties, 0 complex properties)
{UUID=25667638-b8eb-40f4-ac70-d00574ca9eee, Name=0000000289, Description=, Enabled=true, Creator=Unknown, ResponseSegmentUUID=121c336c-b241-4efb-abd9-3c343ec9f5f7, MaterialRef=Response Material Definition, ___Material Definition Name Removed___ , MaterialRefType=ResponseMaterialDef, MaterialRefUUID=486c95f8-a240-454c-ba75-238cbe71ad56, LotAssemblyType=null, LotStatus=Complete, LotLocationRef=Response Equipment, ___Equipment Name Removed___ , LotLocationRefType=ResponseEquipment, LotLocationRefUUID=003346e9-48c0-4f9e-84bc-841aa2904e6b, LotUnits=null, LotSequence=1, LotAvailabilityStatus=Used}
>>> 

```

Does anyone know how to resolve an error of this flavor?

```auto
16:32:49.631 [AWT-EventQueue-0] ERROR com.inductiveautomation.factorypmi.application.binding.action.ActionAdapter - <HTML>Error executing script for event:&nbsp;<code><b>actionPerformed</b></code><BR>on component:&nbsp;<code><b> _____removed_____ </b></code>.
com.inductiveautomation.ignition.common.script.JythonExecException: Traceback (most recent call last):
  File "<event:actionPerformed>", line 114, in <module>
  File "<event:actionPerformed>", line 107, in run
  File "<event:actionPerformed>", line 63, in run_transplant_segment
	at com.sepasoft.production.common.model.mesobject.objects.segment.MESResponseSegment.internalSetMaterial(MESResponseSegment.java:533)
	at com.sepasoft.production.common.model.mesobject.objects.segment.MESResponseSegment.setMaterial(MESResponseSegment.java:425)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)

```

**`java.lang.Exception: java.lang.Exception: Material lot number (0000000289) not found or it has already been used.`**

---

<div class="post-metadata">

**Author:** ![Paullys50](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paullys50/32/3324_2.png) [@Paullys50](https://forum.inductiveautomation.com/u/Paullys50)\
**Post date:** [February 22, 2019, 4:12am UTC](https://forum.inductiveautomation.com/t/material-lot-used-or-cannot-be-found/22792/2 "2019-02-22T04:12:41Z")

</div>

I would just submit this to Sepasoft support, probably won’t get much traction here.
