This is a glossary of all the common issues in Microsoft - NNI
  • 11-Jan-2023
Lightrun Team
Author Lightrun Team
Share
This is a glossary of all the common issues in Microsoft - NNI

Troubleshooting Common Issues in Microsoft – NNI

Lightrun Team
Lightrun Team
11-Jan-2023

Project Description

 

Microsoft Neural Network Intelligence (NNI) is an open-source toolkit for optimizing machine learning workflows. It is designed to help researchers and data scientists automate and accelerate the process of tuning machine learning models, which can be a time-consuming and labor-intensive task.

NNI provides a range of features and tools for optimizing machine learning models, including automatic hyperparameter tuning, model selection, and architecture search. It is built on top of popular machine learning frameworks such as TensorFlow and PyTorch, and can be used to tune models for a variety of applications, including image classification, natural language processing, and predictive analytics.

One of the key advantages of NNI is its ability to perform experiments in parallel, which can significantly reduce the time it takes to find the optimal model. It also includes a web-based dashboard for tracking the progress of experiments and visualizing the results, which makes it easy to compare different models and identify the best-performing ones. Overall, NNI is a useful tool for anyone working with machine learning and looking to streamline and optimize their model development process

 

Troubleshooting Microsoft – NNI with the Lightrun Developer Observability Platform

 

Getting a sense of what’s actually happening inside a live application is a frustrating experience, one that relies mostly on querying and observing whatever logs were written during development.
Lightrun is a Developer Observability Platform, allowing developers to add telemetry to live applications in real-time, on-demand, and right from the IDE.
  • Instantly add logs to, set metrics in, and take snapshots of live applications
  • Insights delivered straight to your IDE or CLI
  • Works where you do: dev, QA, staging, CI/CD, and production

The most common issues for Microsoft – NNI are:

 

Use environment variables defined in `.env` file when running code in a terminal

 

To use environment variables defined in a .env file when running code in a terminal, you can use the dotenv library. Here is an example of how you can use it in your code:

import os
from dotenv import load_dotenv

# Load environment variables from the .env file
load_dotenv()

# Access an environment variable using the os.getenv() function
secret_key = os.getenv('SECRET_KEY')

# Use the environment variable in your code
print(secret_key)

You can then run your code using the python command in a terminal, and the environment variables defined in the .env file will be loaded and available to your code.

Keep in mind that the .env file should be located in the same directory as your code, and it should contain one environment variable per line in the format VARNAME=value.

For example, a .env file might look like this:

SECRET_KEY=abcdefghijklmnopqrstuvwxyz
API_KEY=1234567890
DEBUG=True

You can then access these variables in your code using the os.getenv() function as shown above.

 

SyntaxError: Unexpected token export when running jest

 

The “Unexpected token export” error typically occurs when you are trying to run a JavaScript file that uses the export keyword, but the JavaScript runtime you are using does not support the export keyword. This can happen if you are using an older version of JavaScript that does not support the export syntax, or if you are trying to run a module written in a newer version of JavaScript using a runtime that does not support the export syntax.

To fix this error, you will need to make sure that you are using a JavaScript runtime that supports the export syntax. If you are using Node.js to run your JavaScript code, you will need to use a version of Node.js that is at least 6.14.0 or higher, as this is the first version of Node.js that supports the export syntax.

If you are using a different runtime, such as a browser or a JavaScript engine like V8, you will need to check the documentation to see if it supports the export syntax. If it does not, you will need to find an alternative way to include the module in your code.

If you are using a build tool like Webpack or Babel to transpile your code, you may also need to make sure that the build tool is configured to support the export syntax.

 

Running “docker-compose up” fails to compile successfully (Error on importing STR_NA_VALUES from pandas)

 

The “Error on importing STR_NA_VALUES from pandas” error typically occurs when the version of the pandas library that you are using is incompatible with the version of the numpy library that is installed in your environment. This can happen if you have multiple versions of these libraries installed on your system, or if you have installed them using different package managers or methodologies.

To fix this error, you will need to ensure that you are using compatible versions of the pandas and numpy libraries. You can do this by running the following command to install the latest stable version of both libraries:

pip install numpy pandas

Alternatively, you can specify the exact versions of the libraries that you want to install by using the == operator, like this:

pip install numpy==1.19.1 pandas==1.1.3

You may also need to update your requirements.txt file to include the correct versions of the libraries, and then run pip install -r requirements.txt to install them.

If you are using a different package manager, such as conda, you will need to use the appropriate commands for that package manager to install the libraries.

Once you have installed compatible versions of the libraries, you should be able to run docker-compose up without encountering the “Error on importing STR_NA_VALUES from pandas” error.

 

0.62.1 Release APK: Unable to load script. Make sure you’re either running a Metro server (run ‘react-native start’) or that your bundle ‘index.android.bundle’ is packaged correctly for release.

 

The “Unable to load script” error usually indicates that the JavaScript bundle that your app is trying to load cannot be found or is not packaged correctly. This can happen for a number of reasons, such as:

  1. You are running the app in development mode, but the Metro server is not running or is not correctly serving the JavaScript bundle. To fix this, you can try running react-native start to start the Metro server, and then try running the app again.
  2. You are building a release APK, but the JavaScript bundle is not being properly packaged in the APK. To fix this, you can try running react-native bundle to rebuild the JavaScript bundle, and then try building the APK again.
  3. There is a problem with the JavaScript code in your app, such as a syntax error or a missing dependency. To fix this, you can try running react-native log-android to see if there are any errors being logged, and then try to debug and fix the errors.
  4. There is a problem with your development environment, such as missing dependencies or conflicting versions of libraries. To fix this, you can try running react-native doctor to check for any issues with your environment, and then follow the recommendations to fix them.

 

