Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error message on publish drop truncates endpoint name #711

Closed
bahendri opened this issue Mar 6, 2018 · 0 comments · Fixed by #713
Closed

Error message on publish drop truncates endpoint name #711

bahendri opened this issue Mar 6, 2018 · 0 comments · Fixed by #713
Labels

Comments

@bahendri
Copy link

bahendri commented Mar 6, 2018

I'm using aptly 1.2.0 on Ubuntu 16.04.

While experimenting, I accidentally deleted my aptly configuration file after publishing a snapshot to a custom, file system endpoint.

With the conf files now missing, I correctly received an error message. However, the endpoint name in the error message was truncated strangely. Specifically, the "filesy" was missing from "filesystem".

$ aptly publish list
Published repositories:
  * filesystem:nodesource-nodejs:./xenial [amd64] publishes {main: [nodesource-20180305]: Snapshot from mirror [nodesource]: https://deb.nodesource.com/node_6.x/ xenial}

# Deleted ~/.aptly.conf and /etc/aptly.conf

$ sudo aptly publish drop xenial filesystem:nodesource-nodejs:
ERROR: published local storage stem:nodesource-nodejs not configured

It seems like this is happening in https://github.com/smira/aptly/blob/9cb2a302f8f138dba7887c848f956633f8b3eb01/context/context.go. I'm not sure why it skips over the first 6 characters.

// GetPublishedStorage returns instance of PublishedStorage
func (context *AptlyContext) GetPublishedStorage(name string) aptly.PublishedStorage {

	publishedStorage, ok := context.publishedStorages[name]
	if !ok {
		if name == "" {
			publishedStorage = files.NewPublishedStorage(filepath.Join(context.config().RootDir, "public"), "hardlink", "")
		} else if strings.HasPrefix(name, "filesystem:") {
			params, ok := context.config().FileSystemPublishRoots[name[11:]]
			if !ok {
				Fatal(fmt.Errorf("published local storage %v not configured", name[6:]))
}
hsitter added a commit to hsitter/aptly that referenced this issue Mar 7, 2018
hsitter added a commit to hsitter/aptly that referenced this issue Mar 7, 2018
@smira smira closed this as completed in #713 Apr 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants