ocket8888 opened a new issue #4488: ATSTCCFG logs incorrect message with 
--no-cache
URL: https://github.com/apache/trafficcontrol/issues/4488
 
 
   ## I'm submitting a ...
   - bug report
   
   ## Traffic Control components affected ...
   - Traffic Ops ORT (`atstccfg`)
   
   ## Current behavior:
   If you try to request a file through ATSTCCFG with caching disabled, it will 
tell you the cached files don't exist instead of that it skipped checking them.
   
   ## Expected / new behavior:
   ATSTCCFG should log accurate messages, so that someone reading them later 
won't spend any time wondering about permissions or scouring code for typos. 
Not that I would know anything about that.
   
   ## Minimal reproduction of the problem with instructions:
   Do this twice and note the output (once isn't sufficient to display the 
problem since you may actually just not have a cache if it's your first time 
running it).
   ```bash
   /path/to/atstccfg -s -P "$TO_PASSWORD" -U "$TO_USER" -u 
"$TO_URL/api/2.0/servers/mid/configfiles/ats/remap.config"
   ```
   
   ## Anything else:
   <details>
   <summary>Sample run with CDN-in-a-Box</summary>
   <pre>
   $ ./atstccfg --no-cache  -s -P twelve -U admin -u 
"https://127.0.0.1:6443/api/2.0/servers/mid/configfiles/ats/remap.config";
   INFO: atstccfg.go:83: 2020-03-12T18:54:26.403013307-06:00: URL: 
'https://127.0.0.1:6443/api/2.0/servers/mid/configfiles/ats/remap.config' User: 
'admin' Pass len: '6'
   INFO: atstccfg.go:84: 2020-03-12T18:54:26.403057237-06:00: TempDir: 
'/tmp/atstccfg_cache'
   INFO: atstccfg.go:87: 2020-03-12T18:54:26.40306432-06:00: TO FQDN: 
'https://127.0.0.1:6443'
   INFO: atstccfg.go:88: 2020-03-12T18:54:26.403074515-06:00: TO URL: 
'https://127.0.0.1:6443/api/2.0/servers/mid/configfiles/ats/remap.config'
   INFO: trafficops.go:50: 2020-03-12T18:54:26.40309095-06:00: failed to get 
cookies from cache file (trying real TO): opening cookie file 
'/tmp/atstccfg_cache/cookies':open /tmp/atstccfg_cache/cookies: no such file or 
directory
   INFO: trafficops.go:60: 2020-03-12T18:54:26.451591885-06:00: using cookies 
from TO
   INFO: routing.go:73: 2020-03-12T18:54:26.451638922-06:00: GetConfigFile 
scope 'servers' resource 'mid' fileName 'remap.config'
   INFO: routing.go:205: 2020-03-12T18:54:26.451645392-06:00: 
GetConfigFileServer server 'mid' fileName 'remap.config'
   INFO: caching.go:68: 2020-03-12T18:54:26.45166684-06:00: ReadCache failed to 
get object from '/tmp/atstccfg_cache/servers.json', calling getter: opening 
object file '/tmp/atstccfg_cache/servers.json':open 
/tmp/atstccfg_cache/servers.json: no such file or directory
   INFO: caching.go:91: 2020-03-12T18:54:26.468867806-06:00: GetCachedJSON 
servers.json (miss) took 17ms
   INFO: caching.go:68: 2020-03-12T18:54:26.468899554-06:00: ReadCache failed 
to get object from '/tmp/atstccfg_cache/cdn_CDN-in-a-Box.json', calling getter: 
opening object file '/tmp/atstccfg_cache/cdn_CDN-in-a-Box.json':open 
/tmp/atstccfg_cache/cdn_CDN-in-a-Box.json: no such file or directory
   INFO: caching.go:91: 2020-03-12T18:54:26.470840223-06:00: GetCachedJSON 
cdn_CDN-in-a-Box.json (miss) took 2ms
   INFO: caching.go:68: 2020-03-12T18:54:26.470861255-06:00: ReadCache failed 