Failed to establish a new connection

 

The “Failed to establish a new connection” error typically occurs when a network connection cannot be established between two devices or services. This can happen for a number of reasons, such as:

  1. The device or service you are trying to connect to is not reachable or is offline. You can check the status of the device or service to make sure it is online and available.
  2. There is a problem with your network connection or internet service provider. You can try restarting your router or modem, or contacting your internet service provider for assistance.
  3. There is a problem with the network configuration or firewall rules on your device or network. You can check your network settings and firewall rules to make sure that they are not blocking the connection.
  4. There is a problem with the IP address or hostname of the device or service you are trying to connect to. You can check the IP address or hostname to make sure it is correct and try using a different method of connecting, such as using an IP address instead of a hostname.

 

Metro bundler not starting when running run-android / run-ios command on linux

 

The Metro bundler is a tool that is used to build and serve the JavaScript bundle for a React Native app. If the Metro bundler is not starting when you run the run-android or run-ios command, it could be due to a number of issues, such as:

  1. There is a problem with the React Native environment or dependencies. You can try running react-native doctor to check for any issues with your environment, and then follow the recommendations to fix them.
  2. There is a problem with the project configuration or code. You can try running react-native start to start the Metro bundler manually, and see if there are any errors being logged.
  3. There is a problem with the Android or iOS emulator or device. You can try running the app on a different emulator or device to see if the problem persists.
  4. There is a problem with the network connection or firewall. You can check your network settings and firewall rules to make sure that they are not blocking the Metro bundler.

 

FastAPI and Uvicorn is running synchronously and very slow

 

Some possible causes and solutions include:

  1. You are using a single worker process. By default, Uvicorn runs with a single worker process, which means that it can only handle one request at a time. To improve performance, you can try running Uvicorn with multiple worker processes using the --workers flag. For example:
uvicorn main:app --workers 4

This will start four worker processes, which can handle multiple requests concurrently and improve performance.

  1. You are using blocking code or blocking libraries. If your app is using code or libraries that block the event loop (such as synchronous HTTP clients or database drivers), it can cause the app to run slower. To improve performance, you can try using asynchronous alternatives or optimizing your blocking code.
  2. You are experiencing network or database bottlenecks. If your app is making a lot of network or database requests, it can cause performance to suffer. You can try optimizing your network and database connections, or using a load balancer or cache to distribute the load.
  3. You are using a slow or overloaded server. If your server is slow or overloaded, it can affect the performance of your app. You can try using a faster or more powerful server, or optimizing the server configuration to improve performance.

 

`compilerOptions.isCustomElement` config has no effect when running multiple test files at once

 

The compilerOptions.isCustomElement option in the Microsoft Neural Network Intelligence (NNI) toolkit is used to specify whether the input code should be treated as a custom element or a regular JavaScript file. If this option is set to true, NNI will treat the input code as a custom element, which means it will look for a class decorated with the @CustomElement decorator, which is used to define custom elements in the Web Components API. If the option is set to false, NNI will treat the input code as a regular JavaScript file and will not look for the @CustomElement decorator.

The above issue could be caused by a number of factors, such as a bug in NNI or an issue with the way your test files are structured.

One thing you can try is to make sure that the configuration file is being passed correctly to NNI when running your tests. You can do this by checking the command line arguments being passed to NNI, or by logging the contents of the configuration file to the console to ensure that it’s being read correctly.

Another thing to check is the structure of your test files. Make sure that the custom element classes that you want NNI to treat as custom elements are defined in separate files, and that those files are being included in the test suite correctly. If the custom element classes are defined in the same file as other code that is not related to the custom element, NNI may not be able to correctly identify them as custom elements.

It might also be an issue with NNI Version, which might not be compatible with custom element usage, thus checking the version of NNI that you’re using and make sure it supports the compilerOptions.isCustomElement config.

 

Running app through docker-compose doesn’t work with default network

 

There are a few things that could be causing this issue.

One possible cause could be that the services defined in your docker-compose.yml file are not able to communicate with each other due to network configuration issues. In this case, you may need to specify a custom network for your services to connect to, or to make sure that the services are on the same network.

Another possible cause could be that the services are not able to access the required resources, such as files or network ports. In this case, you may need to mount the appropriate volumes and expose the necessary ports in your docker-compose.yml file.

Additionally, it might be an issue with the specific version of docker-compose and docker you are running, check the compatibility and make sure that the versions are compatible.

You can check the logs of the containers to see if there are any errors. If there are, they may provide more information about what’s going wrong. You can also try running the application in the same environment that it was built to check if the problem is related to the running environment.

 

Running on root directory “Failed to resolve entry for package”

 

This issue could be caused by a few things. One possible cause is that the package in question is not installed in your project’s root directory. NNI uses the node_modules directory to resolve dependencies, so if the package is not installed there, it will be unable to find it. To fix this, you’ll need to run npm install or yarn install in the root directory of your project to install the missing package.

