'bst pull' with --remote override fails to initialize remote because 'push not allowed'
- Dominant language
- Python
- Stars
- 140
- Forks
- 45
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 6
Description
[See original issue on GitLab](https://gitlab.com/BuildStream/buildstream/-/issues/798)
In GitLab by [[Gitlab user @gokcennurlu]](https://gitlab.com/gokcennurlu) on Nov 30, 2018, 11:55
## Summary
I have an artifact cache server configured in my `project.conf` where I can pull things using `bst pull ..`. I want to remove this from my configuration and pass it to CLI instead (`--remote`).
But it fails with the message `CAS server does not allow push`.
Additionally, maybe it's just me, but I found the docs a bit unclear about this: Can this `--remote` be used to provide a new URL or is it just for prioritization for existing URLs? Because I tried keeping the URL in the `project.conf` and still used `--remote`. If it is the former, how does this work for `bst push`? (A potential topic to file another issue, if verified)
## Steps to reproduce
Run an artifact server in bg if you don't already have a working one:
```bash
$ bst-artifact-server /tmp/ -p 11001 &
# CACHE_URL = http://localhost:11001
```
1. Have a CACHE_URL, in `project.conf`, where pull works without any need of certificates, keys etc, test `bst pull`.
1. Remove it from `project.conf`, do `bst pull --remote CACHE_URL .. ` instead.
## What is the current bug behavior?
```bash
..
[00:00:00][][] SUCCESS Resolving elements
[--:--:--][][] START Initializing remote caches
[--:--:--][][] WARNING Failed to initialize remote CACHE_URL: CAS server does not allow push # why fail here?
[00:00:00][][] SUCCESS Initializing remote caches
[--:--:--][][] START Resolving cached state
..
```
## What is the expected correct behavior?
[According to the docs](https://buildstream.gitlab.io/buildstream/using_commands.html?highlight=remote#cmdoption-bst-pull-r) bst should try to configure the supplied URL for pulling and not fail during init step.
## Possible fixes
To find a starting point quickly, I searched for the string `CAS server does not allow push` and failed. I guess this error comes from gRPC endpoint/cache directly. I am not very familiar with remote cache initialization code path yet but I guess the fix would be `not asking for push feature if --remote used in a bst-pull command` like it already works with `project.conf`.
Adding more clarification to docs would also helpful.
## Other relevant information
[//]: # (Add the BuildStream version. Substitute below the "x" by "1", "2" or the right version. Add more than one version if necessary)
* BuildStream version affected: 1.3.0+973.g2a8a3b19
----
Contributor guide
Research direction
Start at the `bst pull --remote` command and the remote cache initialization path, reproducing with `bst-artifact-server /tmp/ -p 11001` after removing CACHE_URL from `project.conf`. Trace why pull initialization requests push capability; done when a CLI-supplied remote initializes for pulls without push permission and coverage exists for this scenario.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend, cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100