to get object from '/tmp/atstccfg_cache/profile_global_parameters.json', 
calling getter: opening object file 
'/tmp/atstccfg_cache/profile_global_parameters.json':open 
/tmp/atstccfg_cache/profile_global_parameters.json: no such file or directory
   INFO: caching.go:91: 2020-03-12T18:54:26.473073498-06:00: GetCachedJSON 
profile_global_parameters.json (miss) took 2ms
   INFO: caching.go:68: 2020-03-12T18:54:26.473098588-06:00: ReadCache failed 
to get object from 
'/tmp/atstccfg_cache/profile_ATS_MID_TIER_CACHE_parameters.json', calling 
getter: opening object file 
'/tmp/atstccfg_cache/profile_ATS_MID_TIER_CACHE_parameters.json':open 
/tmp/atstccfg_cache/profile_ATS_MID_TIER_CACHE_parameters.json: no such file or 
directory
   INFO: caching.go:91: 2020-03-12T18:54:26.476085698-06:00: GetCachedJSON 
profile_ATS_MID_TIER_CACHE_parameters.json (miss) took 3ms
   INFO: caching.go:68: 2020-03-12T18:54:26.476113523-06:00: ReadCache failed 
to get object from '/tmp/atstccfg_cache/cdn_2_deliveryservices.json', calling 
getter: opening object file 
'/tmp/atstccfg_cache/cdn_2_deliveryservices.json':open 
/tmp/atstccfg_cache/cdn_2_deliveryservices.json: no such file or directory
   INFO: caching.go:91: 2020-03-12T18:54:26.482338274-06:00: GetCachedJSON 
cdn_2_deliveryservices.json (miss) took 6ms
   INFO: caching.go:68: 2020-03-12T18:54:26.482364366-06:00: ReadCache failed 
to get object from '/tmp/atstccfg_cache/deliveryservice_servers_s_d_.csv', 
calling getter: opening object file 
'/tmp/atstccfg_cache/deliveryservice_servers_s_d_.csv':open 
/tmp/atstccfg_cache/deliveryservice_servers_s_d_.csv: no such file or directory
   INFO: caching.go:91: 2020-03-12T18:54:26.48529477-06:00: GetCachedJSON 
deliveryservice_servers_s_d_.csv (miss) took 3ms
   INFO: caching.go:68: 2020-03-12T18:54:26.485336655-06:00: ReadCache failed 
to get object from '/tmp/atstccfg_cache/ds_regexes.json', calling getter: 
opening object file '/tmp/atstccfg_cache/ds_regexes.json':open 
/tmp/atstccfg_cache/ds_regexes.json: no such file or directory
   INFO: caching.go:91: 2020-03-12T18:54:26.490864101-06:00: GetCachedJSON 
ds_regexes.json (miss) took 6ms
   INFO: caching.go:64: 2020-03-12T18:54:26.491237212-06:00: ReadCache 
profile_ATS_MID_TIER_CACHE_parameters.json (hit) took 0s
   INFO: caching.go:68: 2020-03-12T18:54:26.491262735-06:00: ReadCache failed 
to get object from 
'/tmp/atstccfg_cache/config_file_cachekey.config_parameters.json', calling 
getter: opening object file 
'/tmp/atstccfg_cache/config_file_cachekey.config_parameters.json':open 
/tmp/atstccfg_cache/config_file_cachekey.config_parameters.json: no such file 
or directory
   INFO: caching.go:91: 2020-03-12T18:54:26.493827369-06:00: GetCachedJSON 
config_file_cachekey.config_parameters.json (miss) took 3ms
   INFO: caching.go:68: 2020-03-12T18:54:26.493867734-06:00: ReadCache failed 
to get object from '/tmp/atstccfg_cache/cachegroups.json', calling getter: 
opening object file '/tmp/atstccfg_cache/cachegroups.json':open 
/tmp/atstccfg_cache/cachegroups.json: no such file or directory
   INFO: caching.go:91: 2020-03-12T18:54:26.496658951-06:00: GetCachedJSON 
cachegroups.json (miss) took 3ms
   INFO: routing.go:43: 2020-03-12T18:54:26.49667983-06:00: GetConfigFile 