Another possible cause could be that the package path is not correctly defined in your NNI config file. If the package path defined in your config file is incorrect, NNI will be unable to find it. Make sure that the package path is correct, or use a relative path starting from the root directory of your project.

Also, the issue might be related to a specific version of node that you are running, and it’s not compatible with some packages, thus checking your version and make sure that it’s compatible with the packages you’re using in your project.

 

Error running Spring Boot Tests when a webEnvironment has been enabled

 

One possible cause could be that your Spring Boot application is attempting to start up a web server, but it is unable to do so because of a problem with the configuration. Make sure that the application.properties or application.yml file in your project is configured correctly, and check for any error messages that may be logged to the console during startup.

Another possible cause could be that there is an issue with the dependencies that you have added to your project. Double check the versions of the libraries in use and make sure they are compatible with the spring-boot version you’re using.

Also, it might be an issue with the specific version of Spring Boot you are running, or with the web environment that you are using, thus checking the version of Spring Boot and make sure that it’s compatible with the environment you’re using.

It is also possible that there is a problem with the test configuration, like in the test class, you might need to check if the @SpringBootTest annotation is being used with the correct parameters, like the webEnvironment attribute.

 

Cypress is running really slow after upgrading to v10

 

The possible cause is that the version of Cypress that you’re using is not compatible with the version of Node.js that you have installed. Cypress version 10 requires Node.js version 14 or higher, and version 11 requires Node version 16 or higher. If you’re using a version of Node that is lower than these requirements, it can cause Cypress to run slowly. So you might need to check and update Node version as well.

Another possible cause is that there are some changes in the way Cypress is working in version 10 and it’s causing the tests to run slower, some of the new features might be causing the tests to run slower.

You can also check if there are any known issues related to slow performance in version 10 of Cypress on their GitHub repository.

It might also be a good idea to profile your test runs and try to identify bottlenecks in your tests. This could be useful for finding out where the slow down is happening and if that is something you can control or optimize.

 

react-i18next:: You will need to pass in an i18next instance by using initReactI18next when running build when there is translation in top level layout

 

This error message is indicating that the react-i18next library is not able to find an instance of the i18next library, which is a dependency of react-i18next that provides internationalization functionality.

To fix this issue, you will need to make sure that you are initializing the i18next instance and passing it to react-i18next by calling the initReactI18next function. This function is typically called at the top level of your application, before rendering any components that use the i18next functionality. Here is an example of how you might initialize the i18next instance and pass it to react-i18next:

import i18next from 'i18next';
import { initReactI18next } from 'react-i18next';

i18next
  .use(initReactI18next)
  .init({
    // i18next options here
  });

It’s also important to make sure that you have both i18next and react-i18next installed in your project and are using the same version of them.

Another issue might be related to the configuration of i18next, like languages, resources, and debug options, making sure that the configuration is correct and compatible with your project.

 

Error when running executable generated by pyinstaller [pyvisa-py]

 

This error message can be caused by several issues, such as:

  • Pyinstaller is not able to include the pyvisa-py library or its dependencies correctly when creating the executable. To check this you can try to include the library and its dependencies manually when creating the executable.
  • Pyvisa-py library uses dynamic loading, which is not handled by pyinstaller. To check this you can try to include the library and its dependencies manually when creating the executable.
  • The version of pyvisa-py that you are using is not compatible with the version of Python that you are using. To check this you can try to upgrade or downgrade the library and make sure that it is compatible with the version of Python that you are using.
  • Another issue might be related to the permissions on the executable file. Make sure the user running the file have the necessary permissions to access the file.

It might also be a good idea to check the pyinstaller documentation, pyvisa-py documentation and their FAQs sections, to see if there are any known issues or solutions related to this error message.

 

microk8s is not running. microk8s.inspect showing no error

 

One possible cause is that the microk8s service is not running on your machine. To fix this, you can try running the command sudo microk8s start and see if the service starts correctly.

Another possible cause is that the microk8s service is running, but it’s not able to bind to the ports it needs to. In this case, you can try checking the firewall settings on your machine to see if they are blocking the ports that microk8s needs to use, and if that’s the case, you can try to open them.

It’s also possible that there might be an issue with the specific version of microk8s, thus checking the version of microk8s that you’re using and make sure that it’s compatible with your system.

It might also be a good idea to check the logs of the microk8s service to see if there are any error messages that can give you more information about what’s going wrong.

You can use the journalctl -u snap.microk8s.daemon-apiserver to check the logs of apiserver, journalctl -u snap.microk8s.daemon-kubelet for kubelet and so on.

 

Does not work with react-testing-library

 

One possible cause is that NNI is not properly configured to work with react-testing-library. Make sure that you have correctly set up the NNI configuration files, and that they are pointing to the correct test files and dependencies.

Another possible cause is that there might be an issue with the version of react-testing-library, thus checking the version of react-testing-library that you’re using and make sure that it’s compatible with the version of React that you are using in your project.

It might also be a good idea to check the documentation of both NNI and react-testing-library for any known issues or compatibility issues. You can also look for examples or tutorials that use both NNI and react-testing-library together to see if there are any differences in the way they are set up or used that might be causing the problem.

 

vue-router not working when running on serve

 

One possible cause is that you might not have configured the vue-router correctly in your application. Make sure that you have set up the routes correctly and that they are being imported and passed to the Vue instance in your main.js file.

