-2

edit: I have created a bug with Google for this issue https://issuetracker.google.com/issues/210205631

This is a summary of the situation:

Topic Comment
Issue Not being able to access /dev of a project. Browser console shows 404 Not Found
Worked before? Worked for months
Caused by a user-initiated change? To my knowledge, there was no change to the code nor settings of the project. There is no other accessing the code of the project. Not sure if some change happened to the spreadsheet
Project location The project's container is a spreadsheet
Project type GCP default
Deployed Execute as me + Who has access anyone
Permission I am not the owner of the spreadsheet. I am able to edit and share the spreadsheet. The owner holds @gmail.com type of account. The owner is not able to access /dev either
Script role My role in the script setting is an editor
New deployments I am able to create new deployments. New and existing deployments can be access by their URLs. But /dev
Multiple accounts I am NOT logged into multiple accounts
Browsers Tested on latest versions f 5 major browsers
Copy script When I make a copy of the script, I get the same result as above
Tested on The above applies to my google.com and my legacy free GSuite account. Tested also in incognito mode. Tested by logging into google account that got edit access to the spreadsheet then script editor was opened from the spreadsheet and /dev access from the editor
Copy spreadsheet When I make a copy of the original spreadsheet I am able to access /dev

I have a web GAS project that was working in production for months. Now there was reported an error by a user of the actual application. I went to investigate it and wanted to open test deployment but received

"Sorry, unable to open the file at present."

"unable to open the file" error screenshot

Details

The project is bound to a Google Spreadsheet. I am not the owner of the Google Spreadsheet that GAS code is attached to. I never was.

Troubleshooting steps I've taken:

I tested the issue on Firefox, Edge, Vivaldi, and Chrome. The latest version of the browsers and restarted my computer. I was able to reproduce the issue on both Gmail account and legacy GSuite account. I am not logged into multiple Google accounts. Gmail account returns this dev URL: https://script.google.com/macros/s/<deploymentId>/dev. GSuite account returns this dev URL: https://script.google.com/a/macros/<domain>/s/<deploymentId>/dev

I created a copy of the Google Script and modify it so it can access the original spreadsheet. When deploying I got this error message

"Only users in the same domain as the script may deploy this script."

I am not the owner of the new script. My role is editor. I am not able to deploy under my GSuite account. The owner is on Gmail. I am able to create new deployment under my Gmail account, but I am not able to access test environment:

deployment error screenshot

The script owner has the same /dev URL as I do and is getting the same error.

The question is self sufficient, but I made short video to show that /dev(test environment) end point is not accessible and throws this error, but versioned deployment(/exec) is accessible.