/api/2.0/servers/mid/configfiles/ats/remap.config took 45ms
   INFO: atstccfg.go:104: 2020-03-12T18:54:26.496685342-06:00: GetConfigFile 
returned 0 <nil>
   # DO NOT EDIT - Generated for mid by Traffic Ops 
(https://trafficops.infra.ciab.test:443/) on Fri Mar 13 00:54:26 UTC 2020
   map http://origin.infra.ciab.test http://origin.infra.ciab.test 
@plugin=cache_range_requests.so
   $ ./atstccfg --no-cache  -s -P twelve -U admin -u 
"https://127.0.0.1:6443/api/2.0/servers/mid/configfiles/ats/remap.config";
   INFO: atstccfg.go:83: 2020-03-12T18:54:26.403013307-06:00: URL: 
'https://127.0.0.1:6443/api/2.0/servers/mid/configfiles/ats/remap.config' User: 
'admin' Pass len: '6'
   INFO: atstccfg.go:84: 2020-03-12T18:54:26.403057237-06:00: TempDir: 
'/tmp/atstccfg_cache'
   INFO: atstccfg.go:87: 2020-03-12T18:54:26.40306432-06:00: TO FQDN: 
'https://127.0.0.1:6443'
   INFO: atstccfg.go:88: 2020-03-12T18:54:26.403074515-06:00: TO URL: 
'https://127.0.0.1:6443/api/2.0/servers/mid/configfiles/ats/remap.config'
   INFO: trafficops.go:50: 2020-03-12T18:54:26.40309095-06:00: failed to get 
cookies from cache file (trying real TO): opening cookie file 
'/tmp/atstccfg_cache/cookies':open /tmp/atstccfg_cache/cookies: no such file or 
directory
   INFO: trafficops.go:60: 2020-03-12T18:54:26.451591885-06:00: using cookies 
from TO
   INFO: routing.go:73: 2020-03-12T18:54:26.451638922-06:00: GetConfigFile 
scope 'servers' resource 'mid' fileName 'remap.config'
   INFO: routing.go:205: 2020-03-12T18:54:26.451645392-06:00: 
GetConfigFileServer server 'mid' fileName 'remap.config'
   INFO: caching.go:68: 2020-03-12T18:54:26.45166684-06:00: ReadCache failed to 
get object from '/tmp/atstccfg_cache/servers.json', calling getter: opening 
object file '/tmp/atstccfg_cache/servers.json':open 
/tmp/atstccfg_cache/servers.json: no such file or directory
   INFO: caching.go:91: 2020-03-12T18:54:26.468867806-06:00: GetCachedJSON 
servers.json (miss) took 17ms
   INFO: caching.go:68: 2020-03-12T18:54:26.468899554-06:00: ReadCache failed 
to get object from '/tmp/atstccfg_cache/cdn_CDN-in-a-Box.json', calling getter: 
opening object file '/tmp/atstccfg_cache/cdn_CDN-in-a-Box.json':open 
/tmp/atstccfg_cache/cdn_CDN-in-a-Box.json: no such file or directory
   INFO: caching.go:91: 2020-03-12T18:54:26.470840223-06:00: GetCachedJSON 
cdn_CDN-in-a-Box.json (miss) took 2ms
   INFO: caching.go:68: 2020-03-12T18:54:26.470861255-06:00: ReadCache failed 
to get object from '/tmp/atstccfg_cache/profile_global_parameters.json', 
calling getter: opening object file 
'/tmp/atstccfg_cache/profile_global_parameters.json':open 
/tmp/atstccfg_cache/profile_global_parameters.json: no such file or directory
   INFO: caching.go:91: 2020-03-12T18:54:26.473073498-06:00: GetCachedJSON 
profile_global_parameters.json (miss) took 2ms
   INFO: caching.go:68: 2020-03-12T18:54:26.473098588-06:00: ReadCache failed 
to get object from 
'/tmp/atstccfg_cache/profile_ATS_MID_TIER_CACHE_parameters.json', calling 
getter: opening object file 
'/tmp/atstccfg_cache/profile_ATS_MID_TIER_CACHE_parameters.json':open 
/tmp/atstccfg_cache/profile_ATS_MID_TIER_CACHE_parameters.json: no such file or 
directory
   INFO: caching.go:91: 2020-03-12T18:54:26.476085698-06:00: GetCachedJSON 
profile_ATS_MID_TIER_CACHE_parameters.json (miss) took 3ms
   INFO: caching.go:68: 2020-03-12T18:54:26.476113523-06:00: ReadCache failed 
to get object from '/tmp/atstccfg_cache/cdn_2_deliveryservices.json', calling 
getter: opening object file 
'/tmp/atstccfg_cache/cdn_2_deliveryservices.json':open 
/tmp/atstccfg_cache/cdn_2_deliveryservices.json: no such file or directory
   INFO: caching.go:91: 2020-03-12T18:54:26.482338274-06:00: GetCachedJSON 
cdn_2_deliveryservices.json (miss) took 6ms
   INFO: caching.go:68: 2020-03-12T18:54:26.482364366-06:00: ReadCache failed 
to get object from '/tmp/atstccfg_cache/deliveryservice_servers_s_d_.csv', 
calling getter: opening object file 
'/tmp/atstccfg_cache/deliveryservice_servers_s_d_.csv':open 
/tmp/atstccfg_cache/deliveryservice_servers_s_d_.csv: no such file or directory
   INFO: caching.go:91: 2020-03-12T18:54:26.48529477-06:00: GetCachedJSON 
deliveryservice_servers_s_d_.csv (miss) took 3ms
   INFO: caching.go:68: 2020-03-12T18:54:26.485336655-06:00: ReadCache failed 
to get object from '/tmp/atstccfg_cache/ds_regexes.json', calling getter: 
opening object file '/tmp/atstccfg_cache/ds_regexes.json':open 
/tmp/atstccfg_cache/ds_regexes.json: no such file or directory
   INFO: caching.go:91: 2020-03-12T18:54:26.490864101-06:00: GetCachedJSON 
ds_regexes.json (miss) took 6ms
   INFO: caching.go:64: 2020-03-12T18:54:26.491237212-06:00: ReadCache 
profile_ATS_MID_TIER_CACHE_parameters.json (hit) took 0s
   INFO: caching.go:68: 2020-03-12T18:54:26.491262735-06:00: ReadCache failed 
to get object from 
'/tmp/atstccfg_cache/config_file_cachekey.config_parameters.json', calling 
getter: opening object file 
'/tmp/atstccfg_cache/config_file_cachekey.config_parameters.json':open 
/tmp/atstccfg_cache/config_file_cachekey.config_parameters.json: no such file 
or directory
   INFO: caching.go:91: 2020-03-12T18:54:26.493827369-06:00: GetCachedJSON 
config_file_cachekey.config_parameters.json (miss) took 3ms
   INFO: caching.go:68: 2020-03-12T18:54:26.493867734-06:00: ReadCache failed 
to get object from '/tmp/atstccfg_cache/cachegroups.json', calling getter: 
opening object file '/tmp/atstccfg_cache/cachegroups.json':open 
/tmp/atstccfg_cache/cachegroups.json: no such file or directory
   INFO: caching.go:91: 2020-03-12T18:54:26.496658951-06:00: GetCachedJSON 
cachegroups.json (miss) took 3ms
   INFO: routing.go:43: 2020-03-12T18:54:26.49667983-06:00: GetConfigFile 
/api/2.0/servers/mid/configfiles/ats/remap.config took 45ms
   INFO: atstccfg.go:104: 2020-03-12T18:54:26.496685342-06:00: GetConfigFile 
returned 0 <nil>
   # DO NOT EDIT - Generated for mid by Traffic Ops 
(https://trafficops.infra.ciab.test:443/) on Fri Mar 13 00:54:26 UTC 2020
   map http://origin.infra.ciab.test http://origin.infra.ciab.test 
@plugin=cache_range_requests.so
   </pre>
   </details>

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to