Another possible cause is that you might be using an old version of vue-router that is not compatible with the version of Vue.js that you are using. So you might need to check the version of vue-router you are using and upgrade or downgrade to a version that is compatible with the version of Vue.js you are using.

It might also be a good idea to check the vue-router documentation, as well as the browser’s developer tools, to see if there are any error messages that can give you more information about what’s going wrong.

 

Client error: Connection terminated unexpectedly when server stops in the middle of running queries

 

This error message indicates that the connection to the server was closed unexpectedly and the client was not notified about it. This can be caused by a few things:

  • Network issues: The connection might be lost because of network issues, such as a temporary outage or a problem with the routing. You can check the connectivity to the server, and ensure that you have a stable and reliable network connection.
  • Server crashes: The server might have crashed or stopped unexpectedly, causing the connection to be lost. In this case, you can check the server logs to see if there are any error messages that can give you more information about the problem.
  • Timeouts: The server might be set to close connections that are inactive for a certain period of time. This is a security measure to prevent connections from staying open indefinitely, in that case, you can check the server configuration and see if you can increase the timeout value.
  • Server Configuration: There might be a limit on the number of connections that the server allows at one time. This is a common practice to prevent a server from being overwhelmed by too many connections. You can check the server configuration to see if this might be the case, and if so, increase the number of allowed connections.

It might also be a good idea to check the documentation of the database you are using and see if there are any known issues or solutions related to this error message.

 

Ability to console.log output from test files to stdout when running via `cypress run`

 

Cypress by default captures the browser’s console log and stores it in the test results. But you can also access to it in real-time by configuring Cypress to print it to stdout. One way to do this is by adding the following code in your cypress/plugins/index.js file:

module.exports = (on, config) => {
  on('task', {
    log(message) {
      console.log(message)
      return null
    },
  })
}

Then, in your test file, use Cypress.log to print messages to the console log:

it('should print to stdout', () => {
    Cypress.log('This is a test message')
  })

With this configuration, Cypress will print the log messages to the standard output as well as capturing it in the test results.

You can also use Cypress’s on('console') event.

 

Error running on Alpine

 

One possible cause is that the version of NNI that you’re using is not compatible with the version of Alpine Linux that you’re running. NNI requires a number of dependencies and libraries, and it’s possible that the version you’re using is not compatible with Alpine Linux. To fix this, you can try using a version of NNI that is specifically built to work with Alpine Linux, or you may try building NNI from source and making sure that the dependencies are compatible with Alpine Linux.

Another possible cause is that some of the dependencies for NNI are not installed or not properly configured on your Alpine Linux system. To fix this, you can try checking the requirements of NNI and ensure that they are all installed and configured correctly on your system.

It might also be a good idea to check the NNI documentation, as well as the Alpine Linux documentation, to see if there are any known issues or compatibility issues with running NNI on Alpine Linux.

 

rancher-desktop fails to start on macOS with `sudo: a password is required` while running lima

 

This error message indicates that the lima command is trying to run a command that requires root or superuser privileges, and it’s being asked for a password to proceed.

This issue can be caused by a few things:

  • You might not have configured your system to allow the use of the sudo command without providing a password. To fix this, you can try editing your sudoers file by running the visudo command, and configure it so that you can use the sudo command without being prompted for a password.
  • You might not have the necessary permissions to run the lima command. To fix this, you can try running the command with <strong>sudo</strong> or give your user the necessary permissions to run the command.
  • There might be a problem with your lima installation. To fix this, you can try reinstalling lima and make sure that it’s properly configured.

 

Can’t proxy to containers running in host network mode

 

One possible cause is that the proxy is not configured to forward traffic to containers running in host network mode. Make sure that the proxy is configured to forward traffic to the correct IP address and port of the container.

Another possible cause is that the container might be configured to listen on a different network interface or address. In host network mode the container uses the host’s network interfaces and addresses, so it’s possible that the container is not listening on the expected interface or address. To fix this, you can check the container’s configuration and make sure that it’s listening on the correct interface or address.

It’s also possible that the issue is with the version of NNI that you’re using. Host network mode is an advanced feature that might not be compatible with every version of NNI. You can check the NNI documentation or consult with the NNI community to see if there are any known compatibility issues or solutions related to this feature.

 

FastAPI+Uvicorn is running slow than Flask+uWSGI

 

The speed at which a web application runs can depend on a number of factors, including the web framework, the application’s design, and the server environment it’s running in.

FastAPI is a relatively new web framework, while Flask has been around for a while and has a large and active community. FastAPI’s performance has been shown to be faster in some benchmarks, but in actual use cases, the performance difference may not be significant. It’s also possible that the performance of your specific application may not be representative of the performance of FastAPI and Flask in general.

Uvicorn is an ASGI (asynchronous server gateway interface) server, which is designed to handle a high number of concurrent connections. uWSGI is a WSGI (web server gateway interface) server, which can handle a high number of requests, but is not designed for concurrent connections.

If you are experiencing slower performance with FastAPI+Uvicorn than with Flask+uWSGI, there are several things you can do to investigate and improve the performance of your application.

  1. First, you can try to profile your application to identify any bottlenecks.
  2. Make sure you are using the latest version of both the web framework and the server.
  3. Also check your configuration of both Uvicorn and uWSGI.
  4. Try to optimize your database queries.
  5. You can also try to use a reverse proxy such as NGINX to offload some of the work from the application server.

