Colabtools: unable to use colab, Error popup is displaying

Created on 1 Jan 2018  Â·  25Comments  Â·  Source: googlecolab/colabtools

Hi,
I am unable to use the colb, while trying to open it is giving below error as
"NotSupportedError: Failed to register a ServiceWorker: The user denied permission to use Service Worker."

While using below code getting error.

Uploading the Dataset

from google.colab import files
uploaded = files.upload()

Upload widget is only available when the cell has been executed in the current browser session. Please rerun this cell to enable.

Thanks in Advance.

Regards,
Mallikarjun
colb error

Most helpful comment

I tried whitelisting in chrome the following
https://[*.]googleusercontent.com:443

Seems to work.

All 25 comments

Can you try opening Colab in a Chrome incognito window? Or if that doesn’t
work, then possibly try FireFox.

I’m trying to track down what causes this error- it’s quite rare.

On Mon, Jan 1, 2018 at 4:18 AM Mallikarjun Namagiri <
[email protected]> wrote:

Hi,
I am unable to use the colb, while trying to open it is giving below error
as
"NotSupportedError: Failed to register a ServiceWorker: The user denied
permission to use Service Worker."

While using below code getting error.

Uploading the Dataset

from google.colab import files
uploaded = files.upload()

Upload widget is only available when the cell has been executed in the
current browser session. Please rerun this cell to enable.

Thanks in Advance.

Regards,
Mallikarjun
[image: colb error]
https://user-images.githubusercontent.com/30703513/34467575-05389704-ef1c-11e7-8c5d-6b7121a129e6.PNG

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/googlecolab/colabtools/issues/17, or mute the thread
https://github.com/notifications/unsubscribe-auth/ACDYee_jlGJJYSOFEl6YrQUBWpN6zmrZks5tGM0vgaJpZM4RQDzj
.

Hi Blois,
Thanks for your response.

I tried to run the same in Chrome Incognito window, but issue is same.
The same code is working in the other network and able to upload the files too. But in my home network its not coding by using Chrome and Mozilla Firefox browsers.

Please find the below code i'm using and error details

Uploading the Dataset

from google.colab import files
uploaded = files.upload()

Save uploaded file on the Virtual Machine's

with open("train.csv", 'w') as f:

f.write(uploaded[uploaded.keys()[0]])

error:

Upload widget is only available when the cell has been executed in the current browser session. Please rerun this cell to enable.

MessageError Traceback (most recent call last)
in ()
----> 1 uploaded = files.upload()
2
3 for fn in uploaded.keys():
4 print('User uploaded file "{name}" with length {length} bytes'.format(
5 name=fn, length=len(uploaded[fn])))

/usr/local/lib/python3.6/dist-packages/google/colab/files.py in upload()
59 result = output.eval_js(
60 'google.colab._files._uploadFiles("{input_id}", "{output_id}")'.format(
---> 61 input_id=input_id, output_id=output_id))
62 files = collections.defaultdict(six.binary_type)
63

/usr/local/lib/python3.6/dist-packages/google/colab/output/_js.py in eval_js(script, ignore_result)
33 if ignore_result:
34 return
---> 35 return _message.read_reply_from_input(request_id)

/usr/local/lib/python3.6/dist-packages/google/colab/_message.py in read_reply_from_input(message_id, timeout_sec)
84 reply.get('colab_msg_id') == message_id):
85 if 'error' in reply:
---> 86 raise MessageError(reply['error'])
87 return reply.get('data', None)
88

MessageError: TypeError: Cannot read property '_uploadFiles' of undefined

Thanks in advance.

Regards,
Mallikarjun.N

The error with files.upload() is because it requires the browser's ServiceWorker API to function correctly. I'm trying to understand why Service Workers appear to not be working for you- normally they are only disabled when third-party cookies are disabled. I'd be curious if you happen to have any non-standard cookies settings in chrome://settings/content/cookies?

I appreciate the help tracking this down!

Hi Blois,

Issue got resolved by disabled to cookies settings as 'Block third-party cookies'.

Thanks for your support.

Regards,
Mallikarjun.N