Radek
  • 13,813
  • 52
  • 161
  • 255
  • 1
    @TheMaster. thank you for the edit and for trying to help me. I added "update 1" to the question. Yes I do have edit access. I am able to run the script and create new deployments. But not to access dev environment. Not sure how I can debug web application as only dev logs comments. – Radek Nov 22 '21 at 11:42
  • 4
    Don't add "Update"s, edit your post to be the best presentation possible at time of edit. Don't expect us to watch a video or read another page; put everything needed to ask your question in your post; use words and if absolutely necessary images ([not images of text](https://meta.stackoverflow.com/q/285551/3404097)) (or gifs). [ask] [mre] Use enough words, sentences & references to parts of examples to clearly & fully say what you mean. [Help] – philipxy Nov 22 '21 at 11:45
  • `I created a copy of the Google Script and modify it so it can access the original spreadsheet` If you made the copy, aren't you the new owner? – TheMaster Nov 22 '21 at 11:52
  • @TheMaster I was surprised that I was not the owner. – Radek Nov 22 '21 at 11:52
  • Who is the owner then? The original owner? – TheMaster Nov 22 '21 at 11:53
  • Try switching to legacy editor and deploying. However, I remember reading only `owners` can access the `/dev` url. But now, the documentation says edit access is enough. – TheMaster Nov 22 '21 at 11:54
  • yes the original owner. The owner of the spreadsheet. I can ask her to give me the ownership but not sure if she is technically able to do so. hm, if actually there is such feature to transfer ownership. I am able to deploy. The only issue is that I am not able to access dev/test url. Already and newly created deployments work fine. Their urls. – Radek Nov 22 '21 at 12:00
  • The set up as it is worked for months. Google had to change something again. As the other day I had to create a bug report. – Radek Nov 22 '21 at 12:02
  • You said it worked only in production. So `/exec` worked, but `/dev` never worked. Right? – TheMaster Nov 22 '21 at 12:05
  • nono. everything worked for months as it is. But from yesterday I am not able to access /dev. It looks that the rest works ok. – Radek Nov 22 '21 at 12:09
  • 1
    Quick question - what is your access to the original *container* (spreadsheet in this case)? – Oleg Valter is with Ukraine Nov 22 '21 at 12:10
  • @OlegValter not sure what you are asking. In my question I said that I am NOT the owner of the spreadsheet. I can find what role I was given. – Radek Nov 22 '21 at 12:12
  • @Radek Yes, the role you have to the original spreadsheet. For bound scripts, the document the project is "tied" to is the "container" - I am asking because it used to be that web apps not using standalone projects inherited access of the document regardless of the script access - might be relevant. – Oleg Valter is with Ukraine Nov 22 '21 at 12:17
  • On an off-note, I would remove the parts about deployment - it is unrelated to the issue at hand, and is expected, albeit a bit frustrating, behavior (if the owner is on gmail you will not be able to deploy from GWorkspace and vice versa) – Oleg Valter is with Ukraine Nov 22 '21 at 12:20
  • I created the copy of the original script hoping that this script would give me access to /dev. But it did not work. Not sure if there is any point to discuss anything about the copy of original script. Maybe I can make hand made copy of the whole project it would probably work. And the project got only 6 files. It would help me to debug the issue in the project that was reported by its users. Then I can modify original code but it will not solve the issue. ANd I would need to maintain two projects. – Radek Nov 22 '21 at 12:20
  • 2
    On a related note, I recall a similar issue a while ago with a client of mine. Similar setup (inherited): bound script, deployed as webapp, owner a gmail account, same error. I will take a look at my notes later if the question is still around – Oleg Valter is with Ukraine Nov 22 '21 at 12:26
  • 2
    Try creating a copy of spreadsheet itself. It should contain a copy of your script project. If you make a copy of the container, you'll probably be owner of the script. – TheMaster Nov 22 '21 at 12:28
  • 1
    TheMaster. it worked. Now I can "as a workaround" access /dev to debug solve the issue of my application. Then copy new code to original script and deploy. Of course this is not the solution for my SO quiestion. But you helped me a lot. – Radek Nov 22 '21 at 12:38
  • 1
    Also related but unlikely that it is applicable here (linking for visibility): https://stackoverflow.com/q/47672900/11407695 – Oleg Valter is with Ukraine Nov 22 '21 at 12:38
  • Oleg that is why I said in my question that I am not logged into multiple Google accounts. I went through the question you pointed out. – Radek Nov 22 '21 at 12:40
  • Did you also try opening in a incognito tab? – TheMaster Nov 22 '21 at 12:42
  • The same result in an incognito mode. Not being able to access /dev – Radek Nov 22 '21 at 12:44
  • @Radek exactly why I said likely not applicable :) Linked questions show up in the sidebar for the benefit of other readers. It is likely related but not exactly your case – Oleg Valter is with Ukraine Nov 22 '21 at 12:51
  • I just wanted to explain that I already tried. I am happy and grateful for ANY help. To try out. – Radek Nov 22 '21 at 12:56
  • 1
    Another quick question - can you summarise the discussion in comments in a table in your question? In particular, it would be great to have easily findable: 1. Owner acct type of the spreadsheet; 2. Owner acct type of the script; 3. Spreadsheet role of your accts (both types); 4. Script role of both accts; 5. If the err is reproducible in incognito *while being logged in* as at least an editor *of the spreadsheet*. P.S. Acct type here means Gmail/GSuite/GWorkspace. I know you have some of this already, but it will be nice to structure it – Oleg Valter is with Ukraine Nov 22 '21 at 13:14
  • Oleg, good suggestion. Now it is hopefully better to follow. Did I miss something? PS I do not know how to create table here on SO – Radek Nov 22 '21 at 13:31
  • 1
    @Radek - it is a recent feature, but uses the good old Markdown syntax. I will take a look when I have some time - on the go right now, not very convenient to respond from mobile. In any case, even the list is nice, thanks! – Oleg Valter is with Ukraine Nov 22 '21 at 14:21
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/239460/discussion-between-oleg-valter-and-radek). – Oleg Valter is with Ukraine Nov 22 '21 at 19:01
  • 1
    This question is [discussed on Meta](https://meta.stackoverflow.com/q/413216/11407695) – Oleg Valter is with Ukraine Nov 22 '21 at 19:02
  • 1
    Related tracker: https://issuetracker.google.com/issues/207227857 – TheMaster Nov 24 '21 at 15:46
  • 2
    I have created issues tracker for this https://issuetracker.google.com/issues/207485323 – Radek Nov 24 '21 at 17:29
  • 2
    @Radek Consider adding a answer with that link. If it's a link only answer, it maybe deleted. So, explain some of the workarounds we already discussed in comments. – TheMaster Nov 24 '21 at 20:21
  • 1
    @Radek See [this answer](https://stackoverflow.com/a/69701477/) or [my answers](https://stackoverflow.com/search?tab=newest&q=user%3a8404453%20*issuetracker*) for a sample, if you need any. – TheMaster Nov 24 '21 at 20:30
  • 1
    Another Possible duplicate: https://stackoverflow.com/questions/70098401/dev-branch-of-apps-script-project-is-sometimes-not-found – TheMaster Nov 25 '21 at 10:21

1 Answers1

1

I was able to find steps how to reproduce this issue and created a bug report with Google https://issuetracker.google.com/issues/210205631

Steps to reproduce:

  1. create new standard project and deploy as web app
  2. access /dev - it works
  3. share the project with account xyz
  4. open the project under xyz and access /dev. it works
  5. modify the project under xyz accocunt and access /dev. it does NOT work. You get "Sorry, unable to open the file at present" error.
  6. open the script as owner and access /dev. it does not work
  7. save the project as owner and access /dev. it works
  8. repeat from point 4)
E_net4
  • 27,810
  • 13
  • 101
  • 139
Radek
  • 13,813
  • 52
  • 161
  • 255