It’s also worth noting that FastAPI and Flask are two different web framework with their own strengths and weaknesses. For example, Flask is often considered to be more “Pythonic” and easy to understand, while FastAPI is designed for high performance and has built-in support for asynchronous programming. The choice of which one to use will depend on the specific requirements of your application.

It’s also important to test the performance of your application in a production-like environment, and consider monitoring the performance and scaling of your application to ensure that it can handle the load you expect it to.

 

Running virtual hosts on different ports of the same container

 

It’s possible to run multiple virtual hosts on different ports within the same container using a reverse proxy, such as NGINX. A reverse proxy can route incoming traffic to different web applications running on different ports within the same container, based on the hostname included in the incoming request.

Here is a basic example of how you might set this up:

  1. Start multiple web applications in different ports on the same container.
  2. Install and configure NGINX in the same container.
  3. Create a configuration file in the NGINX configuration directory that maps incoming requests to the correct port, based on the hostname. Here is an example configuration file:
    server {
        listen 80;
        server_name example1.com;
        location / {
            proxy_pass http://localhost:8000;
        }
    }
    server {
        listen 80;
        server_name example2.com;
        location / {
            proxy_pass http://localhost:8001;
        }
    }

In the above example, the first server block listens on port 80 for incoming requests for example1.com, and then proxy_pass forwards the request to the web application running on port 8000. The second server block does the same thing but for example2.com with port 8001.

  1. Restart NGINX to load the new configuration.
  2. Make sure that the DNS for example1.com and example2.com are properly pointing to the IP address of the container that you are running.

By doing this, you can use the same container to host multiple virtual hosts on different ports, which can be useful if you want to run multiple web applications with different domains or subdomains on the same server, without having to use different containers or different servers.

Note that, this is a very basic and minimal example, you can also configure this with HTTPS, caching, and other functionalities based on your use-case and requirements.

 

Running lerna bootstrap does not install all dependencies

 

Lerna is a tool that is used to manage JavaScript projects with multiple packages, and the lerna bootstrap command is used to install all the dependencies of the packages in the monorepo.

If the lerna bootstrap command is not installing all the dependencies, there are several possible reasons for this. Here are a few things you can try:

  1. Make sure that all your packages have a valid package.json file with the correct dependencies specified.
  2. Try running lerna clean to remove any stale or extraneous files, then run lerna bootstrap again.
  3. Ensure that the version of Lerna that you are using is up-to-date.
  4. It could be that Lerna is encountering a problem when trying to install some of the dependencies. Run lerna bootstrap with the --verbose option to see more detailed information about what Lerna is doing.
  5. Also check your network connection if its working fine. Some times it can be caused by network issues.
  6. Another reason that lerna bootstrap might not work as expected is if there are circular dependencies among your packages. Lerna can’t resolve these dependencies and needs additional configuration.
  7. Lastly, double check if there are any syntax errors in your package.json file.

It’s important to note that Lerna is a powerful tool that can be used in many different ways, and the specific steps needed to get it working correctly will depend on the specific configuration of your project.

 

Cypress tests loads page on browser then goes blank immediately after when running against Forge url

 

There can be several reasons for this behavior. Here are a few things you can try:

  1. Check that the URL you are using in your tests is correct and accessible. Make sure that the application is running and that there are no issues with the hosting or domain settings.
  2. Make sure you are running the latest version of Cypress.
  3. Cypress automatically waits for elements to be loaded and interactable, but if the website is taking too long to load the elements or doing some heavy processing, Cypress might consider it as not ready. You can increase the default time Cypress waits for elements by modifying Cypress.config('defaultCommandTimeout', timeout).
  4. If the website is built on single page application or has dynamic routes, you might need to use Cypress’s cy.visit() instead of cy.visit(). This is because Cypress’s cy.visit() has the ability to navigate to routes that are handled by client-side JavaScript, whereas cy.visit() does not.
  5. It could be an issue with the browser settings. Try running the tests on different browsers to see if the problem is specific to a particular browser.
  6. Some websites have security measures like CORS (Cross-Origin Resource Sharing) which can prevent Cypress from loading the website. You may want to check the browser’s developer console to see if any CORS errors are thrown.
  7. It could also be an issue with your test script. Make sure that your tests are correctly interacting with the page and that there are no errors or issues in your script.

Additionally, you can try reducing the complexity of your test case and see if the problem still exists.

 

[Bug]: Running puppeteer on docker alpine on Mac failed

 

Puppeteer is a Node.js library that provides a high-level API for controlling a headless Chrome or Chromium browser. When running Puppeteer on a Docker Alpine image on a Mac, you may encounter an issue where the library fails to run correctly.

There can be several reasons for this behavior. Here are a few things you can try:

  1. Make sure that you are using the correct version of Node.js. Puppeteer requires Node.js version 8.6 or above.
  2. Confirm that the version of Chrome or Chromium that you are using is compatible with the version of Puppeteer you are running. You can check the version of Chrome by running “chrome://version” on browser URL.
  3. Make sure that the version of the Alpine Linux image you are using is compatible with the version of Node.js and Chrome or Chromium you are using.
  4. Puppeteer relies on several system libraries and dependencies that may not be included in the Alpine image by default. You may need to add these dependencies to the image by installing them via apk package manager.
  5. Make sure you have set the necessary environment variable.
  6. If you are running the container with a non-root user, you may need to adjust the permissions of certain system libraries and files.
  7. Sometimes, the issue can come from the fact that Alpine and Mac have different architecture. One way to fix this could be to use multi-stage build in the Dockerfile.
  8. It could also be an issue with your script. Make sure that you are passing the correct options to Puppeteer and that there are no errors or issues in your script.