I am still facing the same issue. As mentioned that enabling 3rd part cookies will resolve the same, but not for me. I am using firefox 59.0.1 (64-bit). I am adding colab file here.
-Rajat

Hello R1j1t,

For me still it's working by disabling the 3rd Party Cookies.

Please find the below screenshot for better understanding.

cookies

Regards,
Mallikarjun.N

Fixes for FireFox 59 will be arriving soon, we ran into https://bugzilla.mozilla.org/show_bug.cgi?id=1446225.

I solved it using Google Chrome

I would like to keep the Block third party cookies settings to be turned on at all times for the sake of our privacy. Currently I will have to have another tab by the so that after I have finished using colab, I can turn it off right away and not to forget it. BUT I would have to do it every time I use colab.

To solve this, I have tried to add https://colab.research.google.com and [*.]google.com to the Allow whitelist on Cookies, but then the error pop up would still show. I also tried https://colab.research.google.com[/*], but chrome said its not a vaild domain.

Is there a way to whitelist colab domain for that??

@blois I'm using Firefox 60 and I'm still having this exact problem

I tried whitelisting in chrome the following
https://[*.]googleusercontent.com:443

Seems to work.

And __why__ do we all have to enable the sh..ty 'third party cookies', may I ask? Because 'tha almighty google' said so? :)

What is installed when you do is:

Origin https://4xycel57pw-colab.googleusercontent.com/
Size on disk
10.8 KB
Scopes
https://4xycel57pw-colab.googleusercontent.com/v2/usercontent/8b5e8f2bbe60490e/

The third party cookies stems from Colab's use of Service Workers within iframes hosted on separate origins (the *-colab.googleusercontent.com domain). The service workers are used to allow rich outputs to communicate directly to the runtime and also to allow those outputs to continue to work when viewed later.

The Service Workers are tied to third-party cookies by the browser: https://dev.chromium.org/Home/chromium-security/security-faq/service-worker-security-faq#TOC-Can-iframes-register-Service-Workers-

Most outputs will continue to work without these enabled. Colab should only prompt once on startup for this then make a best-effort to continue, but some visualizations may not work.

That is __exactly__ what should have been written on the pop-up instead of the cryptic: " NotSupportedError: Failed to register a ServiceWorker: The user denied permission to use Service Worker."

Thank you for the clarification.

I tried whitelisting in chrome the following
https://[*.]googleusercontent.com:443

Seems to work.

Best answare ever!

Best answer? Google will have to answer for _not_ blocking google, doubleclick and other sh...tty tracking cookies in Chromium when the user explicitly blocks (or 'blacklists' if you use this word) them... some day. That will be the best answer. My guess is it will be in a court hearing.

Hi Blois,

Issue got resolved by disabled to cookies settings as 'Block third-party cookies'.

Thanks for your support.

Regards,
Mallikarjun.N

ya it's working
thank you

I'm working on 'Chrome 83.0.4103.97'

Disabled 'Block third-party cookies'
image

Added 'https://[*.]googleusercontent.com:443' to Allow
image

Still the same Error

This may also occur if outputs are being displayed which are consuming 100% of your CPU- you can see this in Chrome's Task Manager. Killing the task in task manager or restarting Chrome may fix the issue.

@blois thanks, I did as you told and that was exactly the problem.

This may also occur if outputs are being displayed which are consuming 100% of your CPU- you can see this in Chrome's Task Manager. Killing the task in task manager or restarting Chrome may fix the issue.

but i need the output

Typically this occurs if the output is too large or includes code which is consuming too much CPU.

I'm working on Chrome Version 84.0.4147.105 (Official Build) (64-bit) on Mac OS

Added 'https://[*.]googleusercontent.com:443' to Allow

Still the same error when running any commend that is printing any word.

While Using Brave Turn off shield to solve this issue

Also make sure you're not using any Tracker Blocker or third party plugin that is blocking scripts

Was this page helpful?
0 / 5 - 0 ratings

Related issues

paulgureghian picture paulgureghian  Â·  6Comments

travelmail26 picture travelmail26  Â·  4Comments

nprandall picture nprandall  Â·  5Comments

htadashi picture htadashi  Â·  4Comments

saurabhgayali picture saurabhgayali  Â·  4Comments