# Sequence number overflow bug in RWS

**URL:** <https://tech-community.robotics.abb.com/t/sequence-number-overflow-bug-in-rws/10673>\
**Category:** Developer Tools\
**Tags:** web-service\
**Created:** [April 5, 2022, 5:51am UTC](https://tech-community.robotics.abb.com/t/sequence-number-overflow-bug-in-rws/10673 "2022-04-05T05:51:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![marcus7070](https://avatars.discourse-cdn.com/v4/letter/m/e79b87/32.png) [@marcus7070](https://tech-community.robotics.abb.com/u/marcus7070)\
**Post date:** [April 5, 2022, 5:51am UTC](https://tech-community.robotics.abb.com/t/sequence-number-overflow-bug-in-rws/10673/1 "2022-04-05T05:51:52Z")

</div>

I believe elog sequence number is overflowing in Robot Web Services.

If you create a new virtual controller in Robotstudio using default settings and Robotware 6.13.02, then run the following Rapid code to fill the event log:

```auto
MODULE reproduce_mod
    
    PROC reproduce()
        log_first_message;
        log_many_messages;
        log_final_message;
        Stop;
    ENDPROC
    
    PROC log_first_message()
        ErrWrite \I, "First message", "This is the first message";
    ENDPROC
    
    PROC log_many_messages()
        FOR idx FROM 1 TO 65599 DO
            ErrWrite \I, "Message number " + ValToStr(idx), "This is message number:", \RL2:=ValToStr(idx);
        ENDFOR
    ENDPROC
    
    PROC log_final_message()
        ErrWrite \I, "Final message", "This is the final message, that can not be accessed";
    ENDPROC
    
ENDMODULE

```

The message is visible in Robotstudio with the correct sequence number:

 ![image.png](https://europe1.discourse-cdn.com/flex005/uploads/robotics1/original/2X/f/f39fd1e0cfce2aa7234b985d302893e35f809915.png)

I can access all messages in elog domain 0 using the command:

```auto
curl --digest -u "Default User":robotics "http://localhost/rw/elog/0"

```

which returns:

 ![image.png](https://europe1.discourse-cdn.com/flex005/uploads/robotics1/original/2X/9/9964f7fd09d046d6ce781c7b70adec891e8be6ee.png)  
Note the link is “/rw/elog/0/87”, where I would expect “/rw/elog/0/65622”. Also 65622 - (2^16 - 1) = 87.

The command

```auto
curl --digest -u "Default User":robotics "http://localhost/rw/elog/0/87"

```

returns nothing (no errors, just an empty result without even an XML structure, which I can’t explain).

The command

```auto
curl --digest -u "Default User":robotics "http://localhost/rw/elog/0/65622"

```

does return the final message.

This is a problem for us, because in a production environment we need to use “/rw/elog/0” to index the error log messages, we won’t have the prior knowledge that the message we need is at sequence number 65622.

---

<div class="post-metadata">

**Author:** ![Maxim](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/maxim/32/4429_2.png) [@Maxim](https://tech-community.robotics.abb.com/u/Maxim)\
**Post date:** [April 5, 2022, 6:51am UTC](https://tech-community.robotics.abb.com/t/sequence-number-overflow-bug-in-rws/10673/2 "2022-04-05T06:51:06Z")

</div>

Hello Marcus,

Thanks for a thorough issue report 🙂

> [@marcus7070](#):
>
> I believe elog sequence number is overflowing in Robot Web Services.

Indeed, you are correct. This is a known issue and is being worked on by R&D.

At this time, there is no information regarding when the issue will be resolved.