Additionally, you can try running the same script on a different environment and see if the problem still exists.

 

MODULE_NOT_FOUND error when running storybook on fresh project

 

The error “ModuleNotFoundError: No module named ‘nni'” usually indicates that the Microsoft NNI package is not installed in your environment.

You can install it using pip:

pip install nni

Make sure to use the right command based on the environment you are using (e.g., pip3 for Python 3, or pip for Python 2) and to run the command with the appropriate permissions (e.g., as an administrator).

Also, you may want to check your python version by running

python -V

and make sure you install the package for the correct version of python.

 

AttributeError: ‘str’ object has no attribute ‘update’ when running get_authentication_events

 

The error message “AttributeError: ‘str’ object has no attribute ‘update'” usually occurs when you’re trying to use the update() method on a string object, which doesn’t have such a method. This method is typically used on dictionaries to add key-value pairs to the dictionary.

One possible cause of this error is you’re passing a string as the authentication_events parameter instead of a dictionary. The get_authentication_events() function expects a dictionary where the keys are the names of the authentication events, and the values are the corresponding tokens.

You should check how you’re passing the authentication_events parameter to the get_authentication_events() function and make sure it’s a dictionary, not a string.

Also, please check version of your nni package, and see if there is any recent update of the package or not. Many issues could be resolved via updating the package. You can update the package by running

pip install --upgrade nni

 

Running error: context loading failed: failed to load program with go/packages: could not determine GOARCH and Go compiler

 

The error message “context loading failed: failed to load program with go/packages: could not determine GOARCH and Go compiler” is typically caused by a problem with the Go programming environment on your system. The “GOARCH” and “Go compiler” that the error message refers to are components of the Go programming language that are required for the Microsoft NNI (Neural Network Intelligence) package to work properly.

