Description

Users may encounter the " date: connect: Can't assign requested address " error when they change system time by issuing " set date ."

This article clarifies that the error occurs when an IP address is not configured on any user interface or the fxp or loopback interface.

Symptoms

The error is seen when an IP address is not configured on any user interface or the fxp or loopback interface. For example:

  1. Boot up the router and load factory defaults, with no interface configured.

FreeBSD/amd64 (re0-mx) (ttyu0)
--- JUNOS 16.1R1.7 Kernel 64-bit  JNPR-10.1-20160624.329953_builder_stable_10
root@re0-mx:~ # cli
root@re0-mx>
  1. Set system time and you will see the following error:

root@re0-mx> set date 201703271115.00  
date: connect: Can't assign requested address        <<<<<<
Mon Mar 27 11:15:00 UTC 2017

The issue is not seen when fxp or any other interface is configured.

When you configure fxp0: 

root@mx> show interfaces terse fxp*
Interface               Admin Link Proto    Local                 Remote
fxp0                    up    up
fxp0.0                  up    up   inet     10.219.39.74/26

 Set system time and there is no error: 

root@mx> set date 201703271138.00     
Mon Mar 27 11:38:00 UTC 2017

Solution

The error is expected when no interface address is configured. The date program tries to open a UDP socket connection to the timed server. Because no interface is configured, the connect call with the interface address fails and the error "date: connect: Can't assign requested address" is seen.

This applies to all Junos OS platforms.

Although the error is seen, the time that was set before works. Therefore, this error can be ignored safely.