publishing to bookdown.org, but not updating named site

I messed up my bookdown book, and I am hoping that you can help.

I managed to somehow get disconnected from my public bookdown.org site, which is
https://bookdown.org/pdr_higgins/rmrwr/

Updates that I publish go to RStudio connect, and are updated at
https://bookdown.org/connect/#/apps/6226/access
(most recently, content in Chapter 4 beyond 4.2)
but these no longer propagate to
https://bookdown.org/pdr_higgins/rmrwr/
(which is at https://bookdown.org/connect/#/apps/5384/access)

When I publish, I get appropriate messages, including

`R> bookdown::publish_book(account = 'pdr_higgins')

Preparing to deploy site...
Update application currently deployed at
https://bookdown.org/content/6226/? [Y/n] Y
DONE
Uploading bundle for site: 6226...DONE
Deploying bundle: 32513 for site: 6226 ...
[Connect] Building static content...
[Connect] Launching static content...
Site successfully deployed to https://bookdown.org/content/6226/`

So it looks like it is updating the site (actually a slightly different site)- but it is not changing the content at
https:/bookdown.org/pdr_higgins/rmrwr

One thing that may (or may not) be relevant - when I connected to RStudio, I was asked to log in via google. Previously Safari had stored my login information. I don't know if I am somehow logged in slightly differently - it seems unlikely, but...

One (probably more likely) cause is that I experimented with changing the book_filename in _bookdown.yml (terrible idea, it turns out) from "rmrwr" to "RMRWR".

I have since changed it back, and saved the updated _bookdown.yml file, committed and pushed,
re-rendered the book and re-published.
When I publish, RStudio opens a connection to Rstudio connect at


which has the updates to content.

But if I look at the top left, next to the 'hamburger' menu, it says Content/RMRWR - so it is still updating the 'capitalized' version.

If I click on the Content link, next to the 'hamburger' menu, I see a list of bookdown books, including RMRWR (the most recently updated), but there is also rmrwr (lower case version), which has not been updated since yesterday.

Of note, if you click on the access tab on the right in Rstudio connect, the content URL listed on the most updated (capitalized RMRWR) version is

But the older, proper (lower case rmrwr) version with the custom URL has a content URL listed of
https://bookdown.org/pdr_higgins/rmrwr
which is where I want the updates to go.

Essentially, I want to make sure that all publishing updates go to
https://bookdown.org/pdr_higgins/rmrwr
but currently they seem to be going to
https://bookdown.org/content/6226

Also note that if I specify the name argument in the publish_book function, e.g.
bookdown::publish_book(account = 'pdr_higgins', name = 'rmrwr')`
as the lower case version "rmrwr"
(even though it should default to this as this is the book_filename in _bookdown.yml),
it still deploys to

https://bookdown.org/content/6226/

rather than
https://bookdown.org/pdr_higgins/rmrwr

How do I fix this so that when I run
`bookdown::publish_book(account = 'pdr_higgins')
I am updating the 'rmrwr' version and effectively update the

https://bookdown.org/pdr_higgins/rmrwr/
website?

thanks for your help!

In your computer, the deployment is saved in a rsconnect folder you should find locally. In this folder, there should be a dcf file (or several) - one should contains a reference to content 6226 for your book, and associated with your account and the name. It is possible this name is not sensible to lower or upper case, and it may be why the content is associated only to the second, even when you pass the name lower case.

I think you can list the info rsconnect can find by using

rsconnect::deployments(".")

Anyway, rsconnect is associating your book deployment to this content, and publish_book() uses it.

FWIW, according to the info about your book deployment, last deployed time for https://bookdown.org/pdr_higgins/rmrwr is "Jan 1, 2021 12:34am (GMT+01:00)"

There are several solution I believe.

By any chance, if you open index.Rmd in the RStudio IDE, do you see several deployment under the publish button ? (upper right in the source pane I think).

Also, did you try to remove the the second book deployment on bookdown.org ? Then you can retry to use

bookdown::publish_book(account = 'pdr_higgins', name = 'rmrwr')

if the name is associated to the second content locally, you may need to forget the deployment

rsconnect::forgetDeployment(dryRun = TRUE)

Use FALSE if you are ok to forget what is reported by the above.

Otherwise, you can for sure publish to the lowercase named version using the id. (5384)

You would need to use rsconnect::deploySite()directly (bookdown::deployBook() does not support the id)

I think that would work:

rsconnect::deploySite(account = 'pdr_higgins', siteName = 'rmrwr', appId = 5384)

But without correcting the reference in rsconnect folder, you would need to use the id each time.

Also, if you want to change the bookfilename to RMRWR, we can change that.

The last solution would be to remove the previous book and keep only the last published book (the one you are managing to publish to) and we can set the correct url on this one
https://bookdown.org/pdr_higgins/RMRWR/ or keep https://bookdown.org/pdr_higgins/rmrwr/

Anyway, I let you see what you think is more suited for your time and what you want to do

hope it helps

1 Like

Thanks, @cderv, this is a huge step forward. I just did not know where to start.

I went ahead and removed the 2nd book deployment on bookdown.org.
But now when I try to publish, I get

R> bookdown::publish_book(account = 'pdr_higgins', name = 'rmrwr')
Preparing to deploy site...Error: HTTP 404
GET https://bookdown.org/__api__/applications/6226
The requested object does not exist.

Then, at your suggestion, I ran

rsconnect::deploySite(account = 'pdr_higgins', siteName = 'rmrwr', appId = 5384)

And I am back!!!

Thank you so much!

This is wonderful!!

Definitely star this solution!

1 Like

For anyone following along, this approach edits the file
rmrwr.dcf
in the path
Home/Docuuments/Rcode/rmrwr-book/rsconnect/documents/index.Rmd/bookdown.org/pdr_higgins
[Note that rmrwr-book is the name of the RStudio project]
[Note that pdr_higgins is my account id on bookdown.org]
to change the field appId from 6226
to
appId: 5384
which is what fixed things.

And I did not previously realize that this file even existed in the project.
Turns out it is pretty important.
So there you go.

1 Like

Great ! Glad it works.

I think it would have work by removing the rsconnect folder for your book deployment and republishing using the name only, or using the appId.

Anyway, usually you don't have to look into this file - you were in a specific situation because you publish the content twice on the same server with the same name. Does not happen often :wink:

Great book by the way ! :clap:

1 Like

Thanks! Lots more content to add, now that I have the framework in place!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.