The most common cause of this error is that the Go environment is not properly installed on your system. You can check if Go is installed on your system by running the command “go version” in a terminal. If Go is not installed, you can download and install it from the official Go website (https://golang.org/dl/).

If Go is already installed on your system, the error may be caused by a mismatch between the version of Go that is installed and the version that the NNI package is expecting. This can be caused by updating your Go version or if there is different version of Go on your system. You can try to solve the issue by uninstalling the existing version of Go and install the version that is compatible with NNI package.

Also this issue can also be caused by a lack of environment variable setting. check whether you have set the GOROOT and GOARCH and GOOS environment variable or not in your system.

In addition to this, Please make sure that the package you are trying to run is not outdated. It is always a good practice to check the latest release of package on its official website and update the package to the latest version if it’s out of date.

 

Jupyter running wrong python kernel

 

The issue of Microsoft NNI running with the wrong Python kernel in Jupyter notebook can be caused by several factors.

One common cause is that the Jupyter notebook is not properly configured to use the correct Python environment. Make sure that the environment you want to use with NNI is properly set up and activated. Also, check that the appropriate kernel is installed for that environment.

Another possible cause is that the Jupyter notebook is using the wrong version of Python. This can happen if multiple versions of Python are installed on your system and the wrong version is being used by default. You can check which version of Python is being used by running the command python -V in a terminal.

You can also check in Jupyter notebook, in the top right corner, a dropdown menu indicating the current python kernel in use. You can switch to the correct kernel from there.

In addition to these issues, the NNI package may be expecting a specific version of Python, and if you are using a different version, it may not work correctly. Be sure to check the package documentation for any specific requirements on the version of Python that must be used.

You can try by specifying the python path in nni_config.yml file .

framework:
  name: local
  python_path: "path to python environment of nni"

In case the issue persist, It’s always a good practice to check the official document of NNI for troubleshoot the problem. It may have more information about the issue you are facing and possible ways to solve it.

 

Getting “Cannot use import statement outside a module” with MDX files running with Jest

 

The “Cannot use import statement outside a module” error message is typically caused by an issue with the JavaScript environment when running code that uses the “import” statement.

The import statement is a new feature in JavaScript that is part of the ES6 (ECMAScript 6) specification, and it allows you to use modules in your JavaScript code. But since most of the environments do not have built-in support for ES6 modules, we need to use a build tool like webpack, babel or typescript to transpile the code to a version of JavaScript that can run in older environments.

When you run your code with Jest (JavaScript Testing Framework) it is running in node environment that does not support ES6 modules natively, that’s why you are getting this error message.

To solve this problem, you will need to configure your project to transpile your code to an older version of JavaScript that can run in the node environment. This is commonly done using a tool like Babel.

You can also configure Jest to run with babel by installing babel-jest package, which will allow you to use import statement in your code.

You can also set the "type": "module" in package.json.

{
  "type": "module"
}

This will tell Node.js to use the experimental ECMAScript Modules implementation when loading .js files.

You also check your Jest configuration in the package.json or jest.config.js file, to see if there is any configuration that is preventing the use of the import statement.

Make sure that you have the latest version of the packages you are using and it’s compatible with the version of Node.js you are running.

 

Retrieve global variable after running jest programatically

 

In JavaScript, global variables are properties of the global object (window in a web browser, or global in Node.js). When you run a Jest test programmatically, it runs in a Node.js environment, and the global object is global.

You can retrieve a global variable in Jest by accessing it directly from the global object. For example, if you have a global variable named myVariable, you can access it like this:

const myVariableValue = global.myVariable;

You can also use the global keyword in order to access the global variable, like this:

const myVariableValue = myVariable;

Keep in mind that in order to access this variable, you have to set it as global first. This can be done using the global keyword in the test itself, like this:

global.myVariable = 'some value';

You should avoid using global variables when possible, as they can lead to unpredictable and hard-to-debug behavior. Instead, you should pass any values that your test needs as arguments to the test function, or use a tool like jest.mock or jest.spyOn to isolate your tests from the global environment.

It’s also a good practice to cleanup the variables after the test is done, so that it does not affect the next test or the overall environment by using beforeEach, afterEach, beforeAll and afterAll hooks.

 

SQS returns “ExpiredToken: The security token included in the request is expired” for long running process

 

The “ExpiredToken: The security token included in the request is expired” error message is typically caused by an issue with the AWS security token that is used to authenticate the request to the Amazon Simple Queue Service (SQS).

AWS security tokens are temporary credentials that are issued by AWS Identity and Access Management (IAM) and are used to authenticate requests to AWS services. These tokens have a fixed expiration time, typically 1 hour, after which they can no longer be used to authenticate requests.

When you have a long-running process where it takes more than 1 hour to complete, in that case, the token expires before the process ends and you end up receiving the “ExpiredToken” error.

There are a few ways to solve this problem:

  1. Use an IAM role with a longer expiration time: By default, the expiration time of a security token is 1 hour. But you can create an IAM role that has a longer expiration time and use that role to authenticate your requests.
  2. Refreshing the Token: You can also refresh the security token programmatically, by using the STS (Security Token Service) , which will allow you to request a new token with a new expiration time before the current token expires.
  3. Using long-term credentials: Instead of using temporary security tokens, you can also use long-term credentials, such as access keys, which do not expire. These credentials are associated with an IAM user or role and can be used to authenticate requests to AWS services.

Please make sure that you have the latest version of the SDK you are using and it’s compatible with the version of AWS services you are trying to connect with.

It’s also a good practice to handle the token expiration and refresh the token before it expires to avoid any interruption in the process.

 

Android with RN 0.67.3 crashes when running custom build type with hermes enabled

 

The issue of an Android app built with React Native (RN) version 0.67.3 crashing when using a custom build type with Hermes enabled is likely caused by a compatibility issue between the version of RN you are using and the version of Hermes you have enabled.

Hermes is a JavaScript engine developed by Facebook that is designed to improve performance on Android devices, but it’s not fully compatible with all versions of React Native. React-Native version 0.67 and above have Hermes built-in and it’s enabled by default. However, RN version 0.67.3 is not fully compatible with Hermes and it may cause the app to crash.

A possible solution for this problem is to disable Hermes for the custom build type. This can be done by adding the following line in your android/app/build.gradle file:

android {
    ...
    buildTypes {
        custom {
            ...
            // Add this line
            hermesEnabled false
        }
    }
}

You can also try downgrading your React-Native version to a version that is compatible with Hermes, and then re-enable it.

Another solution is to use the latest version of React Native and make sure that you are using compatible versions of other dependencies such as react-native-reanimated, react-native-screens and react-navigation.

It’s always a good practice to keep an eye on the version compatibility of the library and the dependencies that are being used in the project.

Keep in mind that this is just one possible cause of the crash, other factors might be involved. In case the issue persists, please check the error message and the stack trace for more information.

 

Out of memory error on workers while running Beam+Dataflow

 

An “out of memory” error on workers while running Apache Beam with Google Cloud Dataflow can be caused by several factors.

One common cause is that the amount of memory allocated to each worker is not sufficient to process the data that is being processed by the pipeline. To solve this problem, you should increase the amount of memory that is allocated to each worker. You can do this by specifying the --workerMachineType option when you submit your pipeline and set it to a machine type that has more memory.

Another cause could be the pipeline is using too many resources and it’s unable to process the input data within the memory capacity.

A potential solution to this problem is to increase the number of workers that are used to process the data so that the load is distributed among more machines and each worker is less likely to run out of memory. You can do this by specifying the --numWorkers option when you submit your pipeline and set it to a higher number.

It’s also possible that the pipeline is performing too many operations that require large amount of memory, such as:

  • Large JOIN operations
  • Big GroupByKey operations
  • Doing large calculations on the data You can try to decrease the amount of data that is processed by the pipeline at any given time, by splitting the input into smaller chunks and processing them separately.

You may also want to look into what is being done with the output of the pipeline, if the output is not written to a storage system in a quick manner and is held in memory, it may cause the workers to run out of memory.

In addition to these, it’s always a good practice to profile your pipeline, check the memory usage and performance by running the pipeline with the Dataflow profiler, and check the results.

Keep in mind that these are just some possible causes of the “out of memory” error, and the specific cause of the error in your case may be different. In case the issue persists, please check the error message and the stack trace for more information.

 

[iOS] TextInput default text color change to white when running on real device

 

The text input default text color in Microsoft’s Neural Network Intelligence (NNI) library for iOS is determined by the operating system’s default settings. If you’re running on a real device and the text color is showing up as white, it may be because the device’s theme is set to light mode, causing the text to be white by default.

One way to change the text color of the input field is by setting the textColor property on the UITextField or UITextView object that you’re using to display the input field. For example, you can use the following code to set the text color to black:

textField.textColor = UIColor.black

Alternatively, you can use the Interface builder to change the color of the text.

  1. Open the Main.storyboard
  2. Click on the text field you want to change
  3. Go to the Attribute Inspector
  4. Change the color of the Text property

You could also apply a global style for your app on storyboard and it will automatically change the color for the whole app.

 

Container stops on github environment: Error response from deamon: Container is not running

 

When you see the error “Error response from daemon: Container is not running,” it typically means that the container has stopped running for some reason. This can happen for a variety of reasons, such as if the container encounters an error, runs out of memory, or is terminated by a user.

To troubleshoot this issue, you can try the following steps:

  1. Check the container’s logs by running the command docker logs [container_name] to see if there are any error messages that indicate why the container stopped running.
  2. Check the system’s resource usage by running the command docker stats [container_name] to see if the container was terminated because it ran out of memory or other system resources.
  3. Check if any commands like docker stop, docker kill, docker rm were executed on the container.
  4. Try restarting the container with the command docker start [container_name] to see if it can be restarted successfully.
  5. If the above steps don’t work, you can try removing the container with the command docker rm -f [container_name] and then start again with the docker run command or whatever command you are using to start the container.
  6. Make sure that you have the latest version of the container running and that the dependencies for the container are satisfied.
  7. Check if the container is not conflicting with any other ports or any other services which are running on the same port.

 

Pytest running doesn’t take into consideration env.

 

In Microsoft’s Neural Network Intelligence (NNI) library, the pytest command is used to run unit tests. pytest does not inherently consider the environment when running tests, but you can set up your tests to take the environment into consideration.

One way to do this is by using environment variables in your test code. You can set environment variables in the command line before running pytest, and then access those variables in your tests. For example, you can set an environment variable called NNI_PLATFORM to the value gpu before running pytest:

export NNI_PLATFORM=gpu
pytest

And in the test code, you can access that variable using os.environ dictionary:

import os

def test_platform():
    assert os.environ["NNI_PLATFORM"] == "gpu"

Another way is by using a library such as pytest-env which allows you to set an environment variable for test session, you can install by running pip install pytest-env Then use pytest_env variable in your test code.

def test_platform(pytest_env):
    pytest_env["NNI_PLATFORM"] = "gpu"
    assert os.environ["NNI_PLATFORM"] == "gpu"

You could also consider the use of ‘conftest.py’ file to pass environment variables to the test cases.

 

Segmentation fault (core dumped) on Github Actions running Node.js 12.x

 

“Segmentation fault (core dumped)” is an error message that indicates that your Node.js application has crashed and a core dump has been created. A core dump is a file that contains the memory image of a process at the time of crash, which can be used for debugging.

There are a few possible causes for this error:

  1. Memory issues: A segmentation fault can occur when a program tries to access memory that it is not allowed to access, such as memory that has already been freed or memory that belongs to another process. Make sure your app not using too much memory and check if there’s no memory leak.
  2. Compiler Issues: A segmentation fault can also occur if there is a bug in the code that is being compiled, such as an invalid memory reference or an uninitialized variable. Make sure you’re using the latest version of the compiler and try to update all the dependencies
  3. Issue with the library: If you are using any libraries, make sure that those are compatible with the version of node you are using
  4. Code issue: Sometimes, the issue is with the code itself, it could be a bug or an undefined behavior

To troubleshoot this issue, you can try the following:

  1. Generate a core dump file and analyze it using gdb (or other tool) to see where the segmentation fault occurred.
  2. Use tools like valgrind, heapdump, node-inspector to trace the issue
  3. You could also try running the test on your local machine to check if you can reproduce the error and debug locally.
  4. Try reproducing the issue on a different operating system, or with a different version of Node.js.

 

ClassCastException at running JUnit-Test with Annocation @QuarkusTest

 

A ClassCastException is an exception that occurs when an attempt is made to cast an object to a class that is not related to it.

In the context of running JUnit tests with the @QuarkusTest annotation, the ClassCastException is likely occurring because there is a mismatch between the class that is being tested and the expected type specified in the test.

To troubleshoot this issue, you can try the following:

  1. Verify that the class you are trying to test is annotated with @QuarkusTest and that all the necessary dependencies are properly set up.
  2. Make sure that the class being tested is being loaded by the same classloader as the one being used by the test.
  3. Check if you are trying to cast an object to the wrong class.
  4. Verify if all the dependencies are of the correct version, this could cause a class cast exception if versions are not compatible
  5. Make sure that all the necessary classes are included in the classpath for the test

You could also use a tool such as your IDE’s built-in debugging feature to step through the test and see exactly where the ClassCastException is being thrown, and the state of the variables at that point. This could give you a better idea of what’s going wrong.

 

More issues from Microsoft repos

 

Troubleshooting microsoft-vs-code | Troubleshooting-microsoft-playwright| Troubleshooting microsoft-azure-pipelines-tasks | Troubleshooting microsoft-qlib

Share

It’s Really not that Complicated.

You can actually understand what’s going on inside your live applications.

Try Lightrun’s Playground

Lets Talk!

Looking for more information about Lightrun and debugging?
We’d love to hear from you!
Drop us a line and we’ll get back to you shortly.

By submitting this form, I agree to Lightrun’s Privacy Policy and Terms